Skip to content

Commit 820fd5b

Browse files
committed
Introduce an additional constructor to RubyRange that allows one to specify the frozen state of the object at creation.
1 parent 5e207e1 commit 820fd5b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/truffleruby/core/range/RubyRange.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@
2020
public abstract class RubyRange extends RubyDynamicObject {
2121

2222
public boolean excludedEnd;
23-
public boolean frozen = false;
23+
public boolean frozen;
2424

2525
public RubyRange(RubyClass rubyClass, Shape shape, boolean excludedEnd) {
2626
super(rubyClass, shape);
2727
this.excludedEnd = excludedEnd;
2828
}
2929

30+
public RubyRange(RubyClass rubyClass, Shape shape, boolean excludedEnd, boolean frozen) {
31+
super(rubyClass, shape);
32+
this.excludedEnd = excludedEnd;
33+
this.frozen = frozen;
34+
}
35+
3036
@ExportMessage
3137
protected void freeze() {
3238
frozen = true;

0 commit comments

Comments
 (0)