File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
spec/truffle/tags/core/string
truffle/src/main/java/org/jruby/truffle/nodes/core Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
fails:String#capitalize taints resulting string when self is tainted
2
2
fails:String#capitalize is locale insensitive (only upcases a-z and only downcases A-Z)
3
3
fails:String#capitalize returns subclass instances when called on a subclass
4
- fails:String#capitalize! returns nil when no changes are made
5
- fails:String#capitalize! raises a RuntimeError when self is frozen
4
+ fails:String#capitalize! returns nil when no changes are made
Original file line number Diff line number Diff line change @@ -1926,6 +1926,8 @@ public RubyString capitalizeBang(RubyString string) {
1926
1926
String javaString = string .toString ();
1927
1927
if (javaString .isEmpty ()) {
1928
1928
return string ;
1929
+ } else if (string .isFrozen ()) {
1930
+ throw new RaiseException (getContext ().getCoreLibrary ().runtimeError ("can't modify frozen string" , this ));
1929
1931
} else {
1930
1932
final ByteList byteListString = StringNodesHelper .capitalize (string );
1931
1933
You can’t perform that action at this time.
0 commit comments