Skip to content

Commit 98f907d

Browse files
committed
[Truffle] - Implements String#upcase!
1 parent b68cdcf commit 98f907d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

core/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,4 +1177,24 @@ public RubyString upcase(RubyString string) {
11771177

11781178
}
11791179

1180+
@CoreMethod(names = "upcase!")
1181+
public abstract static class UpcaseBangNode extends CoreMethodNode {
1182+
1183+
public UpcaseBangNode(RubyContext context, SourceSection sourceSection) {
1184+
super(context, sourceSection);
1185+
}
1186+
1187+
public UpcaseBangNode(UpcaseBangNode prev) {
1188+
super(prev);
1189+
}
1190+
1191+
@Specialization
1192+
public RubyString upcaseBang(RubyString string) {
1193+
notDesignedForCompilation();
1194+
1195+
string.set(ByteList.create(string.toString().toUpperCase()));
1196+
return string;
1197+
}
1198+
}
1199+
11801200
}

0 commit comments

Comments
 (0)