Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
url: do not public expose inspect methods
  • Loading branch information
TimothyGu committed Jan 27, 2017
commit 0ee8fdb1b3c05fc2b5cd302def2e8a661efe0e21
4 changes: 2 additions & 2 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TupleOrigin {
return result;
}

inspect() {
[util.inspect.custom]() {
return `TupleOrigin {
scheme: ${this[kScheme]},
host: ${this[kHost]},
Expand Down Expand Up @@ -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`;
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-whatwg-url-parsing.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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');
Expand Down