After digging into object construction using FunctionTemplate or 
ObjectTemplate in this post:

https://groups.google.com/forum/?fromgroups=#!topic/v8-users/521aXb3Uer4

I believe the ObjectTemplate is missing a HasInstance() method for use in 
testing arguments to JS functions to be of a certain type.

While it is possible to use FunctionTemplate for this purpose (since 
HasInstance() exists), the FunctionTemplate 
method of construction is convoluted and messy since it requires two 
FunctionTemplates or a hack to prevent constructor recursion.

My proposal is to create HasInstance() on the ObjectTemplate class.
I'm looking for guidance on the best way to accomplish this.

*Questions:*
1) How can I get the ObjectTemplate that was used to create an instance of 
an Object?
2) How can I get the constructor for both the ObjectTemplate and the Object 
and compare them?

My assumption is that I should be comparing the constructors for equality.
The internals of v8 use a class called ObjectTemplateInfo which is somewhat 
confusing to me at this point.

Thanks for the help!

-- 
-- 
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