Closed zoryn closed 8 years ago
Jscallfunction expects global object (https://msdn.microsoft.com/en-us/library/dn249675(v=vs.94).aspx) to be passed as the first argument in this case. I believe it is supposed to be the object which holds the function being called.
Think of it as Function.prototype.call, which requires a thisArg as a first argument.
Thank you for the quick response!
I’m trying to use c# sample. I need to get the function from the script file and execute it with specific arguments. My script is
My code is:
I expect code to return value of type number with value 3. It returns NaN instead.
I’ve spent quite a bit of time trying to understand this and it looks like CallFunction expects some additional argument. If I add any value (e.g. NULL as the first argument), everything works as expected. Is this how it is supposed to work? What is the meaning of this extra argument?
Note addition of JavaScriptValue.Null