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

Unified Diff: test/mjsunit/strong/undefined.js

Issue 1060883004: [strong] Implement static restrictions on binding 'undefined' in arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: linebreak Created 5 years, 8 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
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/strong/undefined.js
diff --git a/test/mjsunit/strong/undefined.js b/test/mjsunit/strong/undefined.js
index 8fc213d198ff79b7f9e43a93c2cd2287dd2d2014..f324106b30def30574745eb66172ed9af3d33ee1 100644
--- a/test/mjsunit/strong/undefined.js
+++ b/test/mjsunit/strong/undefined.js
@@ -107,11 +107,6 @@ assertThrows("({ foo(a, b, undefined, c, d) {'use strong';} });", SyntaxError);
CheckStrongMode("({ *foo(a, b, undefined, c, d) {} });");
assertThrows("({ *foo(a, b, undefined, c, d) {'use strong';} });", SyntaxError);
-// Arrow function expression with 'undefined' param
-// TODO(conradw): Checking arrow function heads is hard to modify just now
-// CheckStrongMode("(undefined => {})");
-// assertThrows("(undefined => {'use strong';})");
-
// Class declaration named 'undefined'
CheckStrongMode("class undefined {}");
assertThrows("class undefined {'use strong'}", SyntaxError);
@@ -190,3 +185,16 @@ assertDoesNotThrow(function() {
assertThrows(function() {
Function("undefined", "'use strong';");
}, SyntaxError);
+
+// Arrow functions with undefined parameters
+CheckStrongMode("(undefined => {return});");
+assertThrows("(undefined => {'use strong';});");
+
+CheckStrongMode("((undefined, b, c) => {return});");
+assertThrows("((undefined, b, c) => {'use strong';});");
+
+CheckStrongMode("((a, undefined, c) => {return});");
+assertThrows("((a, undefined, c) => {'use strong';});");
+
+CheckStrongMode("((a, b, undefined) => {return});");
+assertThrows("((a, b, undefined) => {'use strong';});");
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698