Hello everyone,

since this is my first post on this group, let me start by sending
thanks to the V8 developers for releasing this great JavaScript
engine. With that out of the way, let's move to my question:

I have a C++ function that works more or less like this:

Handle<Value> my_function(const Arguments & args) {
    HandleScope handle_scope;
    ..
    Handle<Object> obj = Object::New();
    ..

    return obj;
}

This is accessible from JavaScript as myFunction(), ie:

var obj = myFunction();

I would like to convert this function to work like this:

var User = function() {
    ..
};
var user = myFunction(User); // should return a User 'instance'
instead of a 'plain' Object

How should I change this line:

    Handle<Object> obj = Object::New();

to take args[0] into account?


thanks in advance for your help,

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

Reply via email to