Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: test/mjsunit/invalid-source-element.js

Issue 2694003002: Raise SyntaxError on let [ starting an ExpressionStatement (Closed)
Patch Set: Only cover the ExpressionStatement case Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/messages.h ('K') | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/invalid-source-element.js
diff --git a/test/mjsunit/invalid-source-element.js b/test/mjsunit/invalid-source-element.js
index fb012e2267cfbfdaca6c48ba73757a091bb40c71..92bd455004ab2d829164b81454f741b9be666b47 100644
--- a/test/mjsunit/invalid-source-element.js
+++ b/test/mjsunit/invalid-source-element.js
@@ -29,3 +29,6 @@
// A function expression with no parenthesis around it is not a valid
// expression statement.
assertThrows("eval('function() {}')");
+
+// An expression statements must not start with "let [".
+assertThrows("function() { with ({}) let [a] = [];}", SyntaxError);
Dan Ehrenberg 2017/02/16 09:16:52 Could you add a "messages" test, similar to test/m
vabr (Chromium) 2017/02/16 17:09:33 Thanks for teaching me about the "messages" tests.
« src/messages.h ('K') | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698