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

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

Issue 1237603003: Add convenience method for converting v8::PersistentBase to v8::Local (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed test compilation Created 5 years, 5 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 | « include/v8.h ('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-handles.cc
diff --git a/test/cctest/test-global-handles.cc b/test/cctest/test-global-handles.cc
index ee295d6991cce0db19cdfebb090aba1aea99ba73..20aaeac73eea5d10a1d7dadc31e179aaebe36a9c 100644
--- a/test/cctest/test-global-handles.cc
+++ b/test/cctest/test-global-handles.cc
@@ -380,3 +380,20 @@ TEST(EternalHandles) {
CHECK_EQ(2*kArrayLength + 1, eternal_handles->NumberOfHandles());
}
+
+
+TEST(PersistentBaseGetLocal) {
+ CcTest::InitializeVM();
+ v8::Isolate* isolate = CcTest::isolate();
+
+ v8::HandleScope scope(isolate);
+ v8::Local<v8::Object> o = v8::Object::New(isolate);
+ CHECK(!o.IsEmpty());
+ v8::Persistent<v8::Object> p(isolate, o);
+ CHECK(o == p.Get(isolate));
+ CHECK(v8::Local<v8::Object>::New(isolate, p) == p.Get(isolate));
+
+ v8::Global<v8::Object> g(isolate, o);
+ CHECK(o == g.Get(isolate));
+ CHECK(v8::Local<v8::Object>::New(isolate, g) == g.Get(isolate));
+}
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698