Skip to content

Commit

Permalink
url: do not public expose inspect methods on URL
Browse files Browse the repository at this point in the history
PR-URL: #10906
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
TimothyGu committed Jan 31, 2017
1 parent 57e5315 commit 499e75a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit 499e75a

Please sign in to comment.