class ExecJS::Runtime::Context
def call(source, *args)
context.call("function(a, b) { return a + b }", 1, 1) # => 2
The function will be evaluated with the global object as +this+.
+function+), and calls the function with the given arguments.
Evaluates +source+ as an expression (which should be of type
def call(source, *args) raise NotImplementedError end
def eval(source, options = {})
context.eval("1") # => 1
Evaluates the +source+ as an expression and returns the result.
def eval(source, options = {}) raise NotImplementedError end
def exec(source, options = {})
context.exec("return 1") # => 1
returned value.
Evaluates the +source+ in the context of a function body and returns the
def exec(source, options = {}) raise NotImplementedError end
def initialize(runtime, source = "", options = {})
def initialize(runtime, source = "", options = {}) end