i.e case like the following codes: ``` if (true) let: x() ``` or ``` with ({}) let: y() ```
Created attachment 302324 [details] WIP - Patch It starts. I still need to test it and create test cases.
Comment on attachment 302324 [details] WIP - Patch Attachment 302324 [details] did not pass jsc-ews (mac): Output: http://webkit-queues.webkit.org/results/3168805 New failing tests: jsc-layout-tests.yaml/js/script-tests/let-syntax.js.layout-no-llint ChakraCore.yaml/ChakraCore/test/LetConst/DeclOutofBlock.js.default jsc-layout-tests.yaml/js/script-tests/let-syntax.js.layout-no-cjit jsc-layout-tests.yaml/js/script-tests/let-syntax.js.layout-ftl-no-cjit ChakraCore.yaml/ChakraCore/test/strict/bug212755.js.default jsc-layout-tests.yaml/js/script-tests/let-syntax.js.layout-dfg-eager-no-cjit jsc-layout-tests.yaml/js/script-tests/let-syntax.js.layout jsc-layout-tests.yaml/js/script-tests/let-syntax.js.layout-no-ftl jsc-layout-tests.yaml/js/script-tests/let-syntax.js.layout-ftl-eager-no-cjit ChakraCore.yaml/ChakraCore/test/strict/comma_bug219390.js.default
Comment on attachment 302324 [details] WIP - Patch Attachment 302324 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/3168979 New failing tests: js/let-syntax.html
Created attachment 302340 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Comment on attachment 302324 [details] WIP - Patch Attachment 302324 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/3168997 New failing tests: js/let-syntax.html
Created attachment 302344 [details] Archive of layout-test-results from ews117 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews117 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 302324 [details] WIP - Patch Attachment 302324 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/3169004 New failing tests: js/let-syntax.html
Created attachment 302345 [details] Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.11.6
Comment on attachment 302324 [details] WIP - Patch Attachment 302324 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/3171878 New failing tests: js/let-syntax.html
Created attachment 302383 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Created attachment 304040 [details] Patch
Created attachment 304118 [details] Patch
Comment on attachment 304118 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=304118&action=review r=me with comments > Source/JavaScriptCore/parser/Parser.cpp:1729 > + case LET: { > + if (!strictMode()) { > + bool allowFunctionDeclarationAsStatement = false; > + result = parseExpressionOrLabelStatement(context, allowFunctionDeclarationAsStatement); > + shouldSetPauseLocation = !context.shouldSkipPauseLocation(result); > + break; > + } > + goto defaultCase; > + } This is duplicate code with he IDENT/AWAIT/YIELD case below. Maybe add a goto to that case, or make a lambda that is called both here and there. > LayoutTests/js/script-tests/let-syntax.js:56 > +function shouldNotHaveSyntaxErrorSloopyOnly(str) Typo: "Sloopy" => "Sloppy" > LayoutTests/js/script-tests/let-syntax.js:96 > +shouldNotHaveSyntaxErrorSloopyOnly("let x; with ({}) let: y = 3;"); Can you also add a test where you omit the ":" after the label. Something like: "let x; with ({}) let y = 3;" And it should be a syntax error in sloppy mode.
(In reply to comment #13) > Comment on attachment 304118 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=304118&action=review > > r=me with comments > > > Source/JavaScriptCore/parser/Parser.cpp:1729 > > + case LET: { > > + if (!strictMode()) { > > + bool allowFunctionDeclarationAsStatement = false; > > + result = parseExpressionOrLabelStatement(context, allowFunctionDeclarationAsStatement); > > + shouldSetPauseLocation = !context.shouldSkipPauseLocation(result); > > + break; > > + } > > + goto defaultCase; > > + } > > This is duplicate code with he IDENT/AWAIT/YIELD case below. Maybe add a > goto to that case, or make a lambda that is called both here and there. Done. > > LayoutTests/js/script-tests/let-syntax.js:56 > > +function shouldNotHaveSyntaxErrorSloopyOnly(str) > > Typo: "Sloopy" => "Sloppy" Oops. Thanks! > > LayoutTests/js/script-tests/let-syntax.js:96 > > +shouldNotHaveSyntaxErrorSloopyOnly("let x; with ({}) let: y = 3;"); > > Can you also add a test where you omit the ":" after the label. Something > like: > > "let x; with ({}) let y = 3;" > > And it should be a syntax error in sloppy mode. Done. Thank you very much for the review Saam!
Created attachment 304217 [details] Patch
Comment on attachment 304217 [details] Patch Clearing flags on attachment: 304217 Committed r213850: <http://trac.webkit.org/changeset/213850>
All reviewed patches have been landed. Closing bug.
*** Bug 148098 has been marked as a duplicate of this bug. ***