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

Unified Diff: test/mjsunit/cross-realm-filtering.js

Issue 1381543005: [cross-context] create new function prototypes in the context of the function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removing unused code Created 5 years, 3 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 | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/cross-realm-filtering.js
diff --git a/test/mjsunit/cross-realm-filtering.js b/test/mjsunit/cross-realm-filtering.js
index 9523e8cc1a2d09978bc12864ed70ee873b483c93..47c0d192299ec00159da9a554ce47059efcea7e9 100644
--- a/test/mjsunit/cross-realm-filtering.js
+++ b/test/mjsunit/cross-realm-filtering.js
@@ -70,3 +70,21 @@ assertSame(Realm.shared.caller_1, Realm.shared.result_1);
Realm.eval(realms[0], script);
assertSame(Realm.shared.caller_0, Realm.shared.result_0);
assertSame(null, Realm.shared.result_1);
+
+
+// test that do not pollute / leak a function prototype v8/4217
+var realmIndex = Realm.create();
+var otherObject = Realm.eval(realmIndex, "Object");
+
+var f = Realm.eval(realmIndex, "function f(){}; f");
+f.prototype = null;
+
+var o = new f();
+var proto = Object.getPrototypeOf(o);
+assertFalse(proto === Object.prototype);
+assertTrue(proto === otherObject.prototype);
+
+o = Realm.eval(realmIndex, "new f()");
+proto = Object.getPrototypeOf(o);
+assertFalse(proto === Object.prototype);
+assertTrue(proto === otherObject.prototype);
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698