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

14 lines
No EOL
258 B
Ruby

module Rhino
class RubyFunction < J::BaseFunction
def initialize(callable)
super()
@callable = callable
end
def call(cxt, scope, this, args)
To.javascript @callable.call(*args.map {|a| To.ruby(a)})
end
end
end