Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 07365f3440d2
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dcee5f0ca778
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 10, 2015

  1. Copy the full SHA
    f8d706f View commit details
  2. Copy the full SHA
    dcee5f0 View commit details
Original file line number Diff line number Diff line change
@@ -1093,6 +1093,8 @@ public RubyString initialize(RubyString self, RubyString from) {
notDesignedForCompilation();

self.set(from.getBytes());
self.setCodeRange(from.getCodeRange());

return self;
}
}
Original file line number Diff line number Diff line change
@@ -19,16 +19,21 @@
public class StringLiteralNode extends RubyNode {

private final ByteList bytes;
private final int codeRange;

public StringLiteralNode(RubyContext context, SourceSection sourceSection, ByteList bytes) {
public StringLiteralNode(RubyContext context, SourceSection sourceSection, ByteList bytes, int codeRange) {
super(context, sourceSection);
assert bytes != null;
this.bytes = bytes;
this.codeRange = codeRange;
}

@Override
public RubyString execute(VirtualFrame frame) {
return new RubyString(getContext().getCoreLibrary().getStringClass(), bytes.dup());
final RubyString string = new RubyString(getContext().getCoreLibrary().getStringClass(), bytes.dup());
string.setCodeRange(codeRange);

return string;
}

}
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@
import org.jruby.truffle.runtime.methods.SharedMethodInfo;
import org.jruby.util.ByteList;
import org.jruby.util.KeyValuePair;
import org.jruby.util.StringSupport;
import org.jruby.util.cli.Options;

import java.math.BigInteger;
@@ -541,7 +542,7 @@ private RubyNode translateRubiniusCheckFrozen(SourceSection sourceSection) {
final RubyNode constructException = new RubyCallNode(context, sourceSection, "new",
new ObjectLiteralNode(context, sourceSection, context.getCoreLibrary().getRuntimeErrorClass()),
null, false,
new StringLiteralNode(context, sourceSection, ByteList.create("FrozenError: can't modify frozen TODO")));
new StringLiteralNode(context, sourceSection, ByteList.create("FrozenError: can't modify frozen TODO"), StringSupport.CR_UNKNOWN));

final RubyNode raise = new RubyCallNode(context, sourceSection, "raise", new SelfNode(context, sourceSection), null, false, true, false, constructException);

@@ -2619,7 +2620,7 @@ public RubyNode visitSplatNode(org.jruby.ast.SplatNode node) {

@Override
public RubyNode visitStrNode(org.jruby.ast.StrNode node) {
return new StringLiteralNode(context, translate(node.getPosition()), node.getValue());
return new StringLiteralNode(context, translate(node.getPosition()), node.getValue(), node.getCodeRange());
}

@Override