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: 387a68ab6b86
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2fbcf84e95bc
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Dec 9, 2014

  1. Copy the full SHA
    94a5a52 View commit details
  2. [Truffle] Properly interpolate strings referencing objects with priva…

    …te to_s implementations.
    nirvdrum committed Dec 9, 2014
    Copy the full SHA
    2fbcf84 View commit details
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.api.nodes.*;
import org.jruby.truffle.nodes.*;
import org.jruby.truffle.nodes.dispatch.Dispatch;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNode;
import org.jruby.truffle.runtime.*;
import org.jruby.truffle.runtime.core.RubyString;
@@ -30,7 +31,7 @@ public final class InterpolatedStringNode extends RubyNode {
public InterpolatedStringNode(RubyContext context, SourceSection sourceSection, RubyNode[] children) {
super(context, sourceSection);
this.children = children;
toS = new DispatchHeadNode(context);
toS = new DispatchHeadNode(context, true);
}

@ExplodeLoop
Original file line number Diff line number Diff line change
@@ -38,6 +38,10 @@ public DispatchHeadNode(RubyContext context, Dispatch.MissingBehavior missingBeh
this(context, false, false, false, missingBehavior);
}

public DispatchHeadNode(RubyContext context, boolean ignoreVisibility) {
this(context, ignoreVisibility, Dispatch.MissingBehavior.CALL_METHOD_MISSING);
}

public DispatchHeadNode(RubyContext context, boolean ignoreVisibility, Dispatch.MissingBehavior missingBehavior) {
this(context, ignoreVisibility, false, false, missingBehavior);
}
3 changes: 0 additions & 3 deletions spec/truffle/tags/language/string_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
fails:Ruby character strings taints the result of interpolation when an interpolated value is tainted
fails:Ruby character strings untrusts the result of interpolation when an interpolated value is untrusted
fails:Ruby character strings call #to_s when the object is not a String
fails:Ruby character strings call #to_s as a private method
fails:Ruby character strings Unicode escaping can be done with \u{} and one to six hex digits
fails:Ruby character strings Unicode escaping can be done with \u and four hex digits
fails:Ruby character strings Unicode escaping with US-ASCII source encoding produces a UTF-8-encoded string when escaping non-ASCII characters via \u
@@ -10,4 +8,3 @@ fails:Ruby String interpolation creates a String having an Encoding compatible w
fails:Ruby String interpolation creates a String having the Encoding of the components when all are the same Encoding
fails:Ruby String interpolation raises an Encoding::CompatibilityError if the Encodings are not compatible
fails:Ruby character strings uses an internal representation when #to_s doesn't return a String
fails:Ruby character strings calls #to_s as a private method