Thanks for the response. This is really a awkward limitation. I don't know any language that does not support such
conversion in a standard way. With the suggested work-around, every embedded script engine might have different
way to do conversion (since the name 'host' is implementation dependent.)
Anyway, I found it also strange that ClearScript do support some implicit conversion like the following code works just fine:
conversion in a standard way. With the suggested work-around, every embedded script engine might have different
way to do conversion (since the name 'host' is implementation dependent.)
Anyway, I found it also strange that ClearScript do support some implicit conversion like the following code works just fine:
public short MyValue;
void ClearScriptTest2(object sender, EventArgs e) {
using (var engine = new V8ScriptEngine()) {
engine.AddHostObject("Me", this);
engine.Execute("Me.MyValue = 123;");
MessageBox.Show(MyValue.ToString());
}
}