Class: Rhino::NativeFunction
- Inherits:
-
NativeObject
- Object
- NativeObject
- Rhino::NativeFunction
- Defined in:
- lib/rhino/native_function.rb
Overview
Instance Attribute Summary
Attributes inherited from NativeObject
Instance Method Summary collapse
Methods inherited from NativeObject
#[], #[]=, #each, #initialize, #to_h, #to_json
Constructor Details
This class inherits a constructor from Rhino::NativeObject
Instance Method Details
#call(*args) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rhino/native_function.rb', line 13 def call(*args) cxt = J::Context.enter() scope = @j.getParentScope() || cxt.initStandardObjects() @j.call(cxt, scope, scope, args.map {|o| To.javascript(o)}) ensure J::Context.exit() end |
#methodcall(this, *args) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/rhino/native_function.rb', line 21 def methodcall(this, *args) cxt = J::Context.enter() scope = @j.getParentScope() || cxt.initStandardObjects() @j.call(cxt, scope, To.javascript(this), args.map {|o| To.javascript(o)}) ensure J::Context.exit() end |