The receiver is the "this" object you want to use (it is not optional). For
your case the global obj or even the callback itself probably suffice.

----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
On Apr 16, 2013 11:24 PM, "Mike Moening" <[email protected]> wrote:

> I'm trying to do a simple callback into a JS script.
>
> The script does something like this:
>
> function OnProgress(percent) {
>    //Do something
> }
> myObj->setProgressCallback(OnProgress);  //Tell it how to call us back...
>
>
> My native C++ code stores the function passed to setProgressCallback in a
> Persistent<Function> then proceeds to call it later when appropriate.
>
> The call is performed like this:
>
>  Handle<Value> argv[1];
>  argv[0] = v8::Number::New(100);
>  TryCatch try_catch;
>  Handle<Value> result = myStuff->m_fnProgressCallack->Call(???, 1, argv);
>
>
> What is the 1st parameter to the Call() method supposed to take?
> What is the "receiver" object?
>
> Passing in an empty handle breaks it.  If I pass in the function itself I
> get this error:
> "called_non_callable"
>
> What is the secret?
>
> --
> --
> 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.
>
>
>

-- 
-- 
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