mirror of
https://github.com/rubyjs/therubyrhino
synced 2023-03-27 23:21:34 -04:00
14 lines
No EOL
258 B
Ruby
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 |