File tree Expand file tree Collapse file tree 2 files changed +2
-1
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 +2
-1
lines changed Original file line number Diff line number Diff line change 1
1
fails:String#downcase is locale insensitive (only replaces A-Z)
2
2
fails:String#downcase taints result when self is tainted
3
3
fails:String#downcase returns a subclass instance for subclasses
4
- fails:String#downcase! raises a RuntimeError when self is frozen
Original file line number Diff line number Diff line change @@ -778,6 +778,8 @@ public RubyBasicObject downcase(RubyString string) {
778
778
779
779
if (newByteList .equal (string .getBytes ())) {
780
780
return getContext ().getCoreLibrary ().getNilObject ();
781
+ } else if (string .isFrozen ()) {
782
+ throw new RaiseException (getContext ().getCoreLibrary ().runtimeError ("can't modify frozen string" , this ));
781
783
} else {
782
784
string .set (newByteList );
783
785
return string ;
You can’t perform that action at this time.
0 commit comments