Comparing version 0.1.1 to 0.1.2
@@ -125,2 +125,3 @@ import { Token } from './token'; | ||
export declare function isStrictReservedWord(parser: ParserState, context: Context, t: Token): boolean; | ||
export declare function validateArrowBlockBody(parser: ParserState): any; | ||
//# sourceMappingURL=common.d.ts.map |
@@ -169,3 +169,2 @@ interface _Node<T extends string> { | ||
async: boolean; | ||
generator: false; | ||
} | ||
@@ -172,0 +171,0 @@ export interface AwaitExpression extends _Expression<'AwaitExpression'> { |
@@ -28,3 +28,3 @@ import { Token } from './token'; | ||
export declare function parseLabelledStatement(parser: ParserState, context: Context, expr: ESTree.Identifier, token: Token, allowFuncDecl: 0 | 1): ESTree.LabeledStatement; | ||
export declare function parseAsyncStatement(parser: ParserState, context: Context, allowFuncDecl: LabelledFunctionStatement): ESTree.ExpressionStatement | ESTree.LabeledStatement | ESTree.FunctionDeclaration; | ||
export declare function parseAsyncArrowOrAsyncFunctionDeclaration(parser: ParserState, context: Context, allowFuncDecl: LabelledFunctionStatement): ESTree.ExpressionStatement | ESTree.LabeledStatement | ESTree.FunctionDeclaration; | ||
export declare function parseDirective(parser: ParserState, context: Context): ESTree.Statement | ESTree.ExpressionStatement; | ||
@@ -77,3 +77,3 @@ export declare function parseEmptyStatement(parser: ParserState, context: Context): ESTree.EmptyStatement; | ||
export declare function parseObjectLiteralOrPattern(parser: ParserState, context: Context, skipInitializer: 0 | 1, type: BindingType): ESTree.ObjectExpression | ESTree.ObjectPattern | ESTree.AssignmentExpression; | ||
export declare function parseMethodFormals(parser: ParserState, context: Context, kind: Kind): any[]; | ||
export declare function parseMethodFormals(parser: ParserState, context: Context, kind: Kind, type: BindingType): any[]; | ||
export declare function parseComputedPropertyName(parser: ParserState, context: Context): ESTree.Expression; | ||
@@ -83,4 +83,3 @@ export declare function parseParenthesizedExpression(parser: ParserState, context: Context, assignable: 0 | 1): any; | ||
export declare function parseArrowFunctionExpression(parser: ParserState, context: Context, params: ESTree.Pattern[], isAsync: 0 | 1): ESTree.ArrowFunctionExpression; | ||
export declare function parseFormalParameters(parser: ParserState, context: Context): any[]; | ||
export declare function parseFormalsList(parser: ParserState, context: Context, type: BindingType): ESTree.Expression; | ||
export declare function parseFormalParametersOrFormalList(parser: ParserState, context: Context, type: BindingType): any[]; | ||
export declare function parseNewExpression(parser: ParserState, context: Context): ESTree.NewExpression | ESTree.Expression | ESTree.MetaProperty; | ||
@@ -87,0 +86,0 @@ export declare function parseMetaProperty(parser: ParserState, context: Context, meta: ESTree.Identifier): ESTree.MetaProperty; |
{ | ||
"name": "meriyah", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Fast and lightweight, standard-compliant javascript parser written in ECMAScript", | ||
@@ -93,6 +93,3 @@ "main": "dist/meriyah.umd.js", | ||
} | ||
}, | ||
"dependencies": { | ||
"tslib": "^1.9.3" | ||
} | ||
} |
# meriyah | ||
[![NPM version](https://img.shields.io/npm/v/meriyah.svg?style=flat-square)](https://www.npmjs.com/package/meriyah) | ||
[![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/meriyah/meriyah.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/meriyah/meriyah/context:javascript) | ||
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/meriyah/meriyah.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/meriyah/meriyah/alerts) | ||
[![CircleCI](https://circleci.com/gh/meriyah/meriyah.svg?style=svg)](https://circleci.com/gh/meriyah/meriyah) | ||
[![CircleCI](https://circleci.com/gh/meriyah/meriyah/tree/master.svg?style=svg)](https://circleci.com/gh/meriyah/meriyah/tree/master) | ||
A 100% compliant, self-hosted javascript parser with high focus on both performance and stability. | ||
@@ -6,0 +8,0 @@ |
@@ -282,19 +282,11 @@ import { Token, KeywordDescTable } from './token'; | ||
if (t === Token.AwaitKeyword) { | ||
if (context & (Context.InAwaitContext | Context.Module)) { | ||
report(parser, Errors.AwaitOutsideAsync); | ||
} | ||
if (context & (Context.InAwaitContext | Context.Module)) report(parser, Errors.AwaitOutsideAsync); | ||
parser.flags |= Flags.SeenAwait; | ||
} | ||
if (t === Token.YieldKeyword) { | ||
if (context & (Context.InYieldContext | Context.Strict)) { | ||
report(parser, Errors.DisallowedInContext, 'yield'); | ||
} | ||
} | ||
if (t === Token.GetKeyword) return true; | ||
if (t === Token.SetKeyword) return true; | ||
if (t === Token.YieldKeyword && context & Context.InYieldContext) report(parser, Errors.DisallowedInContext, 'yield'); | ||
return ( | ||
(t & Token.Reserved) === Token.Reserved || | ||
(t & Token.FutureReserved) === Token.FutureReserved || | ||
t == Token.EscapedReserved || | ||
t == Token.EscapedFutureReserved | ||
@@ -304,3 +296,3 @@ ); | ||
export function validateArrowBlockBody(parser: ParserState): any { | ||
export function validateArrowBlockBody(parser: ParserState): void { | ||
switch (parser.token) { | ||
@@ -315,2 +307,3 @@ case Token.Period: | ||
} | ||
if ((parser.token & Token.IsUpdateOp) === Token.IsUpdateOp) report(parser, Errors.InvalidArrowPostfix); | ||
} |
@@ -144,3 +144,4 @@ import { ParserState } from './common'; | ||
AsyncFunctionInSingleStatementContext, | ||
InvalidTernaryYield | ||
InvalidTernaryYield, | ||
InvalidArrowPostfix | ||
} | ||
@@ -292,3 +293,3 @@ | ||
[Errors.ForOfLet]: "The left-hand side of a for-of loop may not start with 'let'", | ||
[Errors.InvalidInvokedBlockBodyArrow]: 'Block body arrows can not be immediately tagged without a group', | ||
[Errors.InvalidInvokedBlockBodyArrow]: 'Block body arrows can not be immediately invoked without a group', | ||
[Errors.InvalidAccessedBlockBodyArrow]: 'Block body arrows can not be immediately accessed without a group', | ||
@@ -301,3 +302,4 @@ [Errors.UnexpectedStrictReserved]: 'Unexpected strict mode reserved word', | ||
[Errors.InvalidPatternTail]: 'Pattern can not have a tail', | ||
[Errors.InvalidTernaryYield]: 'Can not have a `yield` expression on the left side of a ternary' | ||
[Errors.InvalidTernaryYield]: 'Can not have a `yield` expression on the left side of a ternary', | ||
[Errors.InvalidArrowPostfix]: 'An arrow function can not have a postfix update operator' | ||
}; | ||
@@ -304,0 +306,0 @@ |
@@ -35,3 +35,2 @@ import { ParserState, Context } from '../common'; | ||
if (ch < 0) { | ||
ch = -ch; | ||
tail = false; | ||
@@ -47,3 +46,3 @@ } | ||
if (parser.index < parser.length && parser.source.charCodeAt(parser.index) === Chars.LineFeed) { | ||
if (ret != null) ret += fromCodePoint(ch); | ||
if (ret !== null) ret += fromCodePoint(ch); | ||
parser.currentCodePoint = parser.source.charCodeAt(++parser.index); | ||
@@ -57,3 +56,3 @@ } | ||
} | ||
if (ret != null) ret += fromCodePoint(ch); | ||
if (ret !== null) ret += fromCodePoint(ch); | ||
} | ||
@@ -90,14 +89,2 @@ if (parser.index >= parser.length) report(parser, Errors.UnterminatedTemplate); | ||
} | ||
case Chars.Backslash: | ||
ch = nextCodePoint(parser); | ||
break; | ||
case Chars.CarriageReturn: | ||
if (parser.index < parser.length && parser.source.charCodeAt(parser.index) === Chars.LineFeed) { | ||
ch = parser.source.charCodeAt(parser.index); | ||
parser.index++; | ||
} | ||
// falls through | ||
case Chars.LineFeed: | ||
@@ -104,0 +91,0 @@ case Chars.LineSeparator: |
@@ -31,3 +31,2 @@ export const enum Token { | ||
/* Node types */ | ||
@@ -34,0 +33,0 @@ EOF = 0 | IsAutoSemicolon, |
@@ -0,0 +0,0 @@ // Unicode v. 12 support |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2050071
0
39463
113
- Removedtslib@^1.9.3
- Removedtslib@1.14.1(transitive)