mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 20:08:02 +00:00

PR-URL: https://github.com/nodejs/node/pull/10562 Fixes: https://github.com/nodejs/node/issues/10554 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
22 lines
586 B
JavaScript
22 lines
586 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const URL = require('url').URL;
|
|
const toString = Object.prototype.toString;
|
|
|
|
const url = new URL('http://example.org');
|
|
const sp = url.searchParams;
|
|
|
|
const test = [
|
|
[toString.call(url), 'URL'],
|
|
[toString.call(Object.getPrototypeOf(url)), 'URLPrototype'],
|
|
[toString.call(sp), 'URLSearchParams'],
|
|
[toString.call(Object.getPrototypeOf(sp)), 'URLSearchParamsPrototype']
|
|
];
|
|
|
|
test.forEach((row) => {
|
|
assert.strictEqual(row[0], `[object ${row[1]}]`,
|
|
`${row[0]} !== [object ${row[1]}]`);
|
|
});
|