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

Unified Diff: test/cctest/test-api.cc

Issue 1097113003: Fix unobservable constructor replacement on prototype maps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: new approach: use prototype_info 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 | « src/objects-printer.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-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 3f568beb4a8f1404aae54804e886aa04c321ac6f..7fd75a2c78e5c4cfe3de09c88a2c127fb1329389 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -11265,13 +11265,15 @@ THREADED_TEST(ObjectGetConstructorName) {
v8::Isolate* isolate = CcTest::isolate();
LocalContext context;
v8::HandleScope scope(isolate);
- v8_compile("function Parent() {};"
- "function Child() {};"
- "Child.prototype = new Parent();"
- "var outer = { inner: function() { } };"
- "var p = new Parent();"
- "var c = new Child();"
- "var x = new outer.inner();")->Run();
+ v8_compile(
+ "function Parent() {};"
+ "function Child() {};"
+ "Child.prototype = new Parent();"
+ "var outer = { inner: function() { } };"
+ "var p = new Parent();"
+ "var c = new Child();"
+ "var x = new outer.inner();"
+ "var proto = Child.prototype;")->Run();
Local<v8::Value> p = context->Global()->Get(v8_str("p"));
CHECK(p->IsObject() &&
@@ -11285,6 +11287,11 @@ THREADED_TEST(ObjectGetConstructorName) {
CHECK(x->IsObject() &&
x->ToObject(isolate)->GetConstructorName()->Equals(
v8_str("outer.inner")));
+
+ Local<v8::Value> child_prototype = context->Global()->Get(v8_str("proto"));
+ CHECK(child_prototype->IsObject() &&
+ child_prototype->ToObject(isolate)->GetConstructorName()->Equals(
+ v8_str("Parent")));
}
« no previous file with comments | « src/objects-printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698