Incorrect @@toStringTag for IDL iterator objects and prototypes
Reported by
timothygu99@gmail.com,
Dec 8 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.70 Safari/537.36 Steps to reproduce the problem: const it = new URLSearchParams().keys(); console.log(Object.prototype.toString.call(it)); console.log(Object.prototype.toString.call(Object.getPrototypeOf(it))); console.log(Object.getPrototypeOf(it)[Symbol.toStringTag]); What is the expected behavior? Per requirements for "class strings" in - https://heycam.github.io/webidl/#es-default-iterator-object - https://heycam.github.io/webidl/#es-iterator-prototype-object the following should be printed: [object URLSearchParams Iterator] [object URLSearchParams Iterator] URLSearchParams Iterator What went wrong? The following are printed: [object Iterator] [object Iterator] Iterator Did this work before? No Does this work in other browsers? N/A Chrome version: 64.0.3278.0 Channel: dev OS Version: Flash Version: Even before the recently merged https://github.com/heycam/webidl/pull/483, the following should have been printed: [object URLSearchParamsIterator] [object URLSearchParamsIterator] URLSearchParamsIterator In other words, @@toStringTag have never really been correctly implemented for iterator objects (and their prototypes). https://github.com/heycam/webidl/pull/483 brings the class strings for iterator objects (and their prototypes) in line with ECMAScript builtins, like Map and Set (Object.getPrototypeOf(new Map().keys())[Symbol.toStringTag] === "Map Iterator").
,
Dec 11 2017
By the way, is this being tested in WPT via idlharness.js or something?
,
Dec 15 2017
@raphael I don't believe it is included in WPT, because its behavior hadn't been fully sorted out. It looks like it's going to be an easy fix though.
,
Dec 25 2017
New WPTs are in https://github.com/w3c/web-platform-tests/pull/8796.
,
Aug 17
,
Aug 23
,
Nov 30
|
||||
►
Sign in to add a comment |
||||
Comment 1 by raphael....@intel.com
, Dec 11 2017Status: Available (was: Unconfirmed)