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..d06e83997a5174e5986683774771d35db32c38f2 100644 |
--- a/test/mjsunit/strict-mode-eval.js |
+++ b/test/mjsunit/strict-mode-eval.js |
@@ -31,6 +31,8 @@ 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/08/19 18:14:56
At this point I'd recommend just leaving out this
lpy
2016/08/19 18:58:17
Done.
|
+var code6 = "function f() { var {eval} = {}; }" |
// Verify the code compiles just fine in non-strict mode |
// (using aliased eval to force non-strict mode) |
@@ -40,6 +42,8 @@ eval_alias(code1); |
eval_alias(code2); |
eval_alias(code3); |
eval_alias(code4); |
+eval_alias(code5); |
+eval_alias(code6); |
function strict1() { |
var exception = false; |
@@ -80,6 +84,30 @@ function strict1() { |
assertInstanceof(e, SyntaxError); |
} |
assertTrue(exception); |
+ |
+ function strict5() { |
+ var exception = false; |
+ try { |
+ eval(code5); |
+ } catch (e) { |
+ exception = true; |
+ assertInstanceof(e, SyntaxError); |
+ } |
+ assertTrue(exception); |
+ |
+ function strict6() { |
+ var exception = false; |
+ try { |
+ eval(code6); |
+ } catch (e) { |
+ exception = true; |
+ assertInstanceof(e, SyntaxError); |
+ } |
+ assertTrue(exception); |
+ } |
+ strict6(); |
+ } |
+ strict5(); |
} |
strict4(); |
} |