Class: JS2::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/js2/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Command

Returns a new instance of Command.



3
4
5
6
7
# File 'lib/js2/command.rb', line 3

def initialize(argv)
  @ctx = JS2::Context.new
  @ctx['JS2']['FS'] = JS2::FS.new(@ctx)
  @ctx['argv'] = argv
end

Instance Method Details

#cliObject



9
10
11
# File 'lib/js2/command.rb', line 9

def cli
  @ctx.eval("new JS2.Commander(argv).cli()")
end