-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Prohibit async methods named 'function' #884
Conversation
LGTM, but we might need to seek consensus in the next meeting. I'm +1 to restrict the function name. |
Closing per consensus |
https://bugs.webkit.org/show_bug.cgi?id=172598 Reviewed by Mark Lam. JSTests: * stress/async-await-syntax.js: (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntax): (testTopLevelAsyncAwaitSyntaxSloppyMode): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode.testSyntax): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode): (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntaxError): Source/JavaScriptCore: Prevent async method named 'function' in class. Link to change in ecma262 specification tc39/ecma262#884 * parser/Parser.cpp: (JSC::Parser<LexerType>::parseClass): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@217478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=172660 Reviewed by Saam Barati. JSTests: * stress/async-await-syntax.js: (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntaxError): Source/JavaScriptCore: Prevent async method named 'function' in object. tc39/ecma262#884 * parser/Parser.cpp: (JSC::Parser<LexerType>::parsePropertyMethod): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@217578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
To expand on @rwaldron 's comments, we decided at the May 2017 TC39 meeting not to do this patch, as it seemed like, because the grammar of class bodies is more restricted, two-token lookahead would not be a problem. On the other hand, it would be an unexpected lack of behavior to not be able to make async methods with this name. |
https://bugs.webkit.org/show_bug.cgi?id=172776 Reviewed by Mark Lam. JSTests: * stress/async-await-syntax.js: (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntax): (testTopLevelAsyncAwaitSyntaxSloppyMode): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode.testSyntax): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode): (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntaxError): Source/JavaScriptCore: Rolling out https://bugs.webkit.org/show_bug.cgi?id=172660 r217578, https://bugs.webkit.org/show_bug.cgi?id=172598 r217478 PR to spec was closed, so changes need to roll out. See tc39/ecma262#884 (comment) * parser/Parser.cpp: (JSC::Parser<LexerType>::parseClass): (JSC::Parser<LexerType>::parsePropertyMethod): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@217629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=172598 Reviewed by Mark Lam. JSTests: * stress/async-await-syntax.js: (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntax): (testTopLevelAsyncAwaitSyntaxSloppyMode): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode.testSyntax): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode): (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntaxError): Source/JavaScriptCore: Prevent async method named 'function' in class. Link to change in ecma262 specification tc39/ecma262#884 * parser/Parser.cpp: (JSC::Parser<LexerType>::parseClass): Canonical link: https://commits.webkit.org/189536@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=172660 Reviewed by Saam Barati. JSTests: * stress/async-await-syntax.js: (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntaxError): Source/JavaScriptCore: Prevent async method named 'function' in object. tc39/ecma262#884 * parser/Parser.cpp: (JSC::Parser<LexerType>::parsePropertyMethod): Canonical link: https://commits.webkit.org/189628@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=172776 Reviewed by Mark Lam. JSTests: * stress/async-await-syntax.js: (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntax): (testTopLevelAsyncAwaitSyntaxSloppyMode): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode.testSyntax): (prototype.testTopLevelAsyncAwaitSyntaxStrictMode): (testTopLevelAsyncAwaitSyntaxSloppyMode.testSyntaxError): Source/JavaScriptCore: Rolling out https://bugs.webkit.org/show_bug.cgi?id=172660 r217578, https://bugs.webkit.org/show_bug.cgi?id=172598 r217478 PR to spec was closed, so changes need to roll out. See tc39/ecma262#884 (comment) * parser/Parser.cpp: (JSC::Parser<LexerType>::parseClass): (JSC::Parser<LexerType>::parsePropertyMethod): Canonical link: https://commits.webkit.org/189676@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Addresses #832