W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2015

[Bug 29004] FrozenArray only provides shallow immutability

From: <nobody@w3.org>
Date: Fri, 31 Jul 2015 18:12:21 +0000
To: public-script-coord@w3.org
Message-ID: <bug-29004-3890-SaQcuQRsfS@http.www.w3.org/Bugs/Public/>

--- Comment #3 from Boris Zbarsky <bzbarsky@mit.edu> ---
Dictionaries are returned by value, not by reference, so there is no need to
freeze them when returning them normally.

The corresponding situation for an array is a sequence return value, which
likewise never needs to be frozen.

The frozen thing is for when you want to keep returning the same object each
time but don't want the caller to be able to modify it.  We can already do that
with some IDL interface which has only getters and no setters; the problem is
that such things don't play along well with other things people want to do with
their arrays (concat, map, filter, etc).  We _could_ enable IDL interfaces that
do all that more sanely, or we could just use actual Array objects... the
FrozenArray approach is the latter.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Friday, 31 July 2015 18:12:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:24 UTC