[Bug 26322] Definitions "algorithm" and "usages" properties of CryptoKey make no sense

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

--- Comment #17 from Boris Zbarsky <bzbarsky@mit.edu> ---
> I don't understand why we'd Object.freeze if doing a [[usages_exposed]]

That's an API design decision.  The main reason would be to keep scripts on the
page from changing it and then getting confused...

> But it only works if that freezing that object really means it cannot be
> mutated by the script

Freezing guarantees the following invariants:

1)  Properties cannot be added.
2)  Properties cannot be removed.
3)  The values of value properties cannot change.
4)  The getters/setters of accessor properties cannot change.

Given those invariants, as long as you only access properties you know are on
the object (so you don't fall through the proto chain) and you know they're
either value properties or have accessors that you control and hence know have
no side-effects, property accesses on the object are side-effect-free.

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

Received on Thursday, 9 October 2014 00:19:42 UTC