Skip to content

Commit

Permalink
Ensure we provide a number to isASCIIAlpha
Browse files Browse the repository at this point in the history
God, sometimes I wish I had a static type checker at times like this...
  • Loading branch information
Sebmaster committed Apr 30, 2015
1 parent ec4b81e commit ecb445e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ URLStateMachine.prototype["parse" + STATES.RELATIVE_PATH] = function parseScheme
this.url.path.push("");
} else if (this.buffer !== ".") {
if (this.url.scheme === "file" && this.url.path.length === 0 &&
this.buffer.length === 2 && isASCIIAlpha(this.buffer[0]) && this.buffer[1] === "|") {
this.buffer.length === 2 && isASCIIAlpha(this.buffer.codePointAt(0)) && this.buffer[1] === "|") {
this.buffer = this.buffer[0] + ":";
}
this.url.path.push(this.buffer);
Expand Down Expand Up @@ -429,7 +429,7 @@ URLStateMachine.prototype["parse" + STATES.FILE_HOST] = function parseScheme(c,
--this.pointer;
// don't need to count symbols here since we check ASCII values
if (this.buffer.length === 2 &&
isASCIIAlpha(this.buffer[0]) && (this.buffer[1] === ":" || this.buffer[1] === "|")) {
isASCIIAlpha(this.buffer.codePointAt(0)) && (this.buffer[1] === ":" || this.buffer[1] === "|")) {
this.state = STATES.RELATIVE_PATH;
} else if (this.buffer === "") {
this.state = STATES.RELATIVE_PATH_START;
Expand Down

1 comment on commit ecb445e

@domenic
Copy link
Member

Choose a reason for hiding this comment

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

I'm not opposed to this repo being written in TypeScript :). Probably a bit late by now though.

Please sign in to comment.