Commit 0f907ff0 authored by ager@chromium.org's avatar ager@chromium.org

Add test of internal fields on global objects. This test currently

fails on the partial snapshots branch.
Review URL: http://codereview.chromium.org/660169

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3961 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 57f47e70
......@@ -1334,6 +1334,21 @@ THREADED_TEST(InternalFields) {
}
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment