mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
protect calls to dynamic accessors and interceptors so that if they throw ruby exceptions, it raises them in javascript instead of causing segfaults.
This commit is contained in:
parent
f317b97652
commit
87b1982464
2 changed files with 4 additions and 4 deletions
|
@ -122,7 +122,7 @@ module V8
|
|||
To.v8(method)
|
||||
end
|
||||
elsif obj.respond_to?(:[])
|
||||
To.v8(obj[name])
|
||||
Function.rubycall(obj.method(:[]), name)
|
||||
else
|
||||
C::Empty
|
||||
end
|
||||
|
@ -137,10 +137,10 @@ module V8
|
|||
setter = name + "="
|
||||
methods = accessible_methods(obj)
|
||||
if methods.include?(setter)
|
||||
obj.send(setter, To.rb(value))
|
||||
Function.rubycall(obj.method(setter), To.rb(value))
|
||||
value
|
||||
elsif obj.respond_to?(:[]=)
|
||||
obj.send(:[]=, name, To.rb(value))
|
||||
Function.rubycall(obj.method(:[]=), name, To.rb(value))
|
||||
value
|
||||
else
|
||||
C::Empty
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9ff9293c6d55d9276c3512221c4fdb912808564a
|
||||
Subproject commit d8d64af2cb47e913247691d6a18c0fa9dd94512b
|
Loading…
Add table
Reference in a new issue