Skip to content

Commit

Permalink
Raise FrozenError here too.
Browse files Browse the repository at this point in the history
headius committed Feb 24, 2018

Verified

This commit was signed with the committer’s verified signature.
headius Charles Oliver Nutter
1 parent 6471bc0 commit cea8241
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -909,8 +909,7 @@ private void frozenCheck(boolean runtimeError) {
if (obj != null && obj instanceof RubyArray) {
RubyArray info = (RubyArray) obj;
if (info.getLength() == 2) {
throw getRuntime().newRaiseException(getRuntime().getRuntimeError(),
"can't modify frozen String, created at " + info.eltInternal(0) + ":" + info.eltInternal(1));
throw getRuntime().newFrozenError("can't modify frozen String, created at " + info.eltInternal(0) + ":" + info.eltInternal(1));
}
}
}

0 comments on commit cea8241

Please sign in to comment.