I want to write bindings for C++ objects whose constructors can't be called 
directly. Examples of what I'm talking about in a browser would 
be Element, ImageData, and Canvas. These are defined as functions in the 
global namespace, but if a script tries to call "new Element()", an 
exception is thrown. Instead an appropriate function has to be called, for 
example "document.createElement()".

How are the bindings for these objects are written? If I create a 
FunctionTemplate, I can have it's constructor always throw an "Illegal 
Constructor" exception, but then how will my C++ code instantiate one of 
these objects?

Thanks.

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

Reply via email to