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(node/url): Use Class defined in node/_error.ts to throw exception #1342

Merged
merged 3 commits into from Oct 5, 2021

Conversation

wafuwafu13
Copy link
Contributor

@wafuwafu13 wafuwafu13 commented Oct 4, 2021

Part of #911

  • Use Class defined in node/_error.ts to throw exception
  • Correct Logical OR to Bitwise OR
  • Move Comment

@kt3k
Copy link
Member

kt3k commented Oct 4, 2021

@wafuwafu13 Thank you for your contribution. Can add test cases for this fix?

@wafuwafu13 wafuwafu13 changed the title fix(node/url): Correct Logical OR to Bitwise OR fix(node/url): Use Class defined in node/_error.ts to throw exception Oct 5, 2021
// });
// }
// }
{
Copy link
Contributor Author

@wafuwafu13 wafuwafu13 Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add test cases for this fix?

98cc5ae is related here.

}
return pathname.slice(1);
}
}

function getPathFromURLPosix(url: URL): string {
if (url.hostname !== "") {
throw new Deno.errors.InvalidData("invalid file url hostname");
throw new ERR_INVALID_FILE_URL_HOST(osType);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wafuwafu13 Very nice! LGTM

@kt3k kt3k merged commit 70d4008 into denoland:main Oct 5, 2021
traceypooh pushed a commit to traceypooh/deno_std that referenced this pull request Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants