Module: Johnson
- Defined in:
- lib/johnson/cli.rb,
lib/johnson.rb,
lib/johnson/error.rb,
lib/johnson/parser.rb,
lib/johnson/runtime.rb,
lib/johnson/version.rb,
lib/johnson/nodes/for.rb,
lib/johnson/visitable.rb,
lib/johnson/nodes/list.rb,
lib/johnson/nodes/node.rb,
lib/johnson/cli/options.rb,
lib/johnson/nodes/for_in.rb,
lib/johnson/nodes/function.rb,
lib/johnson/visitors/visitor.rb,
lib/johnson/nodes/binary_node.rb,
lib/johnson/nodes/ternary_node.rb,
lib/johnson/parser/syntax_error.rb,
lib/johnson/spidermonkey/context.rb,
lib/johnson/spidermonkey/runtime.rb,
lib/johnson/visitors/dot_visitor.rb,
lib/johnson/spidermonkey/debugger.rb,
lib/johnson/visitors/ecma_visitor.rb,
lib/johnson/visitors/sexp_visitor.rb,
lib/johnson/spidermonkey/js_land_proxy.rb,
lib/johnson/spidermonkey/immutable_node.rb,
lib/johnson/spidermonkey/ruby_land_proxy.rb,
lib/johnson/visitors/enumerating_visitor.rb,
lib/johnson/spidermonkey/mutable_tree_visitor.rb,
ext/spidermonkey/spidermonkey.c
Overview
:nodoc:
Defined Under Namespace
Modules: CLI, Nodes, Parser, SpiderMonkey, Visitable, Visitors Classes: Error, Runtime
Constant Summary collapse
- PRELUDE =
IO.read(File.dirname(__FILE__) + "/../js/johnson/prelude.js")
- VERSION =
"1.0.0"
Class Method Summary collapse
- .evaluate(expression, vars = {}) ⇒ Object
-
.load(*files) ⇒ Object
Create a new runtime and load all
files
. - .parse(js, *args) ⇒ Object
Class Method Details
.evaluate(expression, vars = {}) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/johnson.rb', line 37 def self.evaluate(expression, vars={}) runtime = Johnson::Runtime.new vars.each { |key, value| runtime[key] = value } runtime.evaluate(expression) end |