Hi I must be missing something.
What is wrong with my code
vb.net
TypeError : Cannot read property 'ToString' of undefined
What is wrong with my code
vb.net
Dim engine As New V8ScriptEngine(V8ScriptEngineFlags.EnableDebugging)
engine.AddHostType("Console", GetType(Console))
engine.AddHostType("MessageBox", GetType(MessageBox))
engine.AddHostObject("myRow", ExcelFileDataSet.Tables(0).Rows(0))
Dim jsScript As String = txttest.Text
Try
engine.Execute(jsScript)
engine.Script.test
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
javascriptfunction test() {
MessageBox.Show('a');
MessageBox.Show(myRow[0].ToString);
}
It first shows me the messagebox with 'a' and afterwards gives me an errorTypeError : Cannot read property 'ToString' of undefined