Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix basing in URL constructor #2867

merged 2 commits into from Sep 6, 2019


Copy link

commented Sep 5, 2019

Fixes #2861.

nayeemrmn added 2 commits Sep 5, 2019

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2019

The expected behaviour shown in the tests might seem a bit random... copy-paste this into your browser console or node to verify them for yourself:

const assertEquals = (a, b) => { if (a != b) throw new Error(`Left: ${a}, Right: ${b}`); };
assertEquals(new URL("", "file:///a/a/a").href, "file:///a/a/a");
assertEquals(new URL(".", "file:///a/a/a").href, "file:///a/a/");
assertEquals(new URL("..", "file:///a/a/a").href, "file:///a/");
assertEquals(new URL("b", "file:///a/a/a").href, "file:///a/a/b");
assertEquals(new URL("b", "file:///a/a/a/").href, "file:///a/a/a/b");
assertEquals(new URL("b/", "file:///a/a/a").href, "file:///a/a/b/");
assertEquals(new URL("../b", "file:///a/a/a").href, "file:///a/b");
ry approved these changes Sep 6, 2019
Copy link

left a comment

LGTM - thanks - nice fix!

@ry ry merged commit ca00039 into denoland:master Sep 6, 2019
3 checks passed
3 checks passed
Travis CI - Pull Request Build Passed
continuous-integration/appveyor/pr AppVeyor build succeeded
license/cla Contributor License Agreement is signed.
@nayeemrmn nayeemrmn deleted the nayeemrmn:url-constructor branch Sep 6, 2019
@nayeemrmn nayeemrmn referenced this pull request Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.