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

protect indexed access to ruby objects to prevent segfaults in the event that they raise an exception.

This commit is contained in:
Charles Lowell 2010-08-02 16:58:21 -05:00
parent f56a58ab78
commit bcb7da3965
2 changed files with 3 additions and 3 deletions

View file

@ -165,7 +165,7 @@ module V8
def self.call(index, info)
obj = To.rb(info.This())
if obj.respond_to?(:[])
obj[index]
Function.rubycall(obj.method(:[]), index)
else
C::Empty
end
@ -176,7 +176,7 @@ module V8
def self.call(index, value, info)
obj = To.rb(info.This())
if obj.respond_to?(:[]=)
obj[index] = To.rb(value)
Function.rubycall(obj.method(:[]=), index, To.rb(value))
value
else
C::Empty

@ -1 +1 @@
Subproject commit d22bb78c3fef8bc8632f6733edd4b58e6e56d626
Subproject commit 9c6563d8c3838ace05936990b11e0366db6c5564