I'm using Jint, the 4.5 .NET version, of Sebastien Ros. And javascript prototype objects, and I want to call the javascript prototype constructor with an object.
I run into some problems here. Someting like this:
function Panel(objectBehind)
{
log(objectBehind);
}
Panel.prototype.objectBehind;
1) How do I create a new Panel object, calling the ctor parameters? I got this far:
engine.Execute(script);
engine.Execute("new Panel();");
JsValue val = engine.GetCompletionValue();
But then the ctor argument is empty, of course.
2) Suppose I want to set the objectBehind property on the newed java prototype object, how would that work on the JsValue object?
3) I probably could use a named var, and then call the poperty, but then I need to add named vars:
engine.Execute(script);
engine.Execute("var myPanel = new Panel();");
//do the set prop on mypanel from here.