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
Hi, I understand your explanation about why the vm.freeze() call doesn't work on Array.pop() here. However, given the documentation of freeze(), I would expect the data to be immutable. Since pop() alters the array, it isn't immutable.
So the freeze() function doesn't turn arrays immutable, which I believe it should.
I would politely suggest to rename 'freeze' to something else, or at least update the documentation so that it tells people that it doesn't actually freeze the data entirely. As it is now, the behaviour is rather surprising. And yes, I did use Object.freeze to fix it.
BTW, thank you for your work on VM2, I really like how simple it is to use this library.
running node v18.15.0
if i have this code:
I expect that this will fail:
However, the array is changed and if I run it multiple times, I get 3, 2 then 1 as a result.
The text was updated successfully, but these errors were encountered: