meriyah 7.2.0 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +1 -3
- package/dist/meriyah.cjs +634 -430
- package/dist/meriyah.min.mjs +1 -1
- package/dist/meriyah.mjs +634 -430
- package/dist/meriyah.umd.js +634 -430
- package/dist/meriyah.umd.min.js +1 -1
- package/dist/types/errors.d.ts +74 -70
- package/dist/types/estree.d.ts +2 -0
- package/dist/types/features.d.ts +7 -0
- package/dist/types/options.d.ts +6 -2
- package/dist/types/parser/parser.d.ts +8 -3
- package/dist/types/parser/scope.d.ts +1 -1
- package/dist/types/parser.d.ts +2 -2
- package/dist/types/token.d.ts +3 -3
- package/package.json +1 -1
- package/dist/types/utilities.d.ts +0 -1
package/dist/types/errors.d.ts
CHANGED
|
@@ -109,76 +109,80 @@ export declare const enum Errors {
|
|
|
109
109
|
InvalidExportImportSource = 105,
|
|
110
110
|
InvalidKeywordAsAlias = 106,
|
|
111
111
|
InvalidDefaultImport = 107,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
112
|
+
InvalidDeferImport = 108,
|
|
113
|
+
InvalidSourceImport = 109,
|
|
114
|
+
TrailingDecorators = 110,
|
|
115
|
+
GeneratorConstructor = 111,
|
|
116
|
+
AwaitIdentInModuleOrAsyncFunc = 112,
|
|
117
|
+
YieldIdentInModule = 113,
|
|
118
|
+
HtmlCommentInWebCompat = 114,
|
|
119
|
+
StrictInvalidLetInExprPos = 115,
|
|
120
|
+
NotAssignableLetArgs = 116,
|
|
121
|
+
ForOfLet = 117,
|
|
122
|
+
InvalidInvokedBlockBodyArrow = 118,
|
|
123
|
+
InvalidAccessedBlockBodyArrow = 119,
|
|
124
|
+
UnexpectedStrictReserved = 120,
|
|
125
|
+
StrictEvalArguments = 121,
|
|
126
|
+
InvalidDecoratorSemicolon = 122,
|
|
127
|
+
StrictDelete = 123,
|
|
128
|
+
InvalidPatternTail = 124,
|
|
129
|
+
AsyncFunctionInSingleStatementContext = 125,
|
|
130
|
+
InvalidTernaryYield = 126,
|
|
131
|
+
InvalidArrowPostfix = 127,
|
|
132
|
+
InvalidObjLitKeyStar = 128,
|
|
133
|
+
DeletePrivateField = 129,
|
|
134
|
+
InvalidStaticClassFieldConstructor = 130,
|
|
135
|
+
InvalidClassFieldConstructor = 131,
|
|
136
|
+
InvalidClassFieldArgEval = 132,
|
|
137
|
+
InvalidGeneratorFunction = 133,
|
|
138
|
+
AsyncRestrictedProd = 134,
|
|
139
|
+
UnexpectedCharAfterObjLit = 135,
|
|
140
|
+
InvalidObjLitKey = 136,
|
|
141
|
+
InvalidKeyToken = 137,
|
|
142
|
+
LabelRedeclaration = 138,
|
|
143
|
+
InvalidNestedStatement = 139,
|
|
144
|
+
UnknownLabel = 140,
|
|
145
|
+
InvalidImportTail = 141,
|
|
146
|
+
InvalidJSONImportBinding = 142,
|
|
147
|
+
ImportNotOneArg = 143,
|
|
148
|
+
InvalidImportNew = 144,
|
|
149
|
+
InvalidSpreadInImport = 145,
|
|
150
|
+
IncompleteArrow = 146,
|
|
151
|
+
DuplicateBinding = 147,
|
|
152
|
+
DuplicatePrivateIdentifier = 148,
|
|
153
|
+
DuplicateExportBinding = 149,
|
|
154
|
+
UndeclaredExportedBinding = 150,
|
|
155
|
+
UnexpectedPrivateField = 151,
|
|
156
|
+
DuplicateLetConstBinding = 152,
|
|
157
|
+
CantAssignToValidRHS = 153,
|
|
158
|
+
ContinuousNumericSeparator = 154,
|
|
159
|
+
TrailingNumericSeparator = 155,
|
|
160
|
+
InvalidJSXAttributeValue = 156,
|
|
161
|
+
ExpectedJSXClosingTag = 157,
|
|
162
|
+
AdjacentJSXElements = 158,
|
|
163
|
+
InvalidNonEmptyJSXExpr = 159,
|
|
164
|
+
DuplicateIdentifier = 160,
|
|
165
|
+
ShadowedCatchClause = 161,
|
|
166
|
+
InvalidDotProperty = 162,
|
|
167
|
+
UnclosedSpreadElement = 163,
|
|
168
|
+
CatchWithoutTry = 164,
|
|
169
|
+
FinallyWithoutTry = 165,
|
|
170
|
+
UnCorrespondingFragmentTag = 166,
|
|
171
|
+
InvalidCoalescing = 167,
|
|
172
|
+
OptionalChainingNoTemplate = 168,
|
|
173
|
+
OptionalChainingNoSuper = 169,
|
|
174
|
+
OptionalChainingNoNew = 170,
|
|
175
|
+
ImportMetaOutsideModule = 171,
|
|
176
|
+
InvalidLeadingDecorator = 172,
|
|
177
|
+
InvalidExportName = 173,
|
|
178
|
+
InvalidExportReference = 174,
|
|
179
|
+
InvalidSuperPrivate = 175,
|
|
180
|
+
InvalidImportMeta = 176,
|
|
181
|
+
InvalidEscapedImportMeta = 177,
|
|
182
|
+
InvalidAwaitAsIdentifier = 178,
|
|
183
|
+
InvalidAwaitInStaticBlock = 179,
|
|
184
|
+
UnexpectedRightBraceInJSXText = 180,
|
|
185
|
+
UnexpectedGreaterThanInJSXText = 181
|
|
182
186
|
}
|
|
183
187
|
export declare class ParseError extends SyntaxError implements _Node {
|
|
184
188
|
start: number;
|
package/dist/types/estree.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export interface ImportExpression extends _Node {
|
|
|
106
106
|
type: 'ImportExpression';
|
|
107
107
|
source: Expression;
|
|
108
108
|
options?: Expression | null;
|
|
109
|
+
phase?: 'defer' | 'source' | null;
|
|
109
110
|
}
|
|
110
111
|
export interface ChainExpression extends _Node {
|
|
111
112
|
type: 'ChainExpression';
|
|
@@ -248,6 +249,7 @@ export interface ImportDeclaration extends _Node {
|
|
|
248
249
|
source: StringLiteral;
|
|
249
250
|
specifiers: ImportClause[];
|
|
250
251
|
attributes: ImportAttribute[];
|
|
252
|
+
phase?: 'defer' | 'source' | null;
|
|
251
253
|
}
|
|
252
254
|
export interface ImportAttribute extends _Node {
|
|
253
255
|
type: 'ImportAttribute';
|
package/dist/types/options.d.ts
CHANGED
|
@@ -32,11 +32,15 @@ interface NormalizedRanges {
|
|
|
32
32
|
end: boolean;
|
|
33
33
|
range: boolean;
|
|
34
34
|
}
|
|
35
|
-
export type
|
|
35
|
+
export type InternalOptions = Options & {
|
|
36
|
+
features?: number;
|
|
37
|
+
};
|
|
38
|
+
export type NormalizedOptions = Omit<Options, 'validateRegex' | 'onComment' | 'onToken' | 'ranges' | 'next' | 'module' | 'globalReturn'> & {
|
|
36
39
|
validateRegex: boolean;
|
|
37
40
|
ranges?: NormalizedRanges;
|
|
38
41
|
onComment?: OnComment;
|
|
39
42
|
onToken?: OnToken;
|
|
43
|
+
features: number;
|
|
40
44
|
};
|
|
41
|
-
export declare function normalizeOptions(rawOptions:
|
|
45
|
+
export declare function normalizeOptions(rawOptions: InternalOptions): NormalizedOptions;
|
|
42
46
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AssignmentTargetKind, DestructuringKind, Flags, type Location } from '../common.ts';
|
|
2
2
|
import { Errors } from '../errors.ts';
|
|
3
3
|
import type * as ESTree from '../estree.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { Features } from '../features.ts';
|
|
5
|
+
import { type InternalOptions, type NormalizedOptions } from '../options.ts';
|
|
5
6
|
import { Token } from '../token.ts';
|
|
6
7
|
import { PrivateScope } from './private-scope.ts';
|
|
7
8
|
import { Scope, type ScopeKind } from './scope.ts';
|
|
@@ -11,6 +12,7 @@ export declare class Parser {
|
|
|
11
12
|
options: NormalizedOptions;
|
|
12
13
|
token: Token;
|
|
13
14
|
flags: Flags;
|
|
15
|
+
features: Features;
|
|
14
16
|
index: number;
|
|
15
17
|
line: number;
|
|
16
18
|
column: number;
|
|
@@ -33,11 +35,15 @@ export declare class Parser {
|
|
|
33
35
|
assignable: AssignmentTargetKind;
|
|
34
36
|
destructible: DestructuringKind;
|
|
35
37
|
strictReservedRange: [Location, Location] | null;
|
|
38
|
+
firstAwaitLocation: {
|
|
39
|
+
start: Location;
|
|
40
|
+
end: Location;
|
|
41
|
+
} | null;
|
|
36
42
|
leadingDecorators: {
|
|
37
43
|
start?: Location;
|
|
38
44
|
decorators: ESTree.Decorator[];
|
|
39
45
|
};
|
|
40
|
-
constructor(source: string, rawOptions?:
|
|
46
|
+
constructor(source: string, rawOptions?: InternalOptions);
|
|
41
47
|
getToken(): Token;
|
|
42
48
|
setToken(value: Token, replaceLast?: boolean): Token;
|
|
43
49
|
get tokenStart(): Location;
|
|
@@ -51,5 +57,4 @@ export declare class Parser {
|
|
|
51
57
|
createPrivateScopeIfLexical(parent?: PrivateScope): PrivateScope | undefined;
|
|
52
58
|
cloneIdentifier(original: ESTree.Identifier): ESTree.Identifier;
|
|
53
59
|
cloneStringLiteral(original: ESTree.StringLiteral): ESTree.StringLiteral;
|
|
54
|
-
private cloneLocationInformation;
|
|
55
60
|
}
|
|
@@ -30,7 +30,7 @@ export declare class Scope {
|
|
|
30
30
|
addVarOrBlock(context: Context, name: string, kind: BindingKind, origin: Origin): void;
|
|
31
31
|
addVarName(context: Context, name: string, kind: BindingKind): void;
|
|
32
32
|
hasVariable(name: string): boolean;
|
|
33
|
-
addBlockName(context: Context, name: string, kind: BindingKind, origin
|
|
33
|
+
addBlockName(context: Context, name: string, kind: BindingKind, origin?: Origin): void;
|
|
34
34
|
recordScopeError(type: Errors, ...params: string[]): void;
|
|
35
35
|
reportScopeError(): void;
|
|
36
36
|
}
|
package/dist/types/parser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Context } from './common.ts';
|
|
2
2
|
import type * as ESTree from './estree.ts';
|
|
3
|
-
import { type
|
|
4
|
-
export declare function parseSource(source: string, rawOptions?:
|
|
3
|
+
import { type InternalOptions } from './options.ts';
|
|
4
|
+
export declare function parseSource(source: string, rawOptions?: InternalOptions, context?: Context): ESTree.Program;
|
package/dist/types/token.d.ts
CHANGED
|
@@ -163,6 +163,6 @@ export declare const enum Token {
|
|
|
163
163
|
JSXText = 138
|
|
164
164
|
}
|
|
165
165
|
export declare const KeywordDescTable: string[];
|
|
166
|
-
export declare const descKeywordTable:
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
export declare const descKeywordTable: Map<string, Token>;
|
|
167
|
+
export declare const minKeywordLength: number;
|
|
168
|
+
export declare const maxKeywordLength: number;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getOwnProperty<T>(object: Record<string | number, T>, key: string | number): T | undefined;
|