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

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

Issue 1059273004: [strong] Implement static restrictions on direct eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix strong tests using eval 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
Index: test/mjsunit/strong/classes.js
diff --git a/test/mjsunit/strong/classes.js b/test/mjsunit/strong/classes.js
index e33742af3fbd6373f68ac69b073e5b47a15c72d4..26c4fd5256b11b6ff577384fc0f504787ffdaa5a 100644
--- a/test/mjsunit/strong/classes.js
+++ b/test/mjsunit/strong/classes.js
@@ -9,18 +9,21 @@
class C {}
+let ind_eval = eval;
+
function assertTypeError(script) { assertThrows(script, TypeError) }
function assertSyntaxError(script) { assertThrows(script, SyntaxError) }
function assertReferenceError(script) { assertThrows(script, ReferenceError) }
(function ImmutableClassBindings() {
class D {}
- assertTypeError(function(){ eval("C = 0") });
- assertTypeError(function(){ eval("D = 0") });
arv (Not doing code reviews) 2015/04/13 14:14:06 This can be written as: assertTypeError(function(
conradw 2015/04/13 14:36:33 Unfortunately this assignment will be an early err
+ assertTypeError(function(){ ind_eval("C = 0") });
assertEquals('function', typeof C);
assertEquals('function', typeof D);
})();
+assertTypeError("'use strong'; (function f() {class E {}; E = 0})()");
+
function constructor(body) {
return "'use strong'; " +
"(class extends Object { constructor() { " + body + " } })";

Powered by Google App Engine
This is Rietveld 408576698