Skip to content

Commit

Permalink
[Truffle] - Implements String#upcase!
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasallan committed Dec 22, 2014
1 parent b68cdcf commit 98f907d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
Expand Up @@ -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.