Skip to content
This repository was archived by the owner on Jun 6, 2019. It is now read-only.

Commit 79d0190

Browse files
threeday0905dfreedm
authored andcommitted
Add URL toString() method to return synonym for href. (according to spec)
Current build: var u = new URL('b', 'http://a'); console.log( u.toString() ); // "[object Object]"" After patch: var u = new URL('b', 'http://a'); console.log( u.toString() ); // "http://a/b" // currently I cannot find URL related test on tests folder, should I write some tests for this patch?
1 parent 97529b5 commit 79d0190

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

url.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@
477477
}
478478

479479
jURL.prototype = {
480+
toString: function() {
481+
return this.href;
482+
},
480483
get href() {
481484
if (this._isInvalid)
482485
return this._url;

0 commit comments

Comments
 (0)