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

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: cr feedback 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..50fe5a18ee9ea79fee331afd02d62539733b456f 100644
--- a/test/mjsunit/strong/classes.js
+++ b/test/mjsunit/strong/classes.js
@@ -9,16 +9,18 @@
class C {}
+let indirect_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") });
+ assertTypeError(function(){ indirect_eval("C = 0") });
assertEquals('function', typeof C);
assertEquals('function', typeof D);
+ assertTypeError("'use strong'; (function f() {class E {}; E = 0})()");
})();
function constructor(body) {

Powered by Google App Engine
This is Rietveld 408576698