<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [JSC] It should be possible create a label named let when parsing Statement in non strict mode"
href="https://bugs.webkit.org/show_bug.cgi?id=168684#c14">Comment # 14</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [JSC] It should be possible create a label named let when parsing Statement in non strict mode"
href="https://bugs.webkit.org/show_bug.cgi?id=168684">bug 168684</a>
from <span class="vcard"><a class="email" href="mailto:ticaiolima@gmail.com" title="Caio Lima <ticaiolima@gmail.com>"> <span class="fn">Caio Lima</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=168684#c13">comment #13</a>)
<span class="quote">> Comment on <span class=""><a href="attachment.cgi?id=304118&action=diff" name="attach_304118" title="Patch">attachment 304118</a> <a href="attachment.cgi?id=304118&action=edit" title="Patch">[details]</a></span>
> Patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=304118&action=review">https://bugs.webkit.org/attachment.cgi?id=304118&action=review</a>
>
> 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.</span >
Done.
<span class="quote">> > LayoutTests/js/script-tests/let-syntax.js:56
> > +function shouldNotHaveSyntaxErrorSloopyOnly(str)
>
> Typo: "Sloopy" => "Sloppy"</span >
Oops. Thanks!
<span class="quote">> > 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.</span >
Done.
Thank you very much for the review Saam!</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>