You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like while fixing issue #3072 at commit fb2e0b7 a regression was introduced to instance_eval.
Test case:
class Foo
def bar(x)
instance_eval "def baz; #{x}; end"
end
end
f1 = Foo.new
f2 = Foo.new
f1.bar 1
f2.bar 2
puts "f1.baz = #{f1.baz} (expected 1)"
puts "f2.baz = #{f2.baz} (expected 2)"
CRuby output:
f1.baz = 1 (expected 1)
f2.baz = 2 (expected 2)
mruby output:
f1.baz = 2 (expected 1)
f2.baz = 2 (expected 2)
Using mrb_run instead of mrb_top_run appears to fix the incorrect behavior demonstrated by the test case, though I assume a somewhat more complex solution may be needed to produce the correct behavior for both this issue and #3072.
The text was updated successfully, but these errors were encountered:
It looks like while fixing issue #3072 at commit fb2e0b7 a regression was introduced to instance_eval.
Test case:
CRuby output:
mruby output:
Using mrb_run instead of mrb_top_run appears to fix the incorrect behavior demonstrated by the test case, though I assume a somewhat more complex solution may be needed to produce the correct behavior for both this issue and #3072.
The text was updated successfully, but these errors were encountered: