The InternalFieldCount seems to be ignored when used in through an 
ObjectTemplate passed as a parameter to Context::New.  The following code 
shows the problem:

v8::Local<v8::ObjectTemplate> templte = v8::ObjectTemplate::New();
templte->Set( "Prop", v8::String::New("Value"));
templte->SetInternalFieldCount(1);
 
 
// create object view context, access instance via Context->Global 
v8::Handle<v8::Context> context = 
v8::Context::New(v8::Isolate::GetCurrent(),NULL, templte);
context->Enter();
v8::Context::Scope context_scope(context);
std::cout << "Internal Fields via Global: " << 
v8::Context::GetCurrent()->Global()->InternalFieldCount() << std::endl;
 
 
// create object directly from template 
v8::Local<v8::Object> instt = templte->NewInstance();
std::cout << "Internal Fields via Instance: " << 
instt->InternalFieldCount() << std::endl;
  

The output from the abiove yields:

Internal Fields via Global: 0
Internal Fields via Instance: 1
  

Is this expected behavior or a bug?
 
Thanks

Joe Wood

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to