Skip to content

Commit

Permalink
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyMatchData;
import org.jruby.truffle.runtime.core.RubyString;
import org.jruby.util.ByteList;

@CoreClass(name = "MatchData")
public abstract class MatchDataNodes {
@@ -191,10 +192,11 @@ public ToSNode(ToSNode prev) {
}

@Specialization
public RubyString toA(RubyMatchData matchData) {
public RubyString toS(RubyMatchData matchData) {
notDesignedForCompilation();

return matchData.getGlobal();
final ByteList bytes = matchData.getGlobal().getBytes().dup();
return getContext().makeString(bytes);
}
}

0 comments on commit 9fa7d9a

Please sign in to comment.