We are looking at implementing Jint in our .net application and it looks to be a great solution. The issue we are facing is how jint access objects from com where .net has created a com wrapper around the objects. When we look at the objects in jint they are seen as System.__ComObject objects.
This means that we are unable to access any of the properties on these objects.
.net code
Dim dic = New scripting.dictionary
Me.ScriptEngineJINT.SetValue("dic", dic)
Java script code - this does not work as .count and .add can't be seen. the dic reference object type is seen as system.__comObject rather then scripting.dictionary as it would be seen in .net.
function runComTest() {
dic.Add("1", "Example");
var c = dic.Count
if (dic.Exists("1")) {
var val = dic.Item("1")
return val
}
}
I can create a helper function that I can call back into .net and use reflection to make the call - but not a very good solution. Ideally if we could simply access the properties on com objects as we would within .net it would be ideal.
We are using .net framework 4.6.2