Hi all,
I have two questions about the usage of internal fields:

1) Does the global object always have 0 internal fields - (vanilla V8,
no third-party extensions)? My code sets the internal fields count to
1 and  uses internal field with index 0 to store a pointer. Is this
'hardcoded' approach correct?
2) I need to associate a pointer with a function object  - the
function is used as a constructor of objects with C++ bindings, and
the pointer value is passed to the constructor of the bound native
object constructor (thus I have a context in which the object is
constructed). Since function objects don't have internal fields, I
first construct an ordinary object, and set its internal field, and
make the object callable as a function via SetCallAsFunctionHandler().
In the callback function, I can access the object where I set the
internal field as args.Holder(), and not as args.Callee(), as I
expected. This makes me think that internally the function is realized
as a method of the object.
Altogether, am I using the correct approach, and is this behavior of
V8 defined, or could it change in the future?

Thanks in advance
Beat regards
Alex

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to