The above should throw a TypeError:
node:
> Object.freeze(new Uint8Array([1,2,3]))
Uncaught TypeError: Cannot freeze array buffer views with elements
at Function.freeze (<anonymous>)
firefox:
Object.freeze(new Uint8Array([1,2,3]))
Uncaught TypeError: can't redefine non-configurable property 0
<anonymous> debugger eval code:1
here is the patch:
https://gist.github.com/drsm/be8f32f9217d10cb87cebfd4a3018acf
implies #375
fixes also #374
Actually, needs more work.
>> var x = Object.freeze([1,,3]); x[1] = 2 // also seal()
2
will do.
~
@drsm Thanks for the patch, committed after some style tidying.