DukContext.evalString

Evaluate a JS string and get an optional result

class DukContext
T
evalString
(
T = void
)
(
string js
)

Parameters

js
Type: string

the source code

Examples

auto ctx = new DukContext();
ctx.evalString("a = 42;");
assert(ctx.evalString!int("a = 1 + 2") == 3);

Meta