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

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: new parser synch tests 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') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
rossberg 2015/04/13 16:32:26 Nit: indirect_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(){ ind_eval("C = 0") });
assertEquals('function', typeof C);
assertEquals('function', typeof D);
})();
+assertTypeError("'use strong'; (function f() {class E {}; E = 0})()");
rossberg 2015/04/13 16:32:26 Nit: move that inside the test function
+
function constructor(body) {
return "'use strong'; " +
"(class extends Object { constructor() { " + body + " } })";
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/strong/declaration-after-use.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698