1
0
Fork 0
mirror of https://github.com/rubyjs/therubyrhino synced 2023-03-27 23:21:34 -04:00
therubyrhino/lib/rhino/native_function.rb

14 lines
328 B
Ruby
Raw Normal View History

module Rhino
class NativeFunction < NativeObject
def call(*args)
begin
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
end
end
end