Skip to content

Commit

Permalink
[Truffle] - String#downcase! raises a RuntimeError when self is frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasallan committed Mar 4, 2015
1 parent d996099 commit ee6c4a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/string/downcase_tags.txt
@@ -1,4 +1,3 @@
fails:String#downcase is locale insensitive (only replaces A-Z)
fails:String#downcase taints result when self is tainted
fails:String#downcase returns a subclass instance for subclasses
fails:String#downcase! raises a RuntimeError when self is frozen
Expand Up @@ -778,6 +778,8 @@ public RubyBasicObject downcase(RubyString string) {

if (newByteList.equal(string.getBytes())) {
return getContext().getCoreLibrary().getNilObject();
} else if (string.isFrozen()) {
throw new RaiseException(getContext().getCoreLibrary().runtimeError("can't modify frozen string", this));
} else {
string.set(newByteList);
return string;
Expand Down

2 comments on commit ee6c4a9

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you coordinate work on String with @nirvdrum? He's working on it as well and we don't want to conflict or duplicate work by mistake.

@lucasallan
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure. I'll speak with him. Thanks!

Please sign in to comment.