Why are Symbol.* all non-configurable and non-writable?

# Boris Zbarsky (11 years ago)

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.

# Allen Wirfs-Brock (11 years ago)

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.

# André Bargull (11 years ago)

Because somebody thought it was a good idea ;-) ...

I'd say for consistency with other constant value properties (NaN, Infinity, undefined, Math.*, Number.*).

# Boris Zbarsky (11 years ago)

Ah, interesting. I hadn't realized that Math.* and Number.* were also readonly non-configurable.

Alright, that's as good a reason as any. ;)