Conversation
|
I think this PR is fine, happy with it if it satisfies @sffc. I do not think however it solves the original problem, because the original problem is not well-defined (what kind of string you expect as "valid text" depends on a per-import context). Arguably, "it's a String" and "it's textual data" mean the same thing, so in my point of view what this PR writes is just a tautology. A description that more closely matches what Shane is asking for (but is not enforceable) would probably be:
|
|
I'm happy with the section of ECMA-262 that @eemeli cited: "The String type is generally used to represent textual data in a running ECMAScript program". This is ECMA-262 accomplishing both of the following:
Note: The line between "binary data" and "textual data" is fairly clear. There are a multitude of ways to define it, whether technically (something based on code points) or semantically (something that contains content that humans can read if they need to). We might consider a separate editorial change to write a more proper definition of "textual data". |
@sffc Could you clarify if this means that you don't think this PR's change is needed, as we already have the language you're looking for in the spec? |
My intent with the word "happy" was to emphasize that I was glad to see you citing the pre-existing language in your PR body. I would like this PR to land because it asks hosts to give us strings that contain textual data ("good" Strings) and not those that contain non-textual data ("bad" Strings). |
Closes #8
I'm filing this on behalf of @sffc, who has been advocating that the ECMA-262 part of the definition for importing text needs to signal an expectation to hosts that the
sourcestring represents text.I chose the term "should" rather than e.g. "is expected to" as the latter is often used in conjunction with algorithm steps that will emit an error if the expectation is not fulfilled. The intent here is to not create any actual requirement, just a re-affirmation of the general expectation of a String value being used to represent text.
The expression "represent textual data" I've taken from our String Type definition:
CC also @nicolo-ribaudo, who I can't unfortunately add as a GitHub reviewer.