You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something that came up when I was working on a spec draft is what the interaction between freezing and structs should be. Normally sealed objects can still be frozen afterwards.
However, perhaps struct instances should not be freezable? I believe JS engines may need to modify flags, etc. in the hidden class on Object.freeze (e.g., https://searchfox.org/mozilla-central/source/js/src/vm/Shape.cpp#776), and struct hidden classes are intended to be fixed.
Additionally, in the shared struct case, there is a possibility of one thread freezing an object concurrent with mutations occurring in another thread. Would this be a problem?
The text was updated successfully, but these errors were encountered:
Supporting Object.freeze could be problematic since it could be racy, but then again shared structs might be represented by an exotic object with a [[Set]] that could handle the race, similar to an SAB-backed TypedArray.
Something that came up when I was working on a spec draft is what the interaction between freezing and structs should be. Normally sealed objects can still be frozen afterwards.
However, perhaps struct instances should not be freezable? I believe JS engines may need to modify flags, etc. in the hidden class on
Object.freeze
(e.g., https://searchfox.org/mozilla-central/source/js/src/vm/Shape.cpp#776), and struct hidden classes are intended to be fixed.Additionally, in the shared struct case, there is a possibility of one thread freezing an object concurrent with mutations occurring in another thread. Would this be a problem?
The text was updated successfully, but these errors were encountered: