1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

send messages directly to objects when possible rather than extracting a bound method first.

This commit is contained in:
Charles Lowell 2010-08-03 08:09:23 -05:00
parent c1909ad39c
commit d1cf3cea0f

View file

@ -25,9 +25,9 @@ module V8
end
end
def self.rubycall(rubycode, *args)
def self.rubyprotect
begin
To.v8(rubycode.call(*args))
To.v8(yield)
rescue Exception => e
case e
when SystemExit, NoMemoryError
@ -40,8 +40,16 @@ module V8
end
end
def self.rubycall(rubycode, *args)
rubyprotect do
rubycode.call(*args)
end
end
def self.rubysend(obj, message, *args)
rubycall(obj.method(message), *args)
rubyprotect do
obj.send(message, *args)
end
end
end
end