Skip to content

Fixed a bug with local_variables ordering and duplicate variables#2526

Merged
enebo merged 1 commit into
jruby:masterfrom
Who828:local_variables_bug
Jan 27, 2015
Merged

Fixed a bug with local_variables ordering and duplicate variables#2526
enebo merged 1 commit into
jruby:masterfrom
Who828:local_variables_bug

Conversation

@Who828
Copy link
Copy Markdown
Contributor

@Who828 Who828 commented Jan 27, 2015

Fixes #2129 by removing the duplicate variables and matching the order across different scopes to MRI.

enebo added a commit that referenced this pull request Jan 27, 2015
Fixed a bug with local_variables ordering and duplicate variables
@enebo enebo merged commit 7713b6b into jruby:master Jan 27, 2015
@enebo
Copy link
Copy Markdown
Member

enebo commented Jan 27, 2015

@Who828 Do you know if this is also a problem in earlier versions of Ruby?

@headius
Copy link
Copy Markdown
Member

headius commented Jan 27, 2015

I filed the original bug, and I did not test anything but 9k. The bug was filed to capture an new spec failure when we last updated.

In 1.7.18, it does look broken:

$ rvm jruby-1.7.18 do ruby -e "a = 1; b = 2; 1.times {|;b| p local_variables}"
[:a, :b, :b]

@headius
Copy link
Copy Markdown
Member

headius commented Jan 27, 2015

@enebo So I'm not sure what to do here. This is a bug, MRI acknowledged it as a bug, but it was unfixed until 2.2. If we fix this on 1.7 branch, our local_variables behavior would not match 1.9.3.

@Who828 Who828 deleted the local_variables_bug branch January 27, 2015 19:42
@Who828 Who828 restored the local_variables_bug branch January 27, 2015 20:00
@enebo
Copy link
Copy Markdown
Member

enebo commented Jan 27, 2015

Then I think we leave it broken. That tells me no one likely has depended on this not being unique. I bet people who do this and care menually uniq the elements already. They definitely would if they want it to keep working between versions.

@headius headius added this to the JRuby 9.0.0.0.pre2 milestone May 4, 2015
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 this pull request may close these issues.

Block variable shadowing and local_variables not matching up right

3 participants