[Bug 28244] Requiring @@toStringTag on instances may have performance implications

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

Erik Arvidsson <arv@google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |d@domenic.me,
                   |                            |jsbell@google.com

--- Comment #2 from Erik Arvidsson <arv@google.com> ---
I think we should just have a data property on the prototype. The spec
currently says that the Object.prototype.toString.call(Foo.prototype) should
return "[object FooPrototype]". This legacy requirement is not needed for the
web. (I assume this behavior came from Gecko's XPCOM bindings?) and Chrome
never supported this. Chrome has always returned "[object Object]" for the
prototype object.

My suggestion is to follow ES6 and just add a data property for the
@@toStringTag to Foo.prototype with the value "Foo".

https://people.mozilla.org/~jorendorff/es6-draft.html#sec-map.prototype-@@tostringtag

This would mean that we get:

Object.prototype.toString.call(document.body) === '[object HTMLBodyElement]'
Object.prototype.toString.call(HTMLBodyElement.prototype) === '[object
HTMLBodyElement]'

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

Received on Thursday, 4 June 2015 15:45:33 UTC