On 06/03/2016 06:41 PM, Boris Zbarsky wrote:
Summary: The current IDL spec says that Object.prototype.toString() on a DOM prototype 
object for interface Foo is "[object FooPrototype]", whereas
for instances of the interface it's "[object Foo]", and that's what we 
implement.  However, as we try to move to the ES6 @@toStringTag world, this
causes some problems, which are described in 
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=28244>.  So there is a proposal 
to change the spec to
have the string be "[object Foo]" for the prototype as well.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1277880

Spec: Would get adjusted as needed.

Target release: 49

Preference: None

Devtools bug: none so far, but maybe we need one?  Does devtools rely on the 
JSClass name or Object.prototype.toString anywhere?

Behavior of other browsers:

* Chrome: has been shipping the behavior I'm proposing to change to since 
Chrome 50, I believe.  Current Chrome release version is 51.

* Safari (and WebKit nightly): has the behavior we currently have.

* Edge: has the behavior we currently have.

Possible alternatives: We could make @@toStringTag an accessor on the prototype 
that returns different things for instances and the prototype itself.

-Boris


Why is the change being done?  Why do we think @@toStringTag stuff is a good 
thing?
IMHO, the current Gecko behavior for toString makes more sense than the 
proposed one.
Foo object after all is quite different beast than its prototype so I'd expect 
toString() to reflect that.

Not really objecting anything here, but just wondering why this kind of change 
is being done.
W3C bug doesn't quite capture the reasoning here.


-Olli
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to