<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:sbarati@apple.com" title="Saam Barati <sbarati@apple.com>"> <span class="fn">Saam Barati</span></a>
</span> changed
<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>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #304118 Flags</td>
<td>review?
</td>
<td>review+
</td>
</tr></table>
<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#c13">Comment # 13</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:sbarati@apple.com" title="Saam Barati <sbarati@apple.com>"> <span class="fn">Saam Barati</span></a>
</span></b>
<pre>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
<span class="quote">> Source/JavaScriptCore/parser/Parser.cpp:1729
> + case LET: {
> + if (!strictMode()) {
> + bool allowFunctionDeclarationAsStatement = false;
> + result = parseExpressionOrLabelStatement(context, allowFunctionDeclarationAsStatement);
> + shouldSetPauseLocation = !context.shouldSkipPauseLocation(result);
> + break;
> + }
> + goto defaultCase;
> + }</span >
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 class="quote">> LayoutTests/js/script-tests/let-syntax.js:56
> +function shouldNotHaveSyntaxErrorSloopyOnly(str)</span >
Typo: "Sloopy" => "Sloppy"
<span class="quote">> LayoutTests/js/script-tests/let-syntax.js:96
> +shouldNotHaveSyntaxErrorSloopyOnly("let x; with ({}) let: y = 3;");</span >
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.</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>