We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e86fcd commit 9fa7d9aCopy full SHA for 9fa7d9a
core/src/main/java/org/jruby/truffle/nodes/core/MatchDataNodes.java
@@ -18,6 +18,7 @@
18
import org.jruby.truffle.runtime.core.RubyArray;
19
import org.jruby.truffle.runtime.core.RubyMatchData;
20
import org.jruby.truffle.runtime.core.RubyString;
21
+import org.jruby.util.ByteList;
22
23
@CoreClass(name = "MatchData")
24
public abstract class MatchDataNodes {
@@ -191,10 +192,11 @@ public ToSNode(ToSNode prev) {
191
192
}
193
194
@Specialization
- public RubyString toA(RubyMatchData matchData) {
195
+ public RubyString toS(RubyMatchData matchData) {
196
notDesignedForCompilation();
197
- return matchData.getGlobal();
198
+ final ByteList bytes = matchData.getGlobal().getBytes().dup();
199
+ return getContext().makeString(bytes);
200
201
202
0 commit comments