Skip to content

Commit

Permalink
url: added space to class string of iterator objects
Browse files Browse the repository at this point in the history
PR-URL: #17558
Fixes: #17540
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
prohaejin authored and MylesBorins committed Jun 14, 2018
1 parent 7f16c8f commit 0502e60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ function createSearchParamsIterator(target, kind) {
// https://heycam.github.io/webidl/#dfn-iterator-prototype-object
const URLSearchParamsIteratorPrototype = Object.create(IteratorPrototype);

defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParamsIterator', {
defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', {
next() {
if (!this ||
Object.getPrototypeOf(this) !== URLSearchParamsIteratorPrototype) {
Expand Down
12 changes: 6 additions & 6 deletions test/parallel/test-whatwg-url-searchparams-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ const sp = new URLSearchParams('?a=a&b=b&b=c');
assert.strictEqual(util.inspect(sp),
"URLSearchParams { 'a' => 'a', 'b' => 'b', 'b' => 'c' }");
assert.strictEqual(util.inspect(sp.keys()),
"URLSearchParamsIterator { 'a', 'b', 'b' }");
"URLSearchParams Iterator { 'a', 'b', 'b' }");
assert.strictEqual(util.inspect(sp.values()),
"URLSearchParamsIterator { 'a', 'b', 'c' }");
"URLSearchParams Iterator { 'a', 'b', 'c' }");
assert.strictEqual(util.inspect(sp.keys(), { breakLength: 1 }),
"URLSearchParamsIterator {\n 'a',\n 'b',\n 'b' }");
"URLSearchParams Iterator {\n 'a',\n 'b',\n 'b' }");

const iterator = sp.entries();
assert.strictEqual(util.inspect(iterator),
"URLSearchParamsIterator { [ 'a', 'a' ], [ 'b', 'b' ], " +
"URLSearchParams Iterator { [ 'a', 'a' ], [ 'b', 'b' ], " +
"[ 'b', 'c' ] }");
iterator.next();
assert.strictEqual(util.inspect(iterator),
"URLSearchParamsIterator { [ 'b', 'b' ], [ 'b', 'c' ] }");
"URLSearchParams Iterator { [ 'b', 'b' ], [ 'b', 'c' ] }");
iterator.next();
iterator.next();
assert.strictEqual(util.inspect(iterator),
'URLSearchParamsIterator { }');
'URLSearchParams Iterator { }');
4 changes: 2 additions & 2 deletions test/parallel/test-whatwg-url-tostringtag.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const spIterator = sp.entries();
const test = [
[url, 'URL'],
[sp, 'URLSearchParams'],
[spIterator, 'URLSearchParamsIterator'],
[spIterator, 'URLSearchParams Iterator'],
// Web IDL spec says we have to return 'URLPrototype', but it is too
// expensive to implement; therefore, use Chrome's behavior for now, until
// spec is changed.
[Object.getPrototypeOf(url), 'URL'],
[Object.getPrototypeOf(sp), 'URLSearchParams'],
[Object.getPrototypeOf(spIterator), 'URLSearchParamsIterator'],
[Object.getPrototypeOf(spIterator), 'URLSearchParams Iterator'],
];

test.forEach(([obj, expected]) => {
Expand Down

0 comments on commit 0502e60

Please sign in to comment.