This should do the trick as far as the current spec proposal goes. However, it doesn't have any tests, and test262 hasn't had tests landed yet that we could just import, so I'm not sure what to do now. I eyeballed all the tests in https://github.com/tc39/test262/pull/1983 and am pretty sure this passes all of them. It doesn't seem a good use of time to write our own tests, that would basically just duplicate what test262 will eventually land, so I guess maybe this is in limbo until test262 gets things going.
Assignee: nobody → jwalden
Status: NEW → ASSIGNED
Okay, with bug 1531199 in place, we can implement this. Sort of. All the test262 tests that check for #! and false versions of it in literal source text (that are not negative tests) have to be skipped because of bug 1531202. Given how simple the "match hashbang" code is, I'm not worried about missing testing of the goofy-escaped versions. And while I'm not *happy* about missing testing of hashbang-not-quite-at-start (after whitespace, after multiline comment, etc.), I think it would be safe to ship this without those tests. So, how about it? I could probably add non262 versions of some of those skipped hashbang tests, if it's really desired, tho. Just, for now I'm going to try the less-effort approach. It is perhaps debatable whether BOM skipping should happen in the shell any more -- and whether BOM skipping should be allowed *along* with this feature whose position necessarily conflicts with it. I've left the skipping in place just because it changes less shell behavior, but maybe we could remove it in a followup.
Attachment #9047249 - Flags: review?(arai.unmht)
Attachment #9036062 - Attachment is obsolete: true
Attachment #9047249 - Flags: review?(arai.unmht) → review+
You need to log in before you can comment on or make changes to this bug.