W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2015

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

From: <bugzilla@jessica.w3.org>
Date: Thu, 04 Jun 2015 15:45:30 +0000
To: public-script-coord@w3.org
Message-ID: <bug-28244-3890-REJ9GSOhhq@http.www.w3.org/Bugs/Public/>
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

This archive was generated by hypermail 2.3.1 : Thursday, 4 June 2015 15:45:33 UTC