[Webkit-unassigned] [Bug 168684] [JSC] It should be possible create a label named let when parsing Statement in non strict mode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Mar 12 19:27:34 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=168684

--- Comment #14 from Caio Lima <ticaiolima at gmail.com> ---
(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!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170313/dcb49bb1/attachment.html>


More information about the webkit-unassigned mailing list