Skip to content

Commit 28ef3de

Browse files
prohaejinMylesBorins
authored andcommitted
url: added space to class string of iterator objects
PR-URL: #17558 Fixes: #17540 Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 41702ef commit 28ef3de

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/internal/url.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ function createSearchParamsIterator(target, kind) {
11981198
// https://heycam.github.io/webidl/#dfn-iterator-prototype-object
11991199
const URLSearchParamsIteratorPrototype = Object.create(IteratorPrototype);
12001200

1201-
defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParamsIterator', {
1201+
defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', {
12021202
next() {
12031203
if (!this ||
12041204
Object.getPrototypeOf(this) !== URLSearchParamsIteratorPrototype) {

test/parallel/test-whatwg-url-searchparams-inspect.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ const sp = new URLSearchParams('?a=a&b=b&b=c');
1010
assert.strictEqual(util.inspect(sp),
1111
"URLSearchParams { 'a' => 'a', 'b' => 'b', 'b' => 'c' }");
1212
assert.strictEqual(util.inspect(sp.keys()),
13-
"URLSearchParamsIterator { 'a', 'b', 'b' }");
13+
"URLSearchParams Iterator { 'a', 'b', 'b' }");
1414
assert.strictEqual(util.inspect(sp.values()),
15-
"URLSearchParamsIterator { 'a', 'b', 'c' }");
15+
"URLSearchParams Iterator { 'a', 'b', 'c' }");
1616
assert.strictEqual(util.inspect(sp.keys(), { breakLength: 1 }),
17-
"URLSearchParamsIterator {\n 'a',\n 'b',\n 'b' }");
17+
"URLSearchParams Iterator {\n 'a',\n 'b',\n 'b' }");
1818

1919
const iterator = sp.entries();
2020
assert.strictEqual(util.inspect(iterator),
21-
"URLSearchParamsIterator { [ 'a', 'a' ], [ 'b', 'b' ], " +
21+
"URLSearchParams Iterator { [ 'a', 'a' ], [ 'b', 'b' ], " +
2222
"[ 'b', 'c' ] }");
2323
iterator.next();
2424
assert.strictEqual(util.inspect(iterator),
25-
"URLSearchParamsIterator { [ 'b', 'b' ], [ 'b', 'c' ] }");
25+
"URLSearchParams Iterator { [ 'b', 'b' ], [ 'b', 'c' ] }");
2626
iterator.next();
2727
iterator.next();
2828
assert.strictEqual(util.inspect(iterator),
29-
'URLSearchParamsIterator { }');
29+
'URLSearchParams Iterator { }');

test/parallel/test-whatwg-url-tostringtag.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ const spIterator = sp.entries();
1414
const test = [
1515
[url, 'URL'],
1616
[sp, 'URLSearchParams'],
17-
[spIterator, 'URLSearchParamsIterator'],
17+
[spIterator, 'URLSearchParams Iterator'],
1818
// Web IDL spec says we have to return 'URLPrototype', but it is too
1919
// expensive to implement; therefore, use Chrome's behavior for now, until
2020
// spec is changed.
2121
[Object.getPrototypeOf(url), 'URL'],
2222
[Object.getPrototypeOf(sp), 'URLSearchParams'],
23-
[Object.getPrototypeOf(spIterator), 'URLSearchParamsIterator'],
23+
[Object.getPrototypeOf(spIterator), 'URLSearchParams Iterator'],
2424
];
2525

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

0 commit comments

Comments
 (0)