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] Adding Implementations for Symbol#slice specs. #2645

Merged
merged 4 commits into from Mar 4, 2015

Conversation

bjfish
Copy link
Contributor

@bjfish bjfish commented Mar 4, 2015

String#num_bytes was added as a regular method because adding it as an attr_reader did not appear to work.

@@ -76,4 +76,8 @@ def find_character(offset)
raise PrimitiveFailure, "String#find_character primitive failed"
end

def num_bytes
@num_bytes
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason you couldn't use this with an attribute reader is that we replace reads of @num_bytes in our translator with a method that reads it from the actual string object - see

if (nameWithoutSigil.equals("@num_bytes")) {
return new RubyCallNode(context, sourceSection,
"bytesize",
new SelfNode(context, sourceSection),
null,
false);

chrisseaton added a commit that referenced this pull request Mar 4, 2015
[Truffle] Adding Implementations for Symbol#slice specs.
@chrisseaton chrisseaton merged commit ee8b11a into jruby:master Mar 4, 2015
@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

3 participants