File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
src/main/java/org/truffleruby/core/kernel Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -91,17 +91,21 @@ def foo(a); end
91
91
end
92
92
93
93
it "raises FrozenError with the correct class name" do
94
- -> { Module . new do
95
- self . freeze
96
- def foo ; end
97
- end } . should raise_error ( FrozenError ) { |e |
94
+ -> {
95
+ Module . new do
96
+ self . freeze
97
+ def foo ; end
98
+ end
99
+ } . should raise_error ( FrozenError ) { |e |
98
100
e . message . should == "can't modify frozen module"
99
101
}
100
102
101
- -> { Class . new do
102
- self . freeze
103
- def foo ; end
104
- end } . should raise_error ( FrozenError ) { |e |
103
+ -> {
104
+ Class . new do
105
+ self . freeze
106
+ def foo ; end
107
+ end
108
+ } . should raise_error ( FrozenError ) { |e |
105
109
e . message . should == "can't modify frozen class"
106
110
}
107
111
end
Original file line number Diff line number Diff line change @@ -857,13 +857,14 @@ protected Object freeze(Object self,
857
857
@ Specialization (limit = "getRubyLibraryCacheLimit()" , guards = "isRubyDynamicObject(self)" )
858
858
protected Object freezeDynamicObject (Object self ,
859
859
@ CachedLibrary ("self" ) RubyLibrary rubyLibrary ,
860
- @ Cached ("createBinaryProfile()" ) ConditionProfile singletonProfile ,
860
+ @ CachedLibrary (limit = "1" ) RubyLibrary rubyLibraryMetaClass ,
861
+ @ Cached ConditionProfile singletonProfile ,
861
862
@ Cached MetaClassNode metaClassNode ) {
862
863
final RubyClass metaClass = metaClassNode .execute (self );
863
864
if (singletonProfile .profile (metaClass .isSingleton &&
864
865
!(RubyGuards .isRubyClass (self ) && ((RubyClass ) self ).isSingleton ))) {
865
- if (!RubyLibrary . getUncached () .isFrozen (metaClass )) {
866
- RubyLibrary . getUncached () .freeze (metaClass );
866
+ if (!rubyLibraryMetaClass .isFrozen (metaClass )) {
867
+ rubyLibraryMetaClass .freeze (metaClass );
867
868
}
868
869
}
869
870
rubyLibrary .freeze (self );
You can’t perform that action at this time.
0 commit comments