Diff
Modified: releases/WebKitGTK/webkit-2.16/JSTests/ChakraCore/test/LetConst/DeclOutofBlock.baseline-jsc (214732 => 214733)
--- 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)
@@ -1,6 +1,6 @@
-SyntaxError: Unexpected identifier 'b'. Parse error.
+SyntaxError: Unexpected identifier 'b'
SyntaxError: Unexpected keyword 'const'
-SyntaxError: Unexpected identifier 'd'. Parse error.
-SyntaxError: Unexpected identifier 'd'. Parse error.
-SyntaxError: Unexpected identifier 'f'. Parse error.
+SyntaxError: Unexpected identifier 'd'
+SyntaxError: Unexpected identifier 'd'
+SyntaxError: Unexpected identifier 'f'
success
Modified: releases/WebKitGTK/webkit-2.16/JSTests/ChangeLog (214732 => 214733)
--- 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)
@@ -1,3 +1,12 @@
+2017-03-13 Caio Lima <ticaiol...@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:
+
2017-03-10 Mark Lam <mark....@apple.com>
JSC: BindingNode::bindValue doesn't increase the scope's reference count.
Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog (214732 => 214733)
--- 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)
@@ -1,3 +1,14 @@
+2017-03-13 Caio Lima <ticaiol...@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):
+
2017-03-09 Chris Dumez <cdu...@apple.com>
Align Document.elementFromPoint() with the CSSOM specification
Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/js/let-syntax-expected.txt (214732 => 214733)
--- 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)
@@ -69,6 +69,7 @@
PASS Does not have syntax error: ''use strict'; let x = { get foo() { let foo = 20; } };'
PASS Does not have syntax error: 'let x = { get foo() { class foo { } } };'
PASS Does not have syntax error: ''use strict'; let x = { get foo() { class foo { } } };'
+PASS Does not have syntax error: 'let x; with ({}) let: y = 3;'
SyntaxError: Unexpected keyword 'let'. Can't use 'let' as an identifier name for a LexicalDeclaration.
SyntaxError: Unexpected keyword 'let'. Can't use 'let' as an identifier name for a LexicalDeclaration.
PASS Has syntax error: 'let let;'
@@ -189,8 +190,8 @@
SyntaxError: Cannot declare a let variable twice: 'i'.
SyntaxError: Cannot declare a let variable twice: 'i'.
PASS Has syntax error: ''use strict'; for (let i = 20, j = 40, i = 10; i < 10; i++) {}'
-SyntaxError: Unexpected identifier 'x'. Parse error.
-SyntaxError: Unexpected identifier 'x'. Parse error.
+SyntaxError: Unexpected identifier 'x'
+SyntaxError: Unexpected identifier 'x'
PASS Has syntax error: 'let x = 20; if (truth()) let x = 40;'
SyntaxError: Unexpected keyword 'let'
SyntaxError: Unexpected keyword 'let'
@@ -387,6 +388,9 @@
SyntaxError: Cannot declare a class twice: 'x'.
SyntaxError: Cannot declare a class twice: 'x'.
PASS Has syntax error: ''use strict'; function f() { function x(){}; class x{}; }'
+SyntaxError: Unexpected identifier 'y'
+SyntaxError: Unexpected identifier 'y'
+PASS Has syntax error: 'let x; with ({}) let y = 3;'
ReferenceError: Can't find variable: let
PASS Does not have syntax error: 'let;'
SyntaxError: Unexpected token ';'. Expected a parameter pattern or a ')' in parameter list.
@@ -437,6 +441,10 @@
SyntaxError: Cannot use the keyword 'let' as a catch parameter name.
SyntaxError: Cannot use the keyword 'let' as a catch parameter name.
PASS Has syntax error: ''use strict'; try { } catch(let) {}'
+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;'
PASS successfullyParsed is true
TEST COMPLETE
Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/js/script-tests/let-syntax.js (214732 => 214733)
--- 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)
@@ -31,6 +31,11 @@
testPassed("Has syntax error: '" + str + "'");
}
+function shouldHaveSyntaxErrorSloppyOnly(str) {
+ assert(hasSyntaxError(str));
+ assert(hasSyntaxError("function dummy() { " + str + " }"));
+ testPassed("Has syntax error: '" + str + "'");
+}
function shouldNotHaveSyntaxError(str) {
assert(!hasSyntaxError(str));
@@ -53,6 +58,13 @@
testPassed("Has syntax error: '" + str + "'");
}
+function shouldNotHaveSyntaxErrorSloppyOnly(str)
+{
+ assert(!hasSyntaxError(str));
+ assert(!hasSyntaxError("(function dummy() { " + str + " })"));
+ testPassed("Does not have syntax error: '" + str + "'");
+}
+
shouldNotHaveSyntaxError("let x = 20; if (truth()) { let x = 30; }");
shouldNotHaveSyntaxError("let {x} = {x:20}; if (truth()) { let {x} = {x : 20}; }");
shouldNotHaveSyntaxError("let {x} = {x:20}; if (truth()) { let {y: x} = {y : 20}; }");
@@ -86,6 +98,7 @@
shouldNotHaveSyntaxError("let x = { get foo() { const foo = 20; } };");
shouldNotHaveSyntaxError("let x = { get foo() { let foo = 20; } };");
shouldNotHaveSyntaxError("let x = { get foo() { class foo { } } };");
+shouldNotHaveSyntaxErrorSloppyOnly("let x; with ({}) let: y = 3;");
shouldHaveSyntaxError("let let;");
shouldHaveSyntaxError("const let;");
@@ -140,6 +153,7 @@
shouldHaveSyntaxError("function f() { class x{}; var [x] = 20; }");
shouldHaveSyntaxError("function f() { class x{}; function x(){} }");
shouldHaveSyntaxError("function f() { function x(){}; class x{}; }");
+shouldHaveSyntaxErrorSloppyOnly("let x; with ({}) let y = 3;");
// Stay classy, ES6.
shouldHaveSyntaxErrorStrictOnly("let;");
@@ -154,3 +168,4 @@
shouldHaveSyntaxErrorStrictOnly("let: for (v in {}) break;");
shouldHaveSyntaxErrorStrictOnly("let: for (var v = 0; false; ) {};");
shouldHaveSyntaxErrorStrictOnly("try { } catch(let) {}");
+shouldHaveSyntaxErrorStrictOnly("let x; if (true) let: x = 3;");
Modified: releases/WebKitGTK/webkit-2.16/Source/_javascript_Core/ChangeLog (214732 => 214733)
--- releases/WebKitGTK/webkit-2.16/Source/_javascript_Core/ChangeLog 2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/Source/_javascript_Core/ChangeLog 2017-04-03 06:51:57 UTC (rev 214733)
@@ -1,3 +1,16 @@
+2017-03-13 Caio Lima <ticaiol...@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):
+
2017-03-11 Filip Pizlo <fpi...@apple.com>
Structure::willStoreValueSlow needs to keep the property table alive until the end
Modified: releases/WebKitGTK/webkit-2.16/Source/_javascript_Core/parser/Parser.cpp (214732 => 214733)
--- releases/WebKitGTK/webkit-2.16/Source/_javascript_Core/parser/Parser.cpp 2017-04-03 05:41:30 UTC (rev 214732)
+++ releases/WebKitGTK/webkit-2.16/Source/_javascript_Core/parser/Parser.cpp 2017-04-03 06:51:57 UTC (rev 214733)
@@ -1718,6 +1718,11 @@
case DEFAULT:
// These tokens imply the end of a set of source elements
return 0;
+ case LET: {
+ if (!strictMode())
+ goto identcase;
+ goto defaultCase;
+ }
case ASYNC:
if (maybeParseAsyncFunctionDeclarationStatement(context, result, parentAllowsFunctionDeclarationAsStatement))
break;
@@ -1725,6 +1730,7 @@
case IDENT:
case AWAIT:
case YIELD: {
+ identcase:
bool allowFunctionDeclarationAsStatement = false;
result = parseExpressionOrLabelStatement(context, allowFunctionDeclarationAsStatement);
shouldSetPauseLocation = !context.shouldSkipPauseLocation(result);
@@ -1737,6 +1743,7 @@
nonTrivialExpressionCount = m_parserState.nonTrivialExpressionCount;
FALLTHROUGH;
default:
+ defaultCase:
TreeStatement exprStatement = parseExpressionStatement(context);
if (directive && nonTrivialExpressionCount != m_parserState.nonTrivialExpressionCount)
directive = nullptr;