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

Unified Diff: test/cctest/test-global-object.cc

Issue 2523173002: [ic] Don't enable property cell mode for a LoadGlobalIC if the holder is a different global object … (Closed)
Patch Set: Created 4 years, 1 month 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/ic/ic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-global-object.cc
diff --git a/test/cctest/test-global-object.cc b/test/cctest/test-global-object.cc
index d6713208bf433598c8960b82f27c8665e4d969e7..4bcb2b17fcfe6cf70bbeac38e8f7d27618648c66 100644
--- a/test/cctest/test-global-object.cc
+++ b/test/cctest/test-global-object.cc
@@ -105,3 +105,30 @@ TEST(KeysGlobalObject_Regress2764) {
Local<Array>::Cast(CompileRun("Object.getOwnPropertyNames(global2)"));
CHECK_EQ(0u, result->Length());
}
+
+TEST(KeysGlobalObject_SetPrototype) {
+ LocalContext env1;
+ v8::HandleScope scope(env1->GetIsolate());
+
+ // Create second environment.
+ v8::Local<Context> env2 = Context::New(env1->GetIsolate());
+
+ Local<Value> token = v8_str("foo");
+
+ // Set same security token for env1 and env2.
+ env1->SetSecurityToken(token);
+ env2->SetSecurityToken(token);
+
+ // Create a reference to env2 global from env1 global.
+ env1->Global()
+ ->GetPrototype()
+ .As<v8::Object>()
+ ->SetPrototype(env1.local(), env2->Global()->GetPrototype())
+ .FromJust();
+ // Set some global variables in global2
+ env2->Global()->Set(env2, v8_str("a"), v8_str("a")).FromJust();
+ env2->Global()->Set(env2, v8_str("42"), v8_str("42")).FromJust();
+
+ // List all entries from global2.
+ ExpectTrue("a == 'a'");
+}
« no previous file with comments | « src/ic/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698