<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[214733] releases/WebKitGTK/webkit-2.16</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/214733">214733</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-04-02 23:51:57 -0700 (Sun, 02 Apr 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/213850">r213850</a> - [JSC] It should be possible create a label named let when parsing Statement in non strict mode
https://bugs.webkit.org/show_bug.cgi?id=168684
Patch by Caio Lima <ticaiolima@gmail.com> on 2017-03-13
Reviewed by Saam Barati.
JSTests:
* ChakraCore/test/LetConst/DeclOutofBlock.baseline-jsc:
Source/JavaScriptCore:
This patch is fixing a Parser bug to allow define a label named
```let``` in sloppy mode when parsing a Statement.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseStatement):
LayoutTests:
* js/let-syntax-expected.txt:
* js/script-tests/let-syntax.js:
(shouldNotHaveSyntaxErrorSloopyOnly):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit216JSTestsChakraCoretestLetConstDeclOutofBlockbaselinejsc">releases/WebKitGTK/webkit-2.16/JSTests/ChakraCore/test/LetConst/DeclOutofBlock.baseline-jsc</a></li>
<li><a href="#releasesWebKitGTKwebkit216JSTestsChangeLog">releases/WebKitGTK/webkit-2.16/JSTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216LayoutTestsjsletsyntaxexpectedtxt">releases/WebKitGTK/webkit-2.16/LayoutTests/js/let-syntax-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit216LayoutTestsjsscripttestsletsyntaxjs">releases/WebKitGTK/webkit-2.16/LayoutTests/js/script-tests/let-syntax.js</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit216SourceJavaScriptCoreparserParsercpp">releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/parser/Parser.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit216JSTestsChakraCoretestLetConstDeclOutofBlockbaselinejsc"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/JSTests/ChakraCore/test/LetConst/DeclOutofBlock.baseline-jsc (214732 => 214733)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/JSTests/ChakraCore/test/LetConst/DeclOutofBlock.baseline-jsc        2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/JSTests/ChakraCore/test/LetConst/DeclOutofBlock.baseline-jsc        2017-04-03 06:51:57 UTC (rev 214733)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><del>-SyntaxError: Unexpected identifier 'b'. Parse error.
</del><ins>+SyntaxError: Unexpected identifier 'b'
</ins><span class="cx"> SyntaxError: Unexpected keyword 'const'
</span><del>-SyntaxError: Unexpected identifier 'd'. Parse error.
-SyntaxError: Unexpected identifier 'd'. Parse error.
-SyntaxError: Unexpected identifier 'f'. Parse error.
</del><ins>+SyntaxError: Unexpected identifier 'd'
+SyntaxError: Unexpected identifier 'd'
+SyntaxError: Unexpected identifier 'f'
</ins><span class="cx"> success
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216JSTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/JSTests/ChangeLog (214732 => 214733)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/JSTests/ChangeLog        2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/JSTests/ChangeLog        2017-04-03 06:51:57 UTC (rev 214733)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2017-03-13 Caio Lima <ticaiolima@gmail.com>
+
+ [JSC] It should be possible create a label named let when parsing Statement in non strict mode
+ https://bugs.webkit.org/show_bug.cgi?id=168684
+
+ Reviewed by Saam Barati.
+
+ * ChakraCore/test/LetConst/DeclOutofBlock.baseline-jsc:
+
</ins><span class="cx"> 2017-03-10 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> JSC: BindingNode::bindValue doesn't increase the scope's reference count.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog (214732 => 214733)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog        2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog        2017-04-03 06:51:57 UTC (rev 214733)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-13 Caio Lima <ticaiolima@gmail.com>
+
+ [JSC] It should be possible create a label named let when parsing Statement in non strict mode
+ https://bugs.webkit.org/show_bug.cgi?id=168684
+
+ Reviewed by Saam Barati.
+
+ * js/let-syntax-expected.txt:
+ * js/script-tests/let-syntax.js:
+ (shouldNotHaveSyntaxErrorSloopyOnly):
+
</ins><span class="cx"> 2017-03-09 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Align Document.elementFromPoint() with the CSSOM specification
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216LayoutTestsjsletsyntaxexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/js/let-syntax-expected.txt (214732 => 214733)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/LayoutTests/js/let-syntax-expected.txt        2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/js/let-syntax-expected.txt        2017-04-03 06:51:57 UTC (rev 214733)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx"> PASS Does not have syntax error: ''use strict'; let x = { get foo() { let foo = 20; } };'
</span><span class="cx"> PASS Does not have syntax error: 'let x = { get foo() { class foo { } } };'
</span><span class="cx"> PASS Does not have syntax error: ''use strict'; let x = { get foo() { class foo { } } };'
</span><ins>+PASS Does not have syntax error: 'let x; with ({}) let: y = 3;'
</ins><span class="cx"> SyntaxError: Unexpected keyword 'let'. Can't use 'let' as an identifier name for a LexicalDeclaration.
</span><span class="cx"> SyntaxError: Unexpected keyword 'let'. Can't use 'let' as an identifier name for a LexicalDeclaration.
</span><span class="cx"> PASS Has syntax error: 'let let;'
</span><span class="lines">@@ -189,8 +190,8 @@
</span><span class="cx"> SyntaxError: Cannot declare a let variable twice: 'i'.
</span><span class="cx"> SyntaxError: Cannot declare a let variable twice: 'i'.
</span><span class="cx"> PASS Has syntax error: ''use strict'; for (let i = 20, j = 40, i = 10; i < 10; i++) {}'
</span><del>-SyntaxError: Unexpected identifier 'x'. Parse error.
-SyntaxError: Unexpected identifier 'x'. Parse error.
</del><ins>+SyntaxError: Unexpected identifier 'x'
+SyntaxError: Unexpected identifier 'x'
</ins><span class="cx"> PASS Has syntax error: 'let x = 20; if (truth()) let x = 40;'
</span><span class="cx"> SyntaxError: Unexpected keyword 'let'
</span><span class="cx"> SyntaxError: Unexpected keyword 'let'
</span><span class="lines">@@ -387,6 +388,9 @@
</span><span class="cx"> SyntaxError: Cannot declare a class twice: 'x'.
</span><span class="cx"> SyntaxError: Cannot declare a class twice: 'x'.
</span><span class="cx"> PASS Has syntax error: ''use strict'; function f() { function x(){}; class x{}; }'
</span><ins>+SyntaxError: Unexpected identifier 'y'
+SyntaxError: Unexpected identifier 'y'
+PASS Has syntax error: 'let x; with ({}) let y = 3;'
</ins><span class="cx"> ReferenceError: Can't find variable: let
</span><span class="cx"> PASS Does not have syntax error: 'let;'
</span><span class="cx"> SyntaxError: Unexpected token ';'. Expected a parameter pattern or a ')' in parameter list.
</span><span class="lines">@@ -437,6 +441,10 @@
</span><span class="cx"> SyntaxError: Cannot use the keyword 'let' as a catch parameter name.
</span><span class="cx"> SyntaxError: Cannot use the keyword 'let' as a catch parameter name.
</span><span class="cx"> PASS Has syntax error: ''use strict'; try { } catch(let) {}'
</span><ins>+PASS Does not have syntax error: 'let x; if (true) let: x = 3;'
+SyntaxError: Unexpected keyword 'let'
+SyntaxError: Unexpected keyword 'let'
+PASS Has syntax error: ''use strict'; let x; if (true) let: x = 3;'
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216LayoutTestsjsscripttestsletsyntaxjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/js/script-tests/let-syntax.js (214732 => 214733)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/LayoutTests/js/script-tests/let-syntax.js        2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/js/script-tests/let-syntax.js        2017-04-03 06:51:57 UTC (rev 214733)
</span><span class="lines">@@ -31,6 +31,11 @@
</span><span class="cx"> testPassed("Has syntax error: '" + str + "'");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function shouldHaveSyntaxErrorSloppyOnly(str) {
+ assert(hasSyntaxError(str));
+ assert(hasSyntaxError("function dummy() { " + str + " }"));
+ testPassed("Has syntax error: '" + str + "'");
+}
</ins><span class="cx">
</span><span class="cx"> function shouldNotHaveSyntaxError(str) {
</span><span class="cx"> assert(!hasSyntaxError(str));
</span><span class="lines">@@ -53,6 +58,13 @@
</span><span class="cx"> testPassed("Has syntax error: '" + str + "'");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+function shouldNotHaveSyntaxErrorSloppyOnly(str)
+{
+ assert(!hasSyntaxError(str));
+ assert(!hasSyntaxError("(function dummy() { " + str + " })"));
+ testPassed("Does not have syntax error: '" + str + "'");
+}
+
</ins><span class="cx"> shouldNotHaveSyntaxError("let x = 20; if (truth()) { let x = 30; }");
</span><span class="cx"> shouldNotHaveSyntaxError("let {x} = {x:20}; if (truth()) { let {x} = {x : 20}; }");
</span><span class="cx"> shouldNotHaveSyntaxError("let {x} = {x:20}; if (truth()) { let {y: x} = {y : 20}; }");
</span><span class="lines">@@ -86,6 +98,7 @@
</span><span class="cx"> shouldNotHaveSyntaxError("let x = { get foo() { const foo = 20; } };");
</span><span class="cx"> shouldNotHaveSyntaxError("let x = { get foo() { let foo = 20; } };");
</span><span class="cx"> shouldNotHaveSyntaxError("let x = { get foo() { class foo { } } };");
</span><ins>+shouldNotHaveSyntaxErrorSloppyOnly("let x; with ({}) let: y = 3;");
</ins><span class="cx">
</span><span class="cx"> shouldHaveSyntaxError("let let;");
</span><span class="cx"> shouldHaveSyntaxError("const let;");
</span><span class="lines">@@ -140,6 +153,7 @@
</span><span class="cx"> shouldHaveSyntaxError("function f() { class x{}; var [x] = 20; }");
</span><span class="cx"> shouldHaveSyntaxError("function f() { class x{}; function x(){} }");
</span><span class="cx"> shouldHaveSyntaxError("function f() { function x(){}; class x{}; }");
</span><ins>+shouldHaveSyntaxErrorSloppyOnly("let x; with ({}) let y = 3;");
</ins><span class="cx">
</span><span class="cx"> // Stay classy, ES6.
</span><span class="cx"> shouldHaveSyntaxErrorStrictOnly("let;");
</span><span class="lines">@@ -154,3 +168,4 @@
</span><span class="cx"> shouldHaveSyntaxErrorStrictOnly("let: for (v in {}) break;");
</span><span class="cx"> shouldHaveSyntaxErrorStrictOnly("let: for (var v = 0; false; ) {};");
</span><span class="cx"> shouldHaveSyntaxErrorStrictOnly("try { } catch(let) {}");
</span><ins>+shouldHaveSyntaxErrorStrictOnly("let x; if (true) let: x = 3;");
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/ChangeLog (214732 => 214733)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/ChangeLog        2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/ChangeLog        2017-04-03 06:51:57 UTC (rev 214733)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-03-13 Caio Lima <ticaiolima@gmail.com>
+
+ [JSC] It should be possible create a label named let when parsing Statement in non strict mode
+ https://bugs.webkit.org/show_bug.cgi?id=168684
+
+ Reviewed by Saam Barati.
+
+ This patch is fixing a Parser bug to allow define a label named
+ ```let``` in sloppy mode when parsing a Statement.
+
+ * parser/Parser.cpp:
+ (JSC::Parser<LexerType>::parseStatement):
+
</ins><span class="cx"> 2017-03-11 Filip Pizlo <fpizlo@apple.com>
</span><span class="cx">
</span><span class="cx"> Structure::willStoreValueSlow needs to keep the property table alive until the end
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit216SourceJavaScriptCoreparserParsercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/parser/Parser.cpp (214732 => 214733)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/parser/Parser.cpp        2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/Source/JavaScriptCore/parser/Parser.cpp        2017-04-03 06:51:57 UTC (rev 214733)
</span><span class="lines">@@ -1718,6 +1718,11 @@
</span><span class="cx"> case DEFAULT:
</span><span class="cx"> // These tokens imply the end of a set of source elements
</span><span class="cx"> return 0;
</span><ins>+ case LET: {
+ if (!strictMode())
+ goto identcase;
+ goto defaultCase;
+ }
</ins><span class="cx"> case ASYNC:
</span><span class="cx"> if (maybeParseAsyncFunctionDeclarationStatement(context, result, parentAllowsFunctionDeclarationAsStatement))
</span><span class="cx"> break;
</span><span class="lines">@@ -1725,6 +1730,7 @@
</span><span class="cx"> case IDENT:
</span><span class="cx"> case AWAIT:
</span><span class="cx"> case YIELD: {
</span><ins>+ identcase:
</ins><span class="cx"> bool allowFunctionDeclarationAsStatement = false;
</span><span class="cx"> result = parseExpressionOrLabelStatement(context, allowFunctionDeclarationAsStatement);
</span><span class="cx"> shouldSetPauseLocation = !context.shouldSkipPauseLocation(result);
</span><span class="lines">@@ -1737,6 +1743,7 @@
</span><span class="cx"> nonTrivialExpressionCount = m_parserState.nonTrivialExpressionCount;
</span><span class="cx"> FALLTHROUGH;
</span><span class="cx"> default:
</span><ins>+ defaultCase:
</ins><span class="cx"> TreeStatement exprStatement = parseExpressionStatement(context);
</span><span class="cx"> if (directive && nonTrivialExpressionCount != m_parserState.nonTrivialExpressionCount)
</span><span class="cx"> directive = nullptr;
</span></span></pre>
</div>
</div>
</body>
</html>