Here is an example:
1) CS file with simple calls and a method that returns a string. 2) a js file that calls the CS method using eval.
//cstest.cs - compile as a library
using System; namespace MyNamespace { public class Foo { public string Bar() { return "Hello JS"; } } }
//test.js - compile as exe // add a link to cstest.dll // compile the jsc / t command line: exe / r: cstest.dll test.js
import MyNamespace; var o : JSApp = new JSApp(); o.DoEval(); class JSApp { function DoEval() { var f : Foo; var s : String eval("f = new Foo;"); eval("s = f.Bar();");
source share