On Tue, Apr 23, 2013 at 7:02 PM, Ben Noordhuis <i...@bnoordhuis.nl> wrote:

> Heh, no.  JS code can invoke a native method with a different this
> object (e.g. `obj.nativeMethod.call(null)`).  The
> SetPointerInInternalField() trick checks that args.This() or
> args.Holder() is of the expected type.
>

Don't forget that SetPointerInInternalField() was deprecated sometime late
last year, replaced by SetAlignedPointer...() (which, incidentally, causes
a "pointer is not properly aligned" assertion on my platform for pointers
allocated via 'new T'.) The other way of doing it is to use
SetInternal...() with an External Value wrapping a (void*).
(External::New(myVoidPtr))

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to