Skip to content

Commit

Permalink
Hardcode "#" in error message
Browse files Browse the repository at this point in the history
It's not going to be anything else...
  • Loading branch information
mAAdhaTTah committed Nov 22, 2018
1 parent 70318c9 commit 4cbd22a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/babel-parser/src/tokenizer/index.js
Expand Up @@ -376,7 +376,7 @@ export default class Tokenizer extends LocationParser {
// All in the name of speed.

// number sign is "#"
readToken_numberSign(code: number): void {
readToken_numberSign(): void {
if (this.state.pos === 0 && this.readToken_interpreter()) {
return;
}
Expand All @@ -400,10 +400,7 @@ export default class Tokenizer extends LocationParser {
) {
this.finishOp(tt.hash, 1);
} else {
this.raise(
this.state.pos,
`Unexpected character '${String.fromCodePoint(code)}'`,
);
this.raise(this.state.pos, "Unexpected character '#'");
}
}

Expand Down Expand Up @@ -655,7 +652,7 @@ export default class Tokenizer extends LocationParser {
getTokenFromCode(code: number): void {
switch (code) {
case charCodes.numberSign:
this.readToken_numberSign(code);
this.readToken_numberSign();
return;

// The interpretation of a dot depends on whether it is followed
Expand Down

0 comments on commit 4cbd22a

Please sign in to comment.