-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch IdentityEscape and Atom parsing behaviour to Annex B #93
Conversation
@adrianheine, thanks for providing this. I can take a look over the weekend in case no one else jumps up. |
That would be great! I also started working on the remainder of #90, but wanted to get this done first to minimize (my) confusion. |
Taking a closer look at this, I am not so sure yet what exactly the issue is. Here what I could figure out so far. Basically it boils down to the question what Applying the current PR version and running
Note how after applying this patch, the parsing error changes. Before, the error was due to the invalid range in From playing in the browser,
So, it seems the parsing behavior is like the Does this parsing behavior make sense to someone? |
https://tc39.github.io/ecma262/#sec-regular-expression-patterns-semantics says:
|
Edit: never mind, I got it: /\c0/.test("\u0010") // => false
/[\c0]/.test("\u0010") // => true
/\ca/.test("\u0001") // => true
/[\ca]/.test("\u0001") // => true Also: > /[\c]/.test("\\")
true
> /[\c]/.test("c")
true
> /\c/.test("\\c")
true See tc39/ecma262@421a6ae and tc39/ecma262@f48dab5. |
This is good to merge from my point of view. |
@adrianheine You figured it out. FWIW, I have a table here: https://mathiasbynens.be/notes/javascript-escapes#control |
parseIdentityEscape
currently is broken since it passes a string toisIdentifierPart
instead of a char code. This commit fixes that and switches to Annex B at the same time. There are some failing tests, though, and I'd like some help with them. I suspect there are some more hidden bugs somewhere else.