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
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform