I am looking for an engine to run stand-alone JavaScript code from my C# (WinForms) application. The idea behind it, is that the user can provide some script to describe behaviour in the application.
Looking around I can find the JSInterop
classes, which seem to do what I want, but I fail to find a good example or even find out if it can do what I want.
So, simple question, could the JSInterop
classes work in scenario like this:
var javascript = "function foo() { return 5; }";
var engine = JSInterop.SomeEngine();
var i = engine.run(javascript);
// i is 5 now