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 16:45:09 +0000
To: public-script-coord@w3.org
Message-ID: <bug-28244-3890-ncLj3RIZQL@http.www.w3.org/Bugs/Public/>

--- Comment #4 from Boris Zbarsky <bzbarsky@mit.edu> ---
> Given that Chrome provides evidence that it is not a compatibility issue

Sadly, not quite.  Chrome provides evidence that returning "Object" as the
string tag for HTMLBodyElement.prototype is not a compat issue.  Returning
"HTMLBodyElement" would break code that tries to work around cross-global
instanceof not working in some browsers by checking
Object.prototype.toString.call().  Doubly so because all of the methods/getters
one would want to call on a <body> exist on HTMLBodyElement.prototype but throw
when called.

I'm game to try the simple thing in theory, but in practice I worry about
compat issues.  If we have data showing there is no issue (e.g. an
implementation shipping the proposed behavior for a bit, or some other
indication that people are not using Object.prototype.toString.call() in the
way I worry about), I'd love to see it, now or in the future.

You are receiving this mail because:
You are on the CC list for the bug.
Received on Thursday, 4 June 2015 16:45:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:24 UTC