From bd7c5c9422f1dd3abeaebea7682cdaabe0a04788 Mon Sep 17 00:00:00 2001
From: Brian White <mscdex@mscdex.net>
Date: Sat, 15 Apr 2017 00:42:25 -0400
Subject: [PATCH] url: always show password for URL instances

This matches browser behavior.
---
 lib/internal/url.js                      | 5 +----
 test/parallel/test-whatwg-url-inspect.js | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/internal/url.js b/lib/internal/url.js
index 659a441a6007c4..66a482f98e8c9c 100644
--- a/lib/internal/url.js
+++ b/lib/internal/url.js
@@ -206,8 +206,6 @@ class URL {
       throw new errors.TypeError('ERR_INVALID_THIS', 'URL');
     }
 
-    const ctx = this[context];
-
     if (typeof depth === 'number' && depth < 0)
       return opts.stylize('[Object]', 'special');
 
@@ -221,8 +219,7 @@ class URL {
     obj.origin = this.origin;
     obj.protocol = this.protocol;
     obj.username = this.username;
-    obj.password = (opts.showHidden || ctx.password === '') ?
-                     this.password : '--------';
+    obj.password = this.password;
     obj.host = this.host;
     obj.hostname = this.hostname;
     obj.port = this.port;
diff --git a/test/parallel/test-whatwg-url-inspect.js b/test/parallel/test-whatwg-url-inspect.js
index a8a59b77873f12..8db1a20e5be152 100644
--- a/test/parallel/test-whatwg-url-inspect.js
+++ b/test/parallel/test-whatwg-url-inspect.js
@@ -21,7 +21,7 @@ assert.strictEqual(
   origin: 'https://host.name:8080',
   protocol: 'https:',
   username: 'username',
-  password: '--------',
+  password: 'password',
   host: 'host.name:8080',
   hostname: 'host.name',
   port: '8080',