Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent behavior of instance_eval #3191

Closed
k0kubun opened this issue Aug 6, 2016 · 0 comments · Fixed by #3192
Closed

Inconsistent behavior of instance_eval #3191

k0kubun opened this issue Aug 6, 2016 · 0 comments · Fixed by #3192

Comments

@k0kubun
Copy link
Contributor

k0kubun commented Aug 6, 2016

Related to: #3029

With current mruby master(501e1ef) and conf.gem core: 'mruby-eval', I got following behavior.

$ bin/mirb
> class A; def test; [''].each { p self }; end; end
 => :test
> A.new.test
#<A:0xdc55b0>
 => [""]
> A.new.instance_eval("test")
#<A:0xdc38d0>
 => [""]
> A.new.instance_eval("[''].each { p self }")
main
 => [""]

While I got main for the last result of p self, I think it should be #<A:....>. Is it interntional?

k0kubun pushed a commit to k0kubun/mruby that referenced this issue Aug 19, 2016
k0kubun pushed a commit to itamae-kitchen/mitamae that referenced this issue Aug 19, 2016
matz added a commit that referenced this issue Aug 31, 2016
instance_eval env should remake Fix #3191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant