Skip to content

Commit

Permalink
fix(all): fixed issue with TS bundle 'const enum'. Values out of orde…
Browse files Browse the repository at this point in the history
…r and tokens got wrong values
  • Loading branch information
KFlash committed Aug 6, 2019
1 parent 972a6f0 commit 4ed317c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
20 changes: 14 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meriyah",
"version": "1.6.0",
"version": "1.6.1",
"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 Expand Up @@ -77,7 +77,7 @@
"path": "^0.12.7",
"prettier": "^1.18.2",
"rimraf": "^2.6.3",
"rollup": "^1.17.0",
"rollup": "^1.19.3",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-typescript2": "^0.22.1",
Expand Down
2 changes: 1 addition & 1 deletion src/meriyah.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export function parse(source: string, options?: Options): ESTree.Program {
}

// Export current version
export const version = '1.6.0';
export const version = '1.6.1';
35 changes: 17 additions & 18 deletions src/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,28 @@ export const enum Token {
Eval = 116 | IsEvalOrArguments,
Arguments = 117 | IsEvalOrArguments,

EscapedReserved = 118 | IsIdentifier,
EscapedReserved = 118 | IsIdentifier,
EscapedFutureReserved = 119 | IsIdentifier,
ReservedIfStrict = 120 | IsIdentifier,

PrivateName = 121,
BigIntLiteral = 122,
// Stage #3 proposals
PrivateName = 121,
BigIntLiteral = 122,
Coalesce = 123 | IsBinaryOp | IsCoalesc | 1 << PrecStart, // ??,
Coalesce = 123 | IsBinaryOp | IsCoalesc | 1 << PrecStart, // ??,
QuestionMarkPeriod = 124 | IsMemberOrCallExpression, // ?.,
// Misc
WhiteSpace = 125,
Illegal = 126,
CarriageReturn = 127,
PrivateField = 128,
Template = 129,
Decorator = 130,
Target = 131 | IsIdentifier,
LineFeed = 132,
EscapedIdentifier = 133,
JSXText = 134,


// Others
WhiteSpace = 125,
Illegal = 126,
CarriageReturn = 127,
PrivateField = 128,
Template = 129,
Decorator = 130,
Target = 131 | IsIdentifier,
LineFeed = 132,
EscapedIdentifier = 133,
JSXText = 134,
}

export const KeywordDescTable = [
Expand Down Expand Up @@ -234,9 +235,7 @@ export const KeywordDescTable = [
/* Others */
'enum', 'eval', 'arguments', 'escaped reserved', 'escaped future reserved', 'reserved if strict', '#',

'BigIntLiteral', '??', '?.', 'WhiteSpace', 'Illegal', 'CarriageReturn', 'PrivateField', 'Template',

'@', 'target', 'LineFeed', 'EscapedIdentifier', 'JSXText'
'BigIntLiteral', '??', '?.', 'WhiteSpace', 'Illegal', 'LineTerminator', 'PrivateField', 'Template', '@', 'target', 'LineFeed', 'Escaped', 'JSXText'
];

// Normal object is much faster than Object.create(null), even with typeof check to avoid Object.prototype interference
Expand Down

0 comments on commit 4ed317c

Please sign in to comment.