mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
586 B
21 lines
586 B
'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]}]`);
|
|
});
|
|
|