Skip to content

Commit

Permalink
fix(lexer): fixed incorrect error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
KFlash committed Aug 25, 2019
1 parent 901bfb0 commit 1934295
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
20 changes: 6 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meriyah",
"version": "1.6.13",
"version": "1.6.14",
"description": "A 100% compliant, self-hosted javascript parser with high focus on both performance and stability",
"main": "dist/meriyah.umd.js",
"module": "dist/meriyah.esm.js",
Expand Down
4 changes: 2 additions & 2 deletions src/lexer/numeric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function scanNumber(parser: ParserState, context: Context, kind: NumberKi
char = advanceChar(parser);
}
if (digits < 1 || !allowSeparator) {
report(parser, digits < 1 ? Errors.MissingHexDigits : Errors.TrailingNumericSeparator);
report(parser, digits < 1 ? Errors.Unexpected : Errors.TrailingNumericSeparator);
}
} else if ((char | 32) === Chars.LowerB) {
kind = NumberKind.Binary | NumberKind.ValidBigIntKind;
Expand All @@ -90,7 +90,7 @@ export function scanNumber(parser: ParserState, context: Context, kind: NumberKi
char = advanceChar(parser);
}
if (digits < 1 || !allowSeparator) {
report(parser, digits < 1 ? Errors.MissingHexDigits : Errors.TrailingNumericSeparator);
report(parser, digits < 1 ? Errors.Unexpected : Errors.TrailingNumericSeparator);
}
} else if (CharTypes[char] & CharFlags.Octal) {
// Octal integer literals are not permitted in strict mode code
Expand Down
4 changes: 2 additions & 2 deletions src/meriyah.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export function parse(source: string, options?: Options): ESTree.Program {

export { Options, ESTree };

// Export current version
export const version = '1.6.13';
// Current version
export const version = '1.6.14';
2 changes: 1 addition & 1 deletion test/parser/miscellaneous/regex.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Context } from '../../../src/common';
import { pass, fail } from '../../test-utils';
import { fail } from '../../test-utils';
import * as t from 'assert';
import { parseSource } from '../../../src/parser';

Expand Down

0 comments on commit 1934295

Please sign in to comment.