Closed imsmart-tech closed 7 years ago
This works fine, using jint directly without JavascriptEngineSwitcher:
var p = new Person
{
Name = "Mickey Mouse"
};
var engine = new Engine()
.SetValue("À_la_maison", p)
.Execute("À_la_maison.Name === 'Mickey Mouse'")
;
Hello, Paul!
This error fixed in version 2.4.9.
When you deal with primitive types, then you should use the SetVariableValue
method instead of the EmbedHostObject
method:
int test= 5;
engine.SetVariableValue("À_la_maison", test);
This is using jint, but I suspect it's the same with other engines. For example, this works:
script._engine.Execute("var À_la_maison = 5;");
but this does not work:
it returns error:
Of course, without accent it works well.