Skip to content

lib,url: correct URL's argument to pass idlharness - #39848

Closed
XadillaX wants to merge 1 commit into
nodejs:masterfrom
XadillaX:url-idlharness
Closed

lib,url: correct URL's argument to pass idlharness#39848
XadillaX wants to merge 1 commit into
nodejs:masterfrom
XadillaX:url-idlharness

Conversation

@XadillaX

@XadillaXXadillaX commented Aug 23, 2021

Copy link
Copy Markdown
Contributor

url.idl defines URL's constructor as:

constructor(USVStringurl,optionalUSVStringbase);

idlharness.any.js checks its length as 1. So we should remove
constructor's second argument and use arguments[1] in constructor's
logic.

Refs: https://url.spec.whatwg.org/#idl-index

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. whatwg-url Issues and PRs related to the WHATWG URL implementation. labels Aug 23, 2021
@targos

Copy link
Copy Markdown
Member

I'd prefer to use a default value: constructor(input, base = undefined) {

Comment threadtest/wpt/test-url.js Outdated
Comment threadlib/internal/url.js Outdated
`url.idl` defines URL's constructor as:
```
constructor(USVString url, optional USVString base);
```
`idlharness.any.js` checks its length as `1`. So we should remove
constructor's second argument and use `arguments[1]` in constructor's
logic.
Refs: https://url.spec.whatwg.org/#idl-index
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

XadillaX added a commit that referenced this pull request Aug 26, 2021
`url.idl` defines URL's constructor as:
```
constructor(USVString url, optional USVString base);
```
`idlharness.any.js` checks its length as `1`. So we should remove
constructor's second argument and use `arguments[1]` in constructor's
logic.
Refs: https://url.spec.whatwg.org/#idl-index
PR-URL: #39848
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@XadillaX

Copy link
Copy Markdown
ContributorAuthor

Landed in 48655e1

@targos

Copy link
Copy Markdown
Member

This depends on the semver-major #39176. Would you like to backport?

targos pushed a commit to targos/node that referenced this pull request Oct 9, 2021
`url.idl` defines URL's constructor as:
```
constructor(USVString url, optional USVString base);
```
`idlharness.any.js` checks its length as `1`. So we should remove
constructor's second argument and use `arguments[1]` in constructor's
logic.
Refs: https://url.spec.whatwg.org/#idl-index
PR-URL: nodejs#39848
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Oct 14, 2021
2 tasks
targos pushed a commit that referenced this pull request Nov 4, 2021
`url.idl` defines URL's constructor as:
```
constructor(USVString url, optional USVString base);
```
`idlharness.any.js` checks its length as `1`. So we should remove
constructor's second argument and use `arguments[1]` in constructor's
logic.
Refs: https://url.spec.whatwg.org/#idl-index
PR-URL: #39848
Backport-PR-URL: #40383
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Nov 26, 2021
1 task
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ciPRs that need a full CI run.whatwg-urlIssues and PRs related to the WHATWG URL implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@XadillaX@targos@nodejs-github-bot@jasnell@bricss@tniessen