On Wed, Apr 24, 2013 at 12:28 PM, Stephan Beal <sgb...@googlemail.com> wrote: > On Wed, Apr 24, 2013 at 11:00 AM, Ben Noordhuis <i...@bnoordhuis.nl> wrote: >> >> ...The trick I mentioned in my other post is that you add a second >> internal field that points to some atom (usually a char >> class_name_id[] = "MyClassName") that you check for in your prototype >> methods so you can be sure that args.This() is what you expect it to >> be. Be sure to check args.This()->InternalFieldCount() as well. > > > Another option, as opposed to using a string, is take the address of some > internal static value.
That's not another option - that's the same option. :-) class_name_id decays to a pointer when you pass it to SetAlignedPointerInInternalField(). The fact that it's a string is to make debugging easier. -- -- 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.