Why are Symbol.* all non-configurable and non-writable?
Because somebody thought it was a good idea ;-) ...
On Jul 21, 2014, at 1:04 PM, Boris Zbarsky wrote:
Is this meant to prevent people tampering with them?
In that case, global.Symbol should also be non-configurable non-writable or something. Otherwise you can just redefine it.
You're probably right that locking down one doesn't make all that much sense without locking down the other. We have a history of not make global object properties readonly/non-configurable. There also may be configurability issues for dynamically created Realms that we'd want to think about before making Symbol readonly/non-writable.
Probably with some more discussion.
Because somebody thought it was a good idea ;-) ...
I'd say for consistency with other constant value properties (NaN
,
Infinity
, undefined
, Math.*
, Number.*
).
Ah, interesting. I hadn't realized that Math.*
and Number.*
were also
readonly non-configurable.
Alright, that's as good a reason as any. ;)
Is this meant to prevent people tampering with them?
In that case, global.Symbol should also be non-configurable non-writable or something. Otherwise you can just redefine it.