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

Unified Diff: test/mjsunit/strict-mode-eval.js

Issue 2185223002: Fix not throwing error when redefine eval or arguments in strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add test Created 4 years, 5 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/parsing/parser-base.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/strict-mode-eval.js
diff --git a/test/mjsunit/strict-mode-eval.js b/test/mjsunit/strict-mode-eval.js
index 391daaa37c6fdb996faa8878492c2eea4ed2abc3..e0722552cecdbe07fb59d5edd0911e136af3f168 100644
--- a/test/mjsunit/strict-mode-eval.js
+++ b/test/mjsunit/strict-mode-eval.js
@@ -31,6 +31,7 @@ var code1 = "function f(eval) {}";
var code2 = "function f(a, a) {}";
var code3 = "var x = '\\020;'";
var code4 = "function arguments() {}";
+var code5 = "(() => { function a({ eval = false } = {}) {} })()";
adamk 2016/07/28 18:33:44 Is the outer arrow function an important part of t
// Verify the code compiles just fine in non-strict mode
// (using aliased eval to force non-strict mode)
@@ -80,6 +81,18 @@ function strict1() {
assertInstanceof(e, SyntaxError);
}
assertTrue(exception);
+
+ function strict5() {
+ var exception = false;
+ try {
+ eval(code5);
+ } catch (e) {
+ exception = true;
+ assertInstanceof(e, SyntaxError);
+ }
+ assertTrue(exception);
+ }
+ strict5();
}
strict4();
}
« src/parsing/parser-base.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