Skip to content
Permalink
Browse files
[Truffle] - Implements String#upcase!
  • Loading branch information
lucasallan committed Dec 22, 2014
1 parent b68cdcf commit 98f907d72ba088fe4e8cac503dbd727cb5e94878
Showing with 20 additions and 0 deletions.
  1. +20 −0 core/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
@@ -1177,4 +1177,24 @@ public RubyString upcase(RubyString string) {

}

@CoreMethod(names = "upcase!")
public abstract static class UpcaseBangNode extends CoreMethodNode {

public UpcaseBangNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public UpcaseBangNode(UpcaseBangNode prev) {
super(prev);
}

@Specialization
public RubyString upcaseBang(RubyString string) {
notDesignedForCompilation();

string.set(ByteList.create(string.toString().toUpperCase()));
return string;
}
}

}

0 comments on commit 98f907d

Please sign in to comment.