Module: Esprima

Defined in:
lib/esprima.rb,
lib/esprima/ast.rb,
lib/esprima/parser.rb,
lib/esprima/version.rb

Defined Under Namespace

Classes: AST, Parser

Constant Summary collapse

VERSION =
"1.4.3"

Class Method Summary collapse

Class Method Details

.load_pathObject



15
16
17
# File 'lib/esprima.rb', line 15

def load_path
  @load_path ||= File.expand_path(File.join(File.dirname(__FILE__), "../vendor"))
end

.new_environmentObject



19
20
21
22
23
# File 'lib/esprima.rb', line 19

def new_environment
  context = new_context
  env = CommonJS::Environment.new(context, :path => Esprima.load_path)
  env.require("esprima")
end