[Bug 29004] FrozenArray only provides shallow immutability

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29004

--- Comment #9 from Jonas Sicking <jonas@sicking.cc> ---
One of the reasons that I want to return frozen Arrays from some APIs is that
that enables us to return the same object from multiple calls.

For example, it means that the HTMLInputElement.files can return the same
object every time that you get it. If the user attaches another file, we simply
create a new Array and return that.

If we don't freeze the Array, that would mean that custom properties set on
myInputElement.files will appear to "disappear" if a file is added.

Ideally we would use something like "value objects" rather than frozen Arrays,
however JS doesn't currently have those so that's not an option.


So I think frozen semantics is what we're actually looking for. Not just "can't
add or remove entries to the Array".

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Friday, 31 July 2015 20:05:25 UTC