Hi!
I am using Node.js (which uses v8) and want to provide a
v8::FunctionTemplate ClassA to the Node.js context as a constructor.
If the user executes
*var aInstance = new ClassA(); *
a new object instance (Handle<v8::Object>) is created.
What I now want to do is being able to call
*var bInstance = new aInstance();*
Which should create an instance of another v8::Function called ClassB.
I do know that this is invalid by design as the JS 'new' operator can only
be used on functions and the return type of the newInstance() method from
v8::Function is Local<Object>. Anyway as v8::Function derives from
v8::Object is there any way to realize that?
The background is quite simple: I need to create a kind of wrapper that can
be used as
*var Float = new Type("Float");
var myFloat = new Float(34.2);*
and want to avoid factory methods like
*var myFloat = Float.createInstance(34.2)*;
as it isn't desired by my boss.
Thanks in advance!
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users