url: do not public expose inspect methods on URL
PR-URL: https://github.com/nodejs/node/pull/10906 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
parent
f3dc6a37f0
commit
d65904bc6a
@ -77,7 +77,7 @@ class TupleOrigin {
|
||||
return result;
|
||||
}
|
||||
|
||||
inspect() {
|
||||
[util.inspect.custom]() {
|
||||
return `TupleOrigin {
|
||||
scheme: ${this[kScheme]},
|
||||
host: ${this[kHost]},
|
||||
@ -235,7 +235,7 @@ class URL {
|
||||
return (this[context].flags & binding.URL_FLAGS_CANNOT_BE_BASE) !== 0;
|
||||
}
|
||||
|
||||
inspect(depth, opts) {
|
||||
[util.inspect.custom](depth, opts) {
|
||||
const ctx = this[context];
|
||||
var ret = 'URL {\n';
|
||||
ret += ` href: ${this.href}\n`;
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common');
|
||||
const util = require('util');
|
||||
|
||||
if (!common.hasIntl) {
|
||||
// A handful of the tests fail when ICU is not included.
|
||||
@ -144,8 +145,8 @@ for (const test of allTests) {
|
||||
const url = test.url ? new URL(test.url) : new URL(test.input, test.base);
|
||||
|
||||
for (const showHidden of [true, false]) {
|
||||
const res = url.inspect(null, {
|
||||
showHidden: showHidden
|
||||
const res = util.inspect(url, {
|
||||
showHidden
|
||||
});
|
||||
|
||||
const lines = res.split('\n');
|
||||
|
Loading…
x
Reference in New Issue
Block a user