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

[Truffle] Fixed class variable lookup from singleton classes by attaching their companion class to them. #2667

Merged
merged 3 commits into from Mar 9, 2015

Conversation

nirvdrum
Copy link
Contributor

@nirvdrum nirvdrum commented Mar 9, 2015

@eregon I made the changes we discussed. Any additional feedback would be great.

if (value != null) {
return value;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not check both ancestry chains. MRI lookup is at https://github.com/ruby/ruby/blob/badb4de72a08b199f1a63864531d47beafca818b/variable.c#L2355-L2384.
So, I would add the if attached above the ancestors lookup, and in that if do the lookup on the attached module and set module to the attached module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I thought it occurred afterwards.

@eregon
Copy link
Member

eregon commented Mar 9, 2015

Looks good, please see my two and I think we'll have the perfect commit 😄

nirvdrum added a commit that referenced this pull request Mar 9, 2015
[Truffle] Fixed class variable lookup from singleton classes by attaching their companion class to them.
@nirvdrum nirvdrum merged commit d5cd768 into master Mar 9, 2015
@nirvdrum
Copy link
Contributor Author

nirvdrum commented Mar 9, 2015

Thanks again for the review.

@nirvdrum nirvdrum deleted the class_variables_in_sclass branch March 9, 2015 12:08
@chrisseaton chrisseaton modified the milestone: truffle-dev May 4, 2015
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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.

None yet

4 participants