On Jan 7, 2009, at 11:50 AM, Martin Wengenmayer wrote:

var a = new Vector3f(0,1,0);

In JavaScript. the way this works is that Vector3f has to be some object that's in scope. This is normally accomplished by adding it as a property to the global object. That object is called the "constructor". If the object is one that created with the JavaScriptCore API, then the function callAsConstructor will be called on it to implement the new expression. See JSClassDefinition in JSObjectRef.h for details. The callAsConstructor object can then return an object of any type, including some other type of custom object backed by native code.

    -- Darin

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to