File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ ObjectDefineProperties(URL.prototype, {
437437 ret += '@' ;
438438 }
439439 ret += options . unicode ?
440- domainToUnicode ( this . hostname ) : this . hostname ;
440+ domainToUnicode ( ctx . host ) : ctx . host ;
441441 if ( ctx . port !== null )
442442 ret += `:${ ctx . port } ` ;
443443 }
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ require ( '../common' ) ;
4+ const assert = require ( 'assert' ) ;
5+
6+ {
7+ const url = new ( class extends URL { get hostname ( ) { return 'bar.com' ; } } ) ( 'http://foo.com/' ) ;
8+ assert . strictEqual ( url . href , 'http://foo.com/' ) ;
9+ assert . strictEqual ( url . toString ( ) , 'http://foo.com/' ) ;
10+ assert . strictEqual ( url . toJSON ( ) , 'http://foo.com/' ) ;
11+ assert . strictEqual ( url . hash , '' ) ;
12+ assert . strictEqual ( url . host , 'foo.com' ) ;
13+ assert . strictEqual ( url . hostname , 'bar.com' ) ;
14+ assert . strictEqual ( url . origin , 'http://foo.com' ) ;
15+ assert . strictEqual ( url . password , '' ) ;
16+ assert . strictEqual ( url . protocol , 'http:' ) ;
17+ assert . strictEqual ( url . username , '' ) ;
18+ assert . strictEqual ( url . search , '' ) ;
19+ assert . strictEqual ( url . searchParams . toString ( ) , '' ) ;
20+ }
You can’t perform that action at this time.
0 commit comments