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

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

Issue 660169: Add test of internal fields on global objects. This test currently... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 10 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 | « no previous file | 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
===================================================================
--- test/cctest/test-api.cc (revision 3959)
+++ test/cctest/test-api.cc (working copy)
@@ -1334,6 +1334,21 @@
}
+THREADED_TEST(GlobalObjectInternalFields) {
+ v8::HandleScope scope;
+ Local<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
+ global_template->SetInternalFieldCount(1);
+ LocalContext env(NULL, global_template);
+ v8::Handle<v8::Object> global_proxy = env->Global();
+ v8::Handle<v8::Object> global =
+ v8::Handle<v8::Object>::Cast(global_proxy->GetPrototype());
+ CHECK_EQ(1, global->InternalFieldCount());
+ CHECK(global->GetInternalField(0)->IsUndefined());
+ global->SetInternalField(0, v8_num(17));
+ CHECK_EQ(17, global->GetInternalField(0)->Int32Value());
+}
+
+
THREADED_TEST(InternalFieldsNativePointers) {
v8::HandleScope scope;
LocalContext env;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698