url: update the processing in the scheme state.
Fix https://github.com/nodejs/node/issues/11785. I've updated the processing in the scheme state to follow the specification and synchronized url-setter-tests
with upstream.
- Related lines in the spec: https://github.com/whatwg/url/blob/a8ed8d2aefeec1e742490d08844c3d91a87e77fb/url.bs#L1493-L1508
While I was testing added tests, I noticed that the current state machine of Node.js doesn't parse URL correctly for pathname
. For example:
var url = new URL('ssh://example.net')
url.pathname
// expected: //example.net
// actual: '/'
So I got rid of the following test for this time.
{
"href": "ssh://example.net",
"new_value": "file",
"expected": {
"href": "ssh://example.net",
"protocol": "ssh:"
}
},
I will work on it later.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests are included -
commit message follows [commit guidelines][]
Affected core subsystem(s)
url, test