« Bugzilla Issues Index

#1269 — should (new Symbol).toString() work?

tomvc says:

In the introduction, it's mentioned that "Symbol exotic objects are unique in that they are always immutable and never observably reference any other object."

Yet, as currently specified, evaluating aSymbol.toString yields a reference to the global Object.prototype.toString function (which is mutable by default).

Shouldn't aSymbol.toString just be undefined?

I notice that Object.prototype.toString special-cases Symbols anyway, so continues to work fine.

In case aSymbol.toString should continue to return Object.prototype.toString, I would advise to modify [[HasProperty]] for Symbols to answer 'true' for the string "toString", and [[Delete]] to answer 'false', so that [[Get]],[[HasProperty]] and [[Delete]] remain internally consistent.

fixed in rev16 editor's draft

fixed in rev16 draft. July 15, 2013