Skip to content

Commit

Permalink
Fix bug where method name in defined? might be a stub method
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Nov 3, 2013
1 parent 52cdb5e commit 8eb98d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/opal/nodes/defined.rb
Expand Up @@ -32,8 +32,10 @@ def compile_call
mid = mid_to_jsid value[2].to_s
recv = value[1] ? expr(value[1]) : 'self'

push '(', recv, "#{mid} || ", recv
push "['$respond_to_missing?']('#{value[2].to_s}') ? 'method' : nil)"
with_temp do |tmp|
push "(((#{tmp} = ", recv, "#{mid}) && !#{tmp}.rb_stub) || ", recv
push "['$respond_to_missing?']('#{value[2].to_s}') ? 'method' : nil)"
end
end

def compile_ivar
Expand Down

0 comments on commit 8eb98d5

Please sign in to comment.