Hi.

Is it possible to change a name of a function created by build-in Function 
constructor?

I need to create a function from an argument names list and a function body 
code (exactly what Function constructor does).
I do it like this :

    v8::Local<v8::Function>   constr =
        
v8::Local<v8::Function>::Cast(global->Get(v8::String::New("Function")));
    v8::Local<v8::Value>      argv[2] = { v8::String::New("aa, bb, 
cc"), v8::String::New("return 'ololo';") };
    v8::Local<v8::Function>   func = 
v8::Local<v8::Function>::Cast(constr->NewInstance(2, argv));

Now I can call this function from C++ via func->Call(...).

But when I do toString of this function, I get:

    function anonymous(aa, bb, cc) { return 'ololo'; }

Is there a way to change this "anonymous" name to something else? Or is 
there a better way to get a C++ v8::Function object from an argument names 
list and a function body code?

Thanks.

--
Marat

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to