A destructor is present on this object, but not explicitly documented in the source.
Open a new JS namespace. You can then register symbol inside and call finalize() when its done.
Evaluate a JS string and get an optional result
Get a value on the stack.
Automatic registration of D function. (not global)
Automatic registration of D enum. (not global)
Automatic registration of D class. (not global)
Register a global object in JS context.
Set a previously registered symbol as global.
1 static Point add(Point a, Point b) { 2 return new Point(a.x + b.x, a.y + b.y); 3 } 4 5 enum Directions { up, down } 6 7 auto ctx = new DukContext(); 8 ctx.registerGlobal!add; 9 ctx.registerGlobal!Directions; 10 ctx.registerGlobal!Point; 11 12 13 assert(ctx.evalString!string(q"{ 14 p1 = new Point(20, 40); 15 p2 = new Point(10, 20); 16 p3 = add(p1, p2); 17 18 p3.toString(); 19 }") == "(30, 60)");
Advanced duk context.
It allow to register D symbol directly.