meriyah 7.1.0 → 7.1.2

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.
@@ -1,5 +1,5 @@
1
- import { type Parser } from './parser/parser';
2
- import { Token } from './token';
1
+ import { type Parser } from './parser/parser.ts';
2
+ import { Token } from './token.ts';
3
3
  export declare const enum Context {
4
4
  None = 0,
5
5
  Strict = 1,
@@ -97,7 +97,8 @@ export declare const enum Flags {
97
97
  StrictEvalArguments = 512,
98
98
  DisallowCall = 1024,
99
99
  HasOptionalChaining = 2048,
100
- EightAndNine = 4096
100
+ EightAndNine = 4096,
101
+ DisallowInvoke = 8192
101
102
  }
102
103
  export declare const enum HoistedClassFlags {
103
104
  None = 0,
@@ -1,5 +1,5 @@
1
- import { type Location } from './common';
2
- import { type _Node, type SourceLocation } from './estree';
1
+ import { type Location } from './common.ts';
2
+ import { type _Node, type SourceLocation } from './estree.ts';
3
3
  export declare const enum Errors {
4
4
  Unexpected = 0,
5
5
  StrictOctalEscape = 1,
@@ -1,6 +1,6 @@
1
- import { Context, type Location } from '../common';
2
- import { type Parser } from '../parser/parser';
3
- import { LexerState } from './common';
1
+ import { Context, type Location } from '../common.ts';
2
+ import { type Parser } from '../parser/parser.ts';
3
+ import { LexerState } from './common.ts';
4
4
  export declare const enum CommentType {
5
5
  Single = 0,
6
6
  Multi = 1,
@@ -1,5 +1,5 @@
1
- import { type Parser } from '../parser/parser';
2
- import { Token } from '../token';
1
+ import { type Parser } from '../parser/parser.ts';
2
+ import { Token } from '../token.ts';
3
3
  export declare const enum LexerState {
4
4
  None = 0,
5
5
  NewLine = 1,
@@ -1,6 +1,6 @@
1
- import { Context } from '../common';
2
- import { type Parser } from '../parser/parser';
3
- import { Token } from './../token';
1
+ import { Context } from '../common.ts';
2
+ import { type Parser } from '../parser/parser.ts';
3
+ import { Token } from './../token.ts';
4
4
  export declare function scanIdentifier(parser: Parser, context: Context, isValidAsKeyword: 0 | 1): Token;
5
5
  export declare function scanUnicodeIdentifier(parser: Parser, context: Context): Token;
6
6
  export declare function scanIdentifierSlowCase(parser: Parser, context: Context, hasEscape: 0 | 1, isValidAsKeyword: number): Token;
@@ -1,3 +1,3 @@
1
- export { scanSingleToken, nextToken } from './scan';
2
- export { skipHashBang } from './comments';
3
- export { advanceChar, consumeLineFeed, scanNewLine, LexerState, convertTokenType } from './common';
1
+ export { scanSingleToken, nextToken } from './scan.ts';
2
+ export { skipHashBang } from './comments.ts';
3
+ export { advanceChar, consumeLineFeed, scanNewLine, LexerState, convertTokenType } from './common.ts';
@@ -1,6 +1,6 @@
1
- import { type Context } from '../common';
2
- import { type Parser } from '../parser/parser';
3
- import { Token } from '../token';
1
+ import { type Context } from '../common.ts';
2
+ import { type Parser } from '../parser/parser.ts';
3
+ import { Token } from '../token.ts';
4
4
  export declare function scanJSXAttributeValue(parser: Parser, context: Context): Token;
5
5
  export declare function nextJSXToken(parser: Parser): void;
6
6
  export declare function rescanJSXIdentifier(parser: Parser): Token;
@@ -1,5 +1,5 @@
1
- import { Context } from '../common';
2
- import { type Parser } from '../parser/parser';
3
- import { Token } from '../token';
4
- import { NumberKind } from './common';
1
+ import { Context } from '../common.ts';
2
+ import { type Parser } from '../parser/parser.ts';
3
+ import { Token } from '../token.ts';
4
+ import { NumberKind } from './common.ts';
5
5
  export declare function scanNumber(parser: Parser, context: Context, kind: NumberKind): Token;
@@ -1,3 +1,3 @@
1
- import { type Parser } from '../parser/parser';
2
- import { Token } from '../token';
1
+ import { type Parser } from '../parser/parser.ts';
2
+ import { Token } from '../token.ts';
3
3
  export declare function scanRegularExpression(parser: Parser): Token;
@@ -1,6 +1,6 @@
1
- import { Context } from '../common';
2
- import { type Parser } from '../parser/parser';
3
- import { Token } from '../token';
4
- import { LexerState } from './common';
1
+ import { Context } from '../common.ts';
2
+ import { type Parser } from '../parser/parser.ts';
3
+ import { Token } from '../token.ts';
4
+ import { LexerState } from './common.ts';
5
5
  export declare function nextToken(parser: Parser, context: Context): void;
6
6
  export declare function scanSingleToken(parser: Parser, context: Context, state: LexerState): Token;
@@ -1,6 +1,6 @@
1
- import { Context } from '../common';
2
- import { type Parser } from '../parser/parser';
3
- import { Token } from '../token';
1
+ import { Context } from '../common.ts';
2
+ import { type Parser } from '../parser/parser.ts';
3
+ import { Token } from '../token.ts';
4
4
  export declare const enum Escape {
5
5
  Empty = -1,
6
6
  StrictOctal = -2,
@@ -1,5 +1,5 @@
1
- import { Context } from '../common';
2
- import { type Parser } from '../parser/parser';
3
- import { Token } from '../token';
1
+ import { Context } from '../common.ts';
2
+ import { type Parser } from '../parser/parser.ts';
3
+ import { Token } from '../token.ts';
4
4
  export declare function scanTemplate(parser: Parser, context: Context): Token;
5
5
  export declare function scanTemplateTail(parser: Parser, context: Context): Token;
@@ -1,9 +1,9 @@
1
- import { type Program } from './estree';
2
- import { type Options } from './options';
3
- declare const version: string;
1
+ import { type Program } from './estree.ts';
2
+ import { type Options } from './options.ts';
3
+ export declare const version: string;
4
4
  export declare function parseScript(source: string, options?: Omit<Options, 'sourceType'>): Program;
5
5
  export declare function parseModule(source: string, options?: Omit<Options, 'sourceType'>): Program;
6
6
  export declare function parse(source: string, options?: Options): Program;
7
- export { type Options, version };
8
- export type * as ESTree from './estree';
9
- export { isParseError, type ParseError } from './errors';
7
+ export { type Options } from './options.ts';
8
+ export type * as ESTree from './estree.ts';
9
+ export { isParseError, type ParseError } from './errors.ts';
@@ -1,5 +1,5 @@
1
- import type * as ESTree from './estree';
2
- import { type Token } from './token';
1
+ import type * as ESTree from './estree.ts';
2
+ import { type Token } from './token.ts';
3
3
  type OnInsertedSemicolon = (pos: number) => any;
4
4
  type SourceType = 'script' | 'module' | 'commonjs';
5
5
  export type OnToken = (token: string, start: number, end: number, loc: ESTree.SourceLocation) => any;
@@ -7,7 +7,11 @@ export type OnComment = (type: ESTree.CommentType, value: string, start: number,
7
7
  export interface Options {
8
8
  sourceType?: SourceType;
9
9
  next?: boolean;
10
- ranges?: boolean;
10
+ ranges?: boolean | {
11
+ start?: boolean;
12
+ end?: boolean;
13
+ range?: boolean;
14
+ };
11
15
  webcompat?: boolean;
12
16
  loc?: boolean;
13
17
  raw?: boolean;
@@ -23,8 +27,14 @@ export interface Options {
23
27
  module?: boolean;
24
28
  globalReturn?: boolean;
25
29
  }
26
- export type NormalizedOptions = Omit<Options, 'validateRegex' | 'onComment' | 'onToken'> & {
30
+ interface NormalizedRanges {
31
+ start: boolean;
32
+ end: boolean;
33
+ range: boolean;
34
+ }
35
+ export type NormalizedOptions = Omit<Options, 'validateRegex' | 'onComment' | 'onToken' | 'ranges'> & {
27
36
  validateRegex: boolean;
37
+ ranges?: NormalizedRanges;
28
38
  onComment?: OnComment;
29
39
  onToken?: OnToken;
30
40
  };
@@ -1,10 +1,10 @@
1
- import { AssignmentTargetKind, DestructuringKind, Flags, type Location } from '../common';
2
- import { Errors } from '../errors';
3
- import type * as ESTree from '../estree';
4
- import { type NormalizedOptions, type Options } from '../options';
5
- import { Token } from '../token';
6
- import { PrivateScope } from './private-scope';
7
- import { Scope, type ScopeKind } from './scope';
1
+ import { AssignmentTargetKind, DestructuringKind, Flags, type Location } from '../common.ts';
2
+ import { Errors } from '../errors.ts';
3
+ import type * as ESTree from '../estree.ts';
4
+ import { type NormalizedOptions, type Options } from '../options.ts';
5
+ import { Token } from '../token.ts';
6
+ import { PrivateScope } from './private-scope.ts';
7
+ import { Scope, type ScopeKind } from './scope.ts';
8
8
  export declare class Parser {
9
9
  readonly source: string;
10
10
  private lastOnToken;
@@ -32,6 +32,7 @@ export declare class Parser {
32
32
  exportedBindings: Set<string>;
33
33
  assignable: AssignmentTargetKind;
34
34
  destructible: DestructuringKind;
35
+ strictReservedRange: [Location, Location] | null;
35
36
  leadingDecorators: {
36
37
  start?: Location;
37
38
  decorators: ESTree.Decorator[];
@@ -1,5 +1,5 @@
1
- import { type Location, PropertyKind } from '../common';
2
- import { type Parser } from './parser';
1
+ import { type Location, PropertyKind } from '../common.ts';
2
+ import { type Parser } from './parser.ts';
3
3
  export declare class PrivateScope {
4
4
  readonly parser: Parser;
5
5
  readonly parent?: PrivateScope | undefined;
@@ -1,6 +1,6 @@
1
- import { BindingKind, Context, type Location, Origin } from '../common';
2
- import { Errors } from '../errors';
3
- import { type Parser } from './parser';
1
+ import { BindingKind, Context, type Location, Origin } from '../common.ts';
2
+ import { Errors } from '../errors.ts';
3
+ import { type Parser } from './parser.ts';
4
4
  export declare const enum ScopeKind {
5
5
  ForStatement = 1,
6
6
  Block = 2,
@@ -1,4 +1,4 @@
1
- import { Context } from './common';
2
- import type * as ESTree from './estree';
3
- import { type Options } from './options';
1
+ import { Context } from './common.ts';
2
+ import type * as ESTree from './estree.ts';
3
+ import { type Options } from './options.ts';
4
4
  export declare function parseSource(source: string, rawOptions?: Options, context?: Context): ESTree.Program;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meriyah",
3
- "version": "7.1.0",
3
+ "version": "7.1.2",
4
4
  "description": "A 100% compliant, self-hosted javascript parser with high focus on both performance and stability",
5
5
  "main": "dist/meriyah.cjs",
6
6
  "module": "dist/meriyah.min.mjs",