Method: ExecJS::RubyRhinoRuntime::Context#exec

Defined in:
lib/execjs/ruby_rhino_runtime.rb

#exec(source, options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/execjs/ruby_rhino_runtime.rb', line 14

def exec(source, options = {})
  source = encode(source)

  if /\S/ =~ source
    eval "(function(){#{source}})()", options
  end
end