If I recall the ECMA spec correctly, the constructor call (new XYZ()) can
return anything that has typeof() == "object", e.g. the following is
correct:
var F = function() { return function() {} ; }
var G = new F();
var g = new G();
This being said, I believe that the V8 constructor callback does not have
to return "args.This()" - any other Object might be returned.
Sincerely,
Ondrej Zara
2012/6/15 Stephan Beal <[email protected]>
> On Fri, Jun 15, 2012 at 10:20 AM, thewilli <[email protected]>wrote:
>
>> *var Float = new Type("Float");
>> var myFloat = new Float(34.2);*
>>
>> and want to avoid factory methods like
>>
>> *var myFloat = Float.createInstance(34.2)*;
>>
>
>
> You can'd _call_ individual instances (not portably), but you can of
> course do:
>
> var Float = Somefactory.FloatFactory;
> var myFloat = new Float(...);
>
> which is not very far removed from what you demonstrate.
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users