You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
somecSharpObject is a C# object instance added through the AddHostObject method and its Value property looks more or less like this:
private string internalValue;
public string Value
{
get
{
return internalValue;
}
set
{
if (value != internalValue)
{
internalValue = value;
RaiseParameterEvent(); // this calls Global.OnParameterChanged script callback
}
}
}
}
So as you can see this might lead to some recursions calling the set method which in turn calls the V8 method and so on.
The script engine fires a strange exception after the second time the script method is invoked:
An item with the same key has already been added. Key: Microsoft.ClearScript.BindSignature
at Global.OnParameterChanged (Module:4:27) -> somecSharpObject.Value = Date.now() + ""
I would expect a stack overflow exception in the worst case. I suspect everytime a method is invoked from C# to V8 there are some execution context's that get created adding built in host objects? Tried to build ClearScript from code to have a look but I am stuck in Windows 10 SDK madness.
The error is a little bit confusing. Any ideas on what is going on here? I will try to create a minimal project to reproduce the issue, but wanted to hear first if anybody has an opinion on that :-)
Thank you!
The text was updated successfully, but these errors were encountered:
Hi, I'm running into a funny issue when some recursion from c# to Javascirpt happens.
My v8 script looks like this:
somecSharpObject is a C# object instance added through the AddHostObject method and its Value property looks more or less like this:
So as you can see this might lead to some recursions calling the set method which in turn calls the V8 method and so on.
The script engine fires a strange exception after the second time the script method is invoked:
An item with the same key has already been added. Key: Microsoft.ClearScript.BindSignature
at Global.OnParameterChanged (Module:4:27) -> somecSharpObject.Value = Date.now() + ""
I would expect a stack overflow exception in the worst case. I suspect everytime a method is invoked from C# to V8 there are some execution context's that get created adding built in host objects? Tried to build ClearScript from code to have a look but I am stuck in Windows 10 SDK madness.
The error is a little bit confusing. Any ideas on what is going on here? I will try to create a minimal project to reproduce the issue, but wanted to hear first if anybody has an opinion on that :-)
Thank you!
The text was updated successfully, but these errors were encountered: