Interpreter.evaluate

This is the main entry point for evaluating a script program. If the useVM option was set in the constructor, bytecode compilation and execution will be used, otherwise tree walking.

class Interpreter
ScriptAny
evaluate
(
in string code
,
bool printDisasm = false
)

Parameters

code string

This is the source code of a script to be executed.

printDisasm bool

If VM mode is set, print the disassembly of bytecode before running if true.

Return Value

Type: ScriptAny

If the script has a return statement with an expression, this value will be the result of that expression otherwise it will be ScriptAny.UNDEFINED

Meta