Skip to content

Commit 8eb98d5

Browse files
committedNov 3, 2013
Fix bug where method name in defined? might be a stub method
1 parent 52cdb5e commit 8eb98d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

Diff for: ‎lib/opal/nodes/defined.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ def compile_call
3232
mid = mid_to_jsid value[2].to_s
3333
recv = value[1] ? expr(value[1]) : 'self'
3434

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

3941
def compile_ivar

0 commit comments

Comments
 (0)
Please sign in to comment.