This commit is contained in:
2023-08-11 10:45:20 +08:00
commit 161ca982f3
31850 changed files with 2706500 additions and 0 deletions

14384
node_modules/@babel/parser/lib/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1
node_modules/@babel/parser/lib/index.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

44
node_modules/@babel/parser/lib/options.js generated vendored Normal file
View File

@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultOptions = void 0;
exports.getOptions = getOptions;
const defaultOptions = {
sourceType: "script",
sourceFilename: undefined,
startColumn: 0,
startLine: 1,
allowAwaitOutsideFunction: false,
allowReturnOutsideFunction: false,
allowNewTargetOutsideFunction: false,
allowImportExportEverywhere: false,
allowSuperOutsideMethod: false,
allowUndeclaredExports: false,
plugins: [],
strictMode: null,
ranges: false,
tokens: false,
createParenthesizedExpressions: false,
errorRecovery: false,
attachComment: true,
annexB: true
};
exports.defaultOptions = defaultOptions;
function getOptions(opts) {
if (opts == null) {
return Object.assign({}, defaultOptions);
}
if (opts.annexB != null && opts.annexB !== false) {
throw new Error("The `annexB` option can only be set to `false`.");
}
const options = {};
for (const key of Object.keys(defaultOptions)) {
var _opts$key;
options[key] = (_opts$key = opts[key]) != null ? _opts$key : defaultOptions[key];
}
return options;
}
//# sourceMappingURL=options.js.map

1
node_modules/@babel/parser/lib/options.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

106
node_modules/@babel/parser/lib/parse-error.js generated vendored Normal file
View File

@ -0,0 +1,106 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
ParseErrorEnum: true,
Errors: true
};
exports.Errors = void 0;
exports.ParseErrorEnum = ParseErrorEnum;
var _location = require("./util/location");
var _credentials = require("./parse-error/credentials");
Object.keys(_credentials).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _credentials[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _credentials[key];
}
});
});
var _moduleErrors = require("./parse-error/module-errors");
var _standardErrors = require("./parse-error/standard-errors");
var _strictModeErrors = require("./parse-error/strict-mode-errors");
var _pipelineOperatorErrors = require("./parse-error/pipeline-operator-errors");
const _excluded = ["toMessage"],
_excluded2 = ["message"];
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function toParseErrorConstructor(_ref) {
let {
toMessage
} = _ref,
properties = _objectWithoutPropertiesLoose(_ref, _excluded);
return function constructor({
loc,
details
}) {
return (0, _credentials.instantiate)(SyntaxError, Object.assign({}, properties, {
loc
}), {
clone(overrides = {}) {
const loc = overrides.loc || {};
return constructor({
loc: new _location.Position("line" in loc ? loc.line : this.loc.line, "column" in loc ? loc.column : this.loc.column, "index" in loc ? loc.index : this.loc.index),
details: Object.assign({}, this.details, overrides.details)
});
},
details: {
value: details,
enumerable: false
},
message: {
get() {
return `${toMessage(this.details)} (${this.loc.line}:${this.loc.column})`;
},
set(value) {
Object.defineProperty(this, "message", {
value
});
}
},
pos: {
reflect: "loc.index",
enumerable: true
},
missingPlugin: "missingPlugin" in details && {
reflect: "details.missingPlugin",
enumerable: true
}
});
};
}
function ParseErrorEnum(argument, syntaxPlugin) {
if (Array.isArray(argument)) {
return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]);
}
const ParseErrorConstructors = {};
for (const reasonCode of Object.keys(argument)) {
const template = argument[reasonCode];
const _ref2 = typeof template === "string" ? {
message: () => template
} : typeof template === "function" ? {
message: template
} : template,
{
message
} = _ref2,
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
const toMessage = typeof message === "string" ? () => message : message;
ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({
code: _credentials.ParseErrorCode.SyntaxError,
reasonCode,
toMessage
}, syntaxPlugin ? {
syntaxPlugin
} : {}, rest));
}
return ParseErrorConstructors;
}
const Errors = Object.assign({}, ParseErrorEnum(_moduleErrors.default), ParseErrorEnum(_standardErrors.default), ParseErrorEnum(_strictModeErrors.default), ParseErrorEnum`pipelineOperator`(_pipelineOperatorErrors.default));
exports.Errors = Errors;
//# sourceMappingURL=parse-error.js.map

1
node_modules/@babel/parser/lib/parse-error.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.instantiate = exports.ParseErrorCode = void 0;
var ParseErrorCode = {
SyntaxError: "BABEL_PARSER_SYNTAX_ERROR",
SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
};
exports.ParseErrorCode = ParseErrorCode;
const reflect = (keys, last = keys.length - 1) => ({
get() {
return keys.reduce((object, key) => object[key], this);
},
set(value) {
keys.reduce((item, key, i) => i === last ? item[key] = value : item[key], this);
}
});
const instantiate = (constructor, properties, descriptors) => Object.keys(descriptors).map(key => [key, descriptors[key]]).filter(([, descriptor]) => !!descriptor).map(([key, descriptor]) => [key, typeof descriptor === "function" ? {
value: descriptor,
enumerable: false
} : typeof descriptor.reflect === "string" ? Object.assign({}, descriptor, reflect(descriptor.reflect.split("."))) : descriptor]).reduce((instance, [key, descriptor]) => Object.defineProperty(instance, key, Object.assign({
configurable: true
}, descriptor)), Object.assign(new constructor(), properties));
exports.instantiate = instantiate;
//# sourceMappingURL=credentials.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["ParseErrorCode","SyntaxError","SourceTypeModuleError","exports","reflect","keys","last","length","get","reduce","object","key","set","value","item","i","instantiate","constructor","properties","descriptors","Object","map","filter","descriptor","enumerable","assign","split","instance","defineProperty","configurable"],"sources":["../../src/parse-error/credentials.ts"],"sourcesContent":["export const enum ParseErrorCode {\n SyntaxError = \"BABEL_PARSER_SYNTAX_ERROR\",\n SourceTypeModuleError = \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\",\n}\n\nexport type SyntaxPlugin =\n | \"flow\"\n | \"typescript\"\n | \"jsx\"\n | \"pipelineOperator\"\n | \"placeholders\";\n\nexport type ToMessage<ErrorDetails> = (self: ErrorDetails) => string;\n\nexport type ParseErrorCredentials<ErrorDetails> = {\n code: ParseErrorCode;\n reasonCode: string;\n syntaxPlugin?: SyntaxPlugin;\n toMessage: ToMessage<ErrorDetails>;\n};\n\nconst reflect = (keys: string[], last = keys.length - 1) => ({\n get(this: unknown): unknown {\n return keys.reduce(\n (object, key) =>\n // @ts-expect-error key should index object\n object[key],\n this,\n );\n },\n set(this: unknown, value: unknown) {\n keys.reduce(\n // @ts-expect-error key should index item\n (item, key, i) => (i === last ? (item[key] = value) : item[key]),\n this,\n );\n },\n});\n\nconst instantiate = <T>(\n constructor: new () => T,\n properties: any,\n descriptors: any,\n) =>\n Object.keys(descriptors)\n .map(key => [key, descriptors[key]])\n .filter(([, descriptor]) => !!descriptor)\n .map(([key, descriptor]) => [\n key,\n typeof descriptor === \"function\"\n ? { value: descriptor, enumerable: false }\n : typeof descriptor.reflect === \"string\"\n ? { ...descriptor, ...reflect(descriptor.reflect.split(\".\")) }\n : descriptor,\n ])\n .reduce(\n (instance, [key, descriptor]) =>\n Object.defineProperty(instance, key, {\n configurable: true,\n ...descriptor,\n }),\n Object.assign(new constructor(), properties),\n );\n\nexport { instantiate };\n"],"mappings":";;;;;;IAAkBA,cAAc;EAAAC,WAAA;EAAAC,qBAAA;AAAA;AAAAC,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAqBhC,MAAMI,OAAO,GAAGA,CAACC,IAAc,EAAEC,IAAI,GAAGD,IAAI,CAACE,MAAM,GAAG,CAAC,MAAM;EAC3DC,GAAGA,CAAA,EAAyB;IAC1B,OAAOH,IAAI,CAACI,MAAM,CAChB,CAACC,MAAM,EAAEC,GAAG,KAEVD,MAAM,CAACC,GAAG,CAAC,EACb,IACF,CAAC;EACH,CAAC;EACDC,GAAGA,CAAgBC,KAAc,EAAE;IACjCR,IAAI,CAACI,MAAM,CAET,CAACK,IAAI,EAAEH,GAAG,EAAEI,CAAC,KAAMA,CAAC,KAAKT,IAAI,GAAIQ,IAAI,CAACH,GAAG,CAAC,GAAGE,KAAK,GAAIC,IAAI,CAACH,GAAG,CAAE,EAChE,IACF,CAAC;EACH;AACF,CAAC,CAAC;AAEF,MAAMK,WAAW,GAAGA,CAClBC,WAAwB,EACxBC,UAAe,EACfC,WAAgB,KAEhBC,MAAM,CAACf,IAAI,CAACc,WAAW,CAAC,CACrBE,GAAG,CAACV,GAAG,IAAI,CAACA,GAAG,EAAEQ,WAAW,CAACR,GAAG,CAAC,CAAC,CAAC,CACnCW,MAAM,CAAC,CAAC,GAAGC,UAAU,CAAC,KAAK,CAAC,CAACA,UAAU,CAAC,CACxCF,GAAG,CAAC,CAAC,CAACV,GAAG,EAAEY,UAAU,CAAC,KAAK,CAC1BZ,GAAG,EACH,OAAOY,UAAU,KAAK,UAAU,GAC5B;EAAEV,KAAK,EAAEU,UAAU;EAAEC,UAAU,EAAE;AAAM,CAAC,GACxC,OAAOD,UAAU,CAACnB,OAAO,KAAK,QAAQ,GAAAgB,MAAA,CAAAK,MAAA,KACjCF,UAAU,EAAKnB,OAAO,CAACmB,UAAU,CAACnB,OAAO,CAACsB,KAAK,CAAC,GAAG,CAAC,CAAC,IAC1DH,UAAU,CACf,CAAC,CACDd,MAAM,CACL,CAACkB,QAAQ,EAAE,CAAChB,GAAG,EAAEY,UAAU,CAAC,KAC1BH,MAAM,CAACQ,cAAc,CAACD,QAAQ,EAAEhB,GAAG,EAAAS,MAAA,CAAAK,MAAA;EACjCI,YAAY,EAAE;AAAI,GACfN,UAAU,CACd,CAAC,EACJH,MAAM,CAACK,MAAM,CAAC,IAAIR,WAAW,CAAC,CAAC,EAAEC,UAAU,CAC7C,CAAC;AAACf,OAAA,CAAAa,WAAA,GAAAA,WAAA"}

View File

@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _parseError = require("../parse-error");
var _default = {
ImportMetaOutsideModule: {
message: `import.meta may appear only with 'sourceType: "module"'`,
code: _parseError.ParseErrorCode.SourceTypeModuleError
},
ImportOutsideModule: {
message: `'import' and 'export' may appear only with 'sourceType: "module"'`,
code: _parseError.ParseErrorCode.SourceTypeModuleError
}
};
exports.default = _default;
//# sourceMappingURL=module-errors.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_parseError","require","_default","ImportMetaOutsideModule","message","code","ParseErrorCode","SourceTypeModuleError","ImportOutsideModule","exports","default"],"sources":["../../src/parse-error/module-errors.ts"],"sourcesContent":["import { ParseErrorCode } from \"../parse-error\";\n\nexport default {\n ImportMetaOutsideModule: {\n message: `import.meta may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n ImportOutsideModule: {\n message: `'import' and 'export' may appear only with 'sourceType: \"module\"'`,\n code: ParseErrorCode.SourceTypeModuleError,\n },\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAgD,IAAAC,QAAA,GAEjC;EACbC,uBAAuB,EAAE;IACvBC,OAAO,EAAG,yDAAwD;IAClEC,IAAI,EAAEC,0BAAc,CAACC;EACvB,CAAC;EACDC,mBAAmB,EAAE;IACnBJ,OAAO,EAAG,mEAAkE;IAC5EC,IAAI,EAAEC,0BAAc,CAACC;EACvB;AACF,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAR,QAAA"}

View File

@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.UnparenthesizedPipeBodyDescriptions = void 0;
var _toNodeDescription = require("./to-node-description");
const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]);
exports.UnparenthesizedPipeBodyDescriptions = UnparenthesizedPipeBodyDescriptions;
var _default = {
PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",
PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',
PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
PipeTopicUnconfiguredToken: ({
token
}) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
PipeUnparenthesizedBody: ({
type
}) => `Hack-style pipe body cannot be an unparenthesized ${(0, _toNodeDescription.default)({
type
})}; please wrap it in parentheses.`,
PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',
PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.",
PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.",
PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.",
PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.",
PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'
};
exports.default = _default;
//# sourceMappingURL=pipeline-operator-errors.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_toNodeDescription","require","UnparenthesizedPipeBodyDescriptions","Set","exports","_default","PipeBodyIsTighter","PipeTopicRequiresHackPipes","PipeTopicUnbound","PipeTopicUnconfiguredToken","token","PipeTopicUnused","PipeUnparenthesizedBody","type","toNodeDescription","PipelineBodyNoArrow","PipelineBodySequenceExpression","PipelineHeadSequenceExpression","PipelineTopicUnused","PrimaryTopicNotAllowed","PrimaryTopicRequiresSmartPipeline","default"],"sources":["../../src/parse-error/pipeline-operator-errors.ts"],"sourcesContent":["import toNodeDescription from \"./to-node-description\";\n\nexport const UnparenthesizedPipeBodyDescriptions = new Set([\n \"ArrowFunctionExpression\",\n \"AssignmentExpression\",\n \"ConditionalExpression\",\n \"YieldExpression\",\n] as const);\n\ntype GetSetMemberType<T extends Set<any>> = T extends Set<infer M>\n ? M\n : unknown;\n\ntype UnparenthesizedPipeBodyTypes = GetSetMemberType<\n typeof UnparenthesizedPipeBodyDescriptions\n>;\n\nexport default {\n // This error is only used by the smart-mix proposal\n PipeBodyIsTighter:\n \"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.\",\n PipeTopicRequiresHackPipes:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n PipeTopicUnbound:\n \"Topic reference is unbound; it must be inside a pipe body.\",\n PipeTopicUnconfiguredToken: ({ token }: { token: string }) =>\n `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { \"proposal\": \"hack\", \"topicToken\": \"${token}\" }.`,\n PipeTopicUnused:\n \"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.\",\n PipeUnparenthesizedBody: ({ type }: { type: UnparenthesizedPipeBodyTypes }) =>\n `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({\n type,\n })}; please wrap it in parentheses.`,\n\n // Messages whose codes start with “Pipeline” or “PrimaryTopic”\n // are retained for backwards compatibility\n // with the deprecated smart-mix pipe operator proposal plugin.\n // They are subject to removal in a future major version.\n PipelineBodyNoArrow:\n 'Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized.',\n PipelineBodySequenceExpression:\n \"Pipeline body may not be a comma-separated sequence expression.\",\n PipelineHeadSequenceExpression:\n \"Pipeline head should not be a comma-separated sequence expression.\",\n PipelineTopicUnused:\n \"Pipeline is in topic style but does not use topic reference.\",\n PrimaryTopicNotAllowed:\n \"Topic reference was used in a lexical context without topic binding.\",\n PrimaryTopicRequiresSmartPipeline:\n 'Topic reference is used, but the pipelineOperator plugin was not passed a \"proposal\": \"hack\" or \"smart\" option.',\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAMC,mCAAmC,GAAG,IAAIC,GAAG,CAAC,CACzD,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CACT,CAAC;AAACC,OAAA,CAAAF,mCAAA,GAAAA,mCAAA;AAAA,IAAAG,QAAA,GAUG;EAEbC,iBAAiB,EACf,uJAAuJ;EACzJC,0BAA0B,EACxB,iHAAiH;EACnHC,gBAAgB,EACd,4DAA4D;EAC9DC,0BAA0B,EAAEA,CAAC;IAAEC;EAAyB,CAAC,KACtD,uBAAsBA,KAAM,qBAAoBA,KAAM,mHAAkHA,KAAM,MAAK;EACtLC,eAAe,EACb,yGAAyG;EAC3GC,uBAAuB,EAAEA,CAAC;IAAEC;EAA6C,CAAC,KACvE,qDAAoD,IAAAC,0BAAiB,EAAC;IACrED;EACF,CAAC,CAAE,kCAAiC;EAMtCE,mBAAmB,EACjB,mGAAmG;EACrGC,8BAA8B,EAC5B,iEAAiE;EACnEC,8BAA8B,EAC5B,oEAAoE;EACtEC,mBAAmB,EACjB,8DAA8D;EAChEC,sBAAsB,EACpB,sEAAsE;EACxEC,iCAAiC,EAC/B;AACJ,CAAC;AAAAhB,OAAA,CAAAiB,OAAA,GAAAhB,QAAA"}

View File

@ -0,0 +1,220 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _toNodeDescription = require("./to-node-description");
var _default = {
AccessorIsGenerator: ({
kind
}) => `A ${kind}ter cannot be a generator.`,
ArgumentsInClass: "'arguments' is only allowed in functions and class methods.",
AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.",
AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.",
AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.",
AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.",
AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.",
AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.",
AwaitNotInAsyncFunction: "'await' is only allowed within async functions.",
BadGetterArity: "A 'get' accessor must not have any formal parameters.",
BadSetterArity: "A 'set' accessor must have exactly one formal parameter.",
BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.",
ConstructorClassField: "Classes may not have a field named 'constructor'.",
ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.",
ConstructorIsAccessor: "Class constructor may not be an accessor.",
ConstructorIsAsync: "Constructor can't be an async function.",
ConstructorIsGenerator: "Constructor can't be a generator.",
DeclarationMissingInitializer: ({
kind
}) => `Missing initializer in ${kind} declaration.`,
DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",
DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",
DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
DecoratorStaticBlock: "Decorators can't be used with a static block.",
DeletePrivateField: "Deleting a private field is not allowed.",
DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
DuplicateConstructor: "Duplicate constructor in the same class.",
DuplicateDefaultExport: "Only one default export allowed per module.",
DuplicateExport: ({
exportName
}) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`,
DuplicateProto: "Redefinition of __proto__ property.",
DuplicateRegExpFlags: "Duplicate regular expression flag.",
ElementAfterRest: "Rest element must be last element.",
EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
ExportBindingIsString: ({
localName,
exportName
}) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
ForInOfLoopInitializer: ({
type
}) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
ForInUsing: "For-in loop may not start with 'using' declaration.",
ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.",
GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.",
IllegalBreakContinue: ({
type
}) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`,
IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
IllegalReturn: "'return' outside of function.",
ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",
ImportBindingIsString: ({
importName
}) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`,
ImportCallArgumentTrailingComma: "Trailing comma is disallowed inside import(...) arguments.",
ImportCallArity: ({
maxArgumentCount
}) => `\`import()\` requires exactly ${maxArgumentCount === 1 ? "one argument" : "one or two arguments"}.`,
ImportCallNotNewExpression: "Cannot use new with import(...).",
ImportCallSpreadArgument: "`...` is not allowed in `import()`.",
ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.",
ImportReflectionHasAssertion: "`import module x` cannot have assertions.",
ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.',
IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
InvalidBigIntLiteral: "Invalid BigIntLiteral.",
InvalidCodePoint: "Code point out of bounds.",
InvalidCoverInitializedName: "Invalid shorthand property initializer.",
InvalidDecimal: "Invalid decimal.",
InvalidDigit: ({
radix
}) => `Expected number in radix ${radix}.`,
InvalidEscapeSequence: "Bad character escape sequence.",
InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.",
InvalidEscapedReservedWord: ({
reservedWord
}) => `Escape sequence in keyword ${reservedWord}.`,
InvalidIdentifier: ({
identifierName
}) => `Invalid identifier ${identifierName}.`,
InvalidLhs: ({
ancestor
}) => `Invalid left-hand side in ${(0, _toNodeDescription.default)(ancestor)}.`,
InvalidLhsBinding: ({
ancestor
}) => `Binding invalid left-hand side in ${(0, _toNodeDescription.default)(ancestor)}.`,
InvalidNumber: "Invalid number.",
InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.",
InvalidOrUnexpectedToken: ({
unexpected
}) => `Unexpected character '${unexpected}'.`,
InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.",
InvalidPrivateFieldResolution: ({
identifierName
}) => `Private name #${identifierName} is not defined.`,
InvalidPropertyBindingPattern: "Binding member expression.",
InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.",
InvalidRestAssignmentPattern: "Invalid rest operator's argument.",
LabelRedeclaration: ({
labelName
}) => `Label '${labelName}' is already declared.`,
LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.",
LineTerminatorBeforeArrow: "No line break is allowed before '=>'.",
MalformedRegExpFlags: "Invalid regular expression flag.",
MissingClassName: "A class name is required.",
MissingEqInAssignment: "Only '=' operator can be used for specifying default value.",
MissingSemicolon: "Missing semicolon.",
MissingPlugin: ({
missingPlugin
}) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
MissingOneOfPlugins: ({
missingPlugin
}) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`,
MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.",
MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.",
ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.",
ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.",
ModuleAttributesWithDuplicateKeys: ({
key
}) => `Duplicate key "${key}" is not allowed in module attributes.`,
ModuleExportNameHasLoneSurrogate: ({
surrogateCharCode
}) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`,
ModuleExportUndefined: ({
localName
}) => `Export '${localName}' is not defined.`,
MultipleDefaultsInSwitch: "Multiple default clauses.",
NewlineAfterThrow: "Illegal newline after throw.",
NoCatchOrFinally: "Missing catch or finally clause.",
NumberIdentifier: "Identifier directly after number.",
NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",
ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.",
OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.",
OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.",
OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.",
ParamDupe: "Argument name clash.",
PatternHasAccessor: "Object pattern can't contain getter or setter.",
PatternHasMethod: "Object pattern can't contain methods.",
PrivateInExpectedIn: ({
identifierName
}) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`,
PrivateNameRedeclaration: ({
identifierName
}) => `Duplicate private name #${identifierName}.`,
RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
RecordNoProto: "'__proto__' is not allowed in Record expressions.",
RestTrailingComma: "Unexpected trailing comma after rest element.",
SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.",
SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",
StaticPrototype: "Classes may not have static property named prototype.",
SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",
SuperPrivateField: "Private fields can't be accessed on super.",
TrailingDecorator: "Decorators must be attached to a class element.",
TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",
TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",
UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.",
UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',
UnexpectedDigitAfterHash: "Unexpected digit after hash token.",
UnexpectedImportExport: "'import' and 'export' may only appear at the top level.",
UnexpectedKeyword: ({
keyword
}) => `Unexpected keyword '${keyword}'.`,
UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.",
UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.",
UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.",
UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.",
UnexpectedPrivateField: "Unexpected private name.",
UnexpectedReservedWord: ({
reservedWord
}) => `Unexpected reserved word '${reservedWord}'.`,
UnexpectedSuper: "'super' is only allowed in object methods and classes.",
UnexpectedToken: ({
expected,
unexpected
}) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`,
UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",
UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script`.",
UnsupportedBind: "Binding should be performed on object property.",
UnsupportedDecoratorExport: "A decorated export must export a class declaration.",
UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.",
UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.",
UnsupportedMetaProperty: ({
target,
onlyValidPropertyName
}) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`,
UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.",
UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.",
UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",
UnterminatedComment: "Unterminated comment.",
UnterminatedRegExp: "Unterminated regular expression.",
UnterminatedString: "Unterminated string constant.",
UnterminatedTemplate: "Unterminated template.",
UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.",
VarRedeclaration: ({
identifierName
}) => `Identifier '${identifierName}' has already been declared.`,
YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.",
YieldInParameter: "Yield expression is not allowed in formal parameters.",
ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0."
};
exports.default = _default;
//# sourceMappingURL=standard-errors.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = {
StrictDelete: "Deleting local variable in strict mode.",
StrictEvalArguments: ({
referenceName
}) => `Assigning to '${referenceName}' in strict mode.`,
StrictEvalArgumentsBinding: ({
bindingName
}) => `Binding '${bindingName}' in strict mode.`,
StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.",
StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.",
StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.",
StrictWith: "'with' in strict mode."
};
exports.default = _default;
//# sourceMappingURL=strict-mode-errors.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["StrictDelete","StrictEvalArguments","referenceName","StrictEvalArgumentsBinding","bindingName","StrictFunction","StrictNumericEscape","StrictOctalLiteral","StrictWith","exports","default","_default"],"sources":["../../src/parse-error/strict-mode-errors.ts"],"sourcesContent":["export default {\n StrictDelete: \"Deleting local variable in strict mode.\",\n\n // `referenceName` is the StringValue[1] of an IdentifierReference[2], which\n // is represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-IdentifierReference\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArguments: ({ referenceName }: { referenceName: string }) =>\n `Assigning to '${referenceName}' in strict mode.`,\n\n // `bindingName` is the StringValue[1] of a BindingIdentifier[2], which is\n // represented as just an `Identifier`[3] in the Babel AST.\n // 1. https://tc39.es/ecma262/#sec-static-semantics-stringvalue\n // 2. https://tc39.es/ecma262/#prod-BindingIdentifier\n // 3. https://github.com/babel/babel/blob/main/packages/babel-parser/ast/spec.md#identifier\n StrictEvalArgumentsBinding: ({ bindingName }: { bindingName: string }) =>\n `Binding '${bindingName}' in strict mode.`,\n\n StrictFunction:\n \"In strict mode code, functions can only be declared at top level or inside a block.\",\n\n StrictNumericEscape: \"The only valid numeric escape in strict mode is '\\\\0'.\",\n\n StrictOctalLiteral: \"Legacy octal literals are not allowed in strict mode.\",\n\n StrictWith: \"'with' in strict mode.\",\n};\n"],"mappings":";;;;;;eAAe;EACbA,YAAY,EAAE,yCAAyC;EAOvDC,mBAAmB,EAAEA,CAAC;IAAEC;EAAyC,CAAC,KAC/D,iBAAgBA,aAAc,mBAAkB;EAOnDC,0BAA0B,EAAEA,CAAC;IAAEC;EAAqC,CAAC,KAClE,YAAWA,WAAY,mBAAkB;EAE5CC,cAAc,EACZ,qFAAqF;EAEvFC,mBAAmB,EAAE,wDAAwD;EAE7EC,kBAAkB,EAAE,uDAAuD;EAE3EC,UAAU,EAAE;AACd,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAC,QAAA"}

View File

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const NodeDescriptions = {
ArrayPattern: "array destructuring pattern",
AssignmentExpression: "assignment expression",
AssignmentPattern: "assignment expression",
ArrowFunctionExpression: "arrow function expression",
ConditionalExpression: "conditional expression",
CatchClause: "catch clause",
ForOfStatement: "for-of statement",
ForInStatement: "for-in statement",
ForStatement: "for-loop",
FormalParameters: "function parameter list",
Identifier: "identifier",
ImportSpecifier: "import specifier",
ImportDefaultSpecifier: "import default specifier",
ImportNamespaceSpecifier: "import namespace specifier",
ObjectPattern: "object destructuring pattern",
ParenthesizedExpression: "parenthesized expression",
RestElement: "rest element",
UpdateExpression: {
true: "prefix operation",
false: "postfix operation"
},
VariableDeclarator: "variable declaration",
YieldExpression: "yield expression"
};
const toNodeDescription = ({
type,
prefix
}) => type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[String(prefix)] : NodeDescriptions[type];
var _default = toNodeDescription;
exports.default = _default;
//# sourceMappingURL=to-node-description.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["NodeDescriptions","ArrayPattern","AssignmentExpression","AssignmentPattern","ArrowFunctionExpression","ConditionalExpression","CatchClause","ForOfStatement","ForInStatement","ForStatement","FormalParameters","Identifier","ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier","ObjectPattern","ParenthesizedExpression","RestElement","UpdateExpression","true","false","VariableDeclarator","YieldExpression","toNodeDescription","type","prefix","String","_default","exports","default"],"sources":["../../src/parse-error/to-node-description.ts"],"sourcesContent":["const NodeDescriptions = {\n ArrayPattern: \"array destructuring pattern\",\n AssignmentExpression: \"assignment expression\",\n AssignmentPattern: \"assignment expression\",\n ArrowFunctionExpression: \"arrow function expression\",\n ConditionalExpression: \"conditional expression\",\n CatchClause: \"catch clause\",\n ForOfStatement: \"for-of statement\",\n ForInStatement: \"for-in statement\",\n ForStatement: \"for-loop\",\n FormalParameters: \"function parameter list\",\n Identifier: \"identifier\",\n ImportSpecifier: \"import specifier\",\n ImportDefaultSpecifier: \"import default specifier\",\n ImportNamespaceSpecifier: \"import namespace specifier\",\n ObjectPattern: \"object destructuring pattern\",\n ParenthesizedExpression: \"parenthesized expression\",\n RestElement: \"rest element\",\n UpdateExpression: {\n true: \"prefix operation\",\n false: \"postfix operation\",\n },\n VariableDeclarator: \"variable declaration\",\n YieldExpression: \"yield expression\",\n};\n\ntype NodeTypesWithDescriptions = keyof Omit<\n typeof NodeDescriptions,\n \"UpdateExpression\"\n>;\n\ntype NodeWithDescription =\n | {\n type: \"UpdateExpression\";\n prefix: boolean;\n }\n | {\n type: NodeTypesWithDescriptions;\n };\n\n// @ts-expect-error prefix is specified only when type is UpdateExpression\n// eslint-disable-next-line no-confusing-arrow\nconst toNodeDescription = ({ type, prefix }: NodeWithDescription) =>\n type === \"UpdateExpression\"\n ? NodeDescriptions.UpdateExpression[String(prefix) as \"true\" | \"false\"]\n : NodeDescriptions[type];\n\nexport default toNodeDescription;\n"],"mappings":";;;;;;AAAA,MAAMA,gBAAgB,GAAG;EACvBC,YAAY,EAAE,6BAA6B;EAC3CC,oBAAoB,EAAE,uBAAuB;EAC7CC,iBAAiB,EAAE,uBAAuB;EAC1CC,uBAAuB,EAAE,2BAA2B;EACpDC,qBAAqB,EAAE,wBAAwB;EAC/CC,WAAW,EAAE,cAAc;EAC3BC,cAAc,EAAE,kBAAkB;EAClCC,cAAc,EAAE,kBAAkB;EAClCC,YAAY,EAAE,UAAU;EACxBC,gBAAgB,EAAE,yBAAyB;EAC3CC,UAAU,EAAE,YAAY;EACxBC,eAAe,EAAE,kBAAkB;EACnCC,sBAAsB,EAAE,0BAA0B;EAClDC,wBAAwB,EAAE,4BAA4B;EACtDC,aAAa,EAAE,8BAA8B;EAC7CC,uBAAuB,EAAE,0BAA0B;EACnDC,WAAW,EAAE,cAAc;EAC3BC,gBAAgB,EAAE;IAChBC,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,kBAAkB,EAAE,sBAAsB;EAC1CC,eAAe,EAAE;AACnB,CAAC;AAkBD,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAA4B,CAAC,KAC9DD,IAAI,KAAK,kBAAkB,GACvBxB,gBAAgB,CAACkB,gBAAgB,CAACQ,MAAM,CAACD,MAAM,CAAC,CAAqB,GACrEzB,gBAAgB,CAACwB,IAAI,CAAC;AAAC,IAAAG,QAAA,GAEdJ,iBAAiB;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}

36
node_modules/@babel/parser/lib/parser/base.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class BaseParser {
constructor() {
this.sawUnambiguousESM = false;
this.ambiguousScriptDifferentAst = false;
}
hasPlugin(pluginConfig) {
if (typeof pluginConfig === "string") {
return this.plugins.has(pluginConfig);
} else {
const [pluginName, pluginOptions] = pluginConfig;
if (!this.hasPlugin(pluginName)) {
return false;
}
const actualOptions = this.plugins.get(pluginName);
for (const key of Object.keys(pluginOptions)) {
if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {
return false;
}
}
return true;
}
}
getPluginOption(plugin, name) {
var _this$plugins$get;
return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];
}
}
exports.default = BaseParser;
//# sourceMappingURL=base.js.map

1
node_modules/@babel/parser/lib/parser/base.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"names":["BaseParser","constructor","sawUnambiguousESM","ambiguousScriptDifferentAst","hasPlugin","pluginConfig","plugins","has","pluginName","pluginOptions","actualOptions","get","key","Object","keys","getPluginOption","plugin","name","_this$plugins$get","exports","default"],"sources":["../../src/parser/base.ts"],"sourcesContent":["import type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ExpressionScopeHandler from \"../util/expression-scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare inModule: boolean;\n declare scope: ScopeHandler<any>;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set<string>;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugins actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions<PluginName>,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions<PluginName>)?.[\n name\n ];\n }\n}\n"],"mappings":";;;;;;AAae,MAAMA,UAAU,CAAC;EAAAC,YAAA;IAAA,KAa9BC,iBAAiB,GAAY,KAAK;IAAA,KAClCC,2BAA2B,GAAY,KAAK;EAAA;EAa5CC,SAASA,CAACC,YAA0B,EAAW;IAC7C,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;MACpC,OAAO,IAAI,CAACC,OAAO,CAACC,GAAG,CAACF,YAAY,CAAC;IACvC,CAAC,MAAM;MACL,MAAM,CAACG,UAAU,EAAEC,aAAa,CAAC,GAAGJ,YAAY;MAChD,IAAI,CAAC,IAAI,CAACD,SAAS,CAACI,UAAU,CAAC,EAAE;QAC/B,OAAO,KAAK;MACd;MACA,MAAME,aAAa,GAAG,IAAI,CAACJ,OAAO,CAACK,GAAG,CAACH,UAAU,CAAC;MAClD,KAAK,MAAMI,GAAG,IAAIC,MAAM,CAACC,IAAI,CAC3BL,aACF,CAAC,EAAoC;QACnC,IAAI,CAAAC,aAAa,oBAAbA,aAAa,CAAGE,GAAG,CAAC,MAAKH,aAAa,CAACG,GAAG,CAAC,EAAE;UAC/C,OAAO,KAAK;QACd;MACF;MACA,OAAO,IAAI;IACb;EACF;EAEAG,eAAeA,CAGbC,MAAkB,EAAEC,IAAgB,EAAE;IAAA,IAAAC,iBAAA;IACtC,QAAAA,iBAAA,GAAQ,IAAI,CAACZ,OAAO,CAACK,GAAG,CAACK,MAAM,CAAC,qBAAzBE,iBAAA,CACLD,IAAI,CACL;EACH;AACF;AAACE,OAAA,CAAAC,OAAA,GAAApB,UAAA"}

190
node_modules/@babel/parser/lib/parser/comments.js generated vendored Normal file
View File

@ -0,0 +1,190 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.setInnerComments = setInnerComments;
var _base = require("./base");
function setTrailingComments(node, comments) {
if (node.trailingComments === undefined) {
node.trailingComments = comments;
} else {
node.trailingComments.unshift(...comments);
}
}
function setLeadingComments(node, comments) {
if (node.leadingComments === undefined) {
node.leadingComments = comments;
} else {
node.leadingComments.unshift(...comments);
}
}
function setInnerComments(node, comments) {
if (node.innerComments === undefined) {
node.innerComments = comments;
} else {
node.innerComments.unshift(...comments);
}
}
function adjustInnerComments(node, elements, commentWS) {
let lastElement = null;
let i = elements.length;
while (lastElement === null && i > 0) {
lastElement = elements[--i];
}
if (lastElement === null || lastElement.start > commentWS.start) {
setInnerComments(node, commentWS.comments);
} else {
setTrailingComments(lastElement, commentWS.comments);
}
}
class CommentsParser extends _base.default {
addComment(comment) {
if (this.filename) comment.loc.filename = this.filename;
this.state.comments.push(comment);
}
processComment(node) {
const {
commentStack
} = this.state;
const commentStackLength = commentStack.length;
if (commentStackLength === 0) return;
let i = commentStackLength - 1;
const lastCommentWS = commentStack[i];
if (lastCommentWS.start === node.end) {
lastCommentWS.leadingNode = node;
i--;
}
const {
start: nodeStart
} = node;
for (; i >= 0; i--) {
const commentWS = commentStack[i];
const commentEnd = commentWS.end;
if (commentEnd > nodeStart) {
commentWS.containingNode = node;
this.finalizeComment(commentWS);
commentStack.splice(i, 1);
} else {
if (commentEnd === nodeStart) {
commentWS.trailingNode = node;
}
break;
}
}
}
finalizeComment(commentWS) {
const {
comments
} = commentWS;
if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {
if (commentWS.leadingNode !== null) {
setTrailingComments(commentWS.leadingNode, comments);
}
if (commentWS.trailingNode !== null) {
setLeadingComments(commentWS.trailingNode, comments);
}
} else {
const {
containingNode: node,
start: commentStart
} = commentWS;
if (this.input.charCodeAt(commentStart - 1) === 44) {
switch (node.type) {
case "ObjectExpression":
case "ObjectPattern":
case "RecordExpression":
adjustInnerComments(node, node.properties, commentWS);
break;
case "CallExpression":
case "OptionalCallExpression":
adjustInnerComments(node, node.arguments, commentWS);
break;
case "FunctionDeclaration":
case "FunctionExpression":
case "ArrowFunctionExpression":
case "ObjectMethod":
case "ClassMethod":
case "ClassPrivateMethod":
adjustInnerComments(node, node.params, commentWS);
break;
case "ArrayExpression":
case "ArrayPattern":
case "TupleExpression":
adjustInnerComments(node, node.elements, commentWS);
break;
case "ExportNamedDeclaration":
case "ImportDeclaration":
adjustInnerComments(node, node.specifiers, commentWS);
break;
default:
{
setInnerComments(node, comments);
}
}
} else {
setInnerComments(node, comments);
}
}
}
finalizeRemainingComments() {
const {
commentStack
} = this.state;
for (let i = commentStack.length - 1; i >= 0; i--) {
this.finalizeComment(commentStack[i]);
}
this.state.commentStack = [];
}
resetPreviousNodeTrailingComments(node) {
const {
commentStack
} = this.state;
const {
length
} = commentStack;
if (length === 0) return;
const commentWS = commentStack[length - 1];
if (commentWS.leadingNode === node) {
commentWS.leadingNode = null;
}
}
resetPreviousIdentifierLeadingComments(node) {
const {
commentStack
} = this.state;
const {
length
} = commentStack;
if (length === 0) return;
if (commentStack[length - 1].trailingNode === node) {
commentStack[length - 1].trailingNode = null;
} else if (length >= 2 && commentStack[length - 2].trailingNode === node) {
commentStack[length - 2].trailingNode = null;
}
}
takeSurroundingComments(node, start, end) {
const {
commentStack
} = this.state;
const commentStackLength = commentStack.length;
if (commentStackLength === 0) return;
let i = commentStackLength - 1;
for (; i >= 0; i--) {
const commentWS = commentStack[i];
const commentEnd = commentWS.end;
const commentStart = commentWS.start;
if (commentStart === end) {
commentWS.leadingNode = node;
} else if (commentEnd === start) {
commentWS.trailingNode = node;
} else if (commentEnd < start) {
break;
}
}
}
}
exports.default = CommentsParser;
//# sourceMappingURL=comments.js.map

File diff suppressed because one or more lines are too long

1824
node_modules/@babel/parser/lib/parser/expression.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

43
node_modules/@babel/parser/lib/parser/index.js generated vendored Normal file
View File

@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _options = require("../options");
var _statement = require("./statement");
var _scope = require("../util/scope");
class Parser extends _statement.default {
constructor(options, input) {
options = (0, _options.getOptions)(options);
super(options, input);
this.options = options;
this.initializeScopes();
this.plugins = pluginsMap(this.options.plugins);
this.filename = options.sourceFilename;
}
getScopeHandler() {
return _scope.default;
}
parse() {
this.enterInitialScopes();
const file = this.startNode();
const program = this.startNode();
this.nextToken();
file.errors = null;
this.parseTopLevel(file, program);
file.errors = this.state.errors;
return file;
}
}
exports.default = Parser;
function pluginsMap(plugins) {
const pluginMap = new Map();
for (const plugin of plugins) {
const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
if (!pluginMap.has(name)) pluginMap.set(name, options || {});
}
return pluginMap;
}
//# sourceMappingURL=index.js.map

1
node_modules/@babel/parser/lib/parser/index.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"names":["_options","require","_statement","_scope","Parser","StatementParser","constructor","options","input","getOptions","initializeScopes","plugins","pluginsMap","filename","sourceFilename","getScopeHandler","ScopeHandler","parse","enterInitialScopes","file","startNode","program","nextToken","errors","parseTopLevel","state","exports","default","pluginMap","Map","plugin","name","Array","isArray","has","set"],"sources":["../../src/parser/index.ts"],"sourcesContent":["import type { Options } from \"../options\";\nimport type * as N from \"../types\";\nimport type { PluginList } from \"../plugin-utils\";\nimport { getOptions } from \"../options\";\nimport StatementParser from \"./statement\";\nimport ScopeHandler from \"../util/scope\";\n\nexport type PluginsMap = Map<\n string,\n {\n [x: string]: any;\n }\n>;\n\nexport default class Parser extends StatementParser {\n // Forward-declaration so typescript plugin can override jsx plugin\n // todo(flow->ts) - this probably can be removed\n // abstract jsxParseOpeningElementAfterName(\n // node: N.JSXOpeningElement,\n // ): N.JSXOpeningElement;\n\n constructor(options: Options | undefined | null, input: string) {\n options = getOptions(options);\n super(options, input);\n\n this.options = options;\n this.initializeScopes();\n this.plugins = pluginsMap(this.options.plugins);\n this.filename = options.sourceFilename;\n }\n\n // This can be overwritten, for example, by the TypeScript plugin.\n getScopeHandler(): {\n new (...args: any): ScopeHandler;\n } {\n return ScopeHandler;\n }\n\n parse(): N.File {\n this.enterInitialScopes();\n const file = this.startNode() as N.File;\n const program = this.startNode() as N.Program;\n this.nextToken();\n file.errors = null;\n this.parseTopLevel(file, program);\n file.errors = this.state.errors;\n return file;\n }\n}\n\nfunction pluginsMap(plugins: PluginList): PluginsMap {\n const pluginMap: PluginsMap = new Map();\n for (const plugin of plugins) {\n const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];\n if (!pluginMap.has(name)) pluginMap.set(name, options || {});\n }\n return pluginMap;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AASe,MAAMG,MAAM,SAASC,kBAAe,CAAC;EAOlDC,WAAWA,CAACC,OAAmC,EAAEC,KAAa,EAAE;IAC9DD,OAAO,GAAG,IAAAE,mBAAU,EAACF,OAAO,CAAC;IAC7B,KAAK,CAACA,OAAO,EAAEC,KAAK,CAAC;IAErB,IAAI,CAACD,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACG,gBAAgB,CAAC,CAAC;IACvB,IAAI,CAACC,OAAO,GAAGC,UAAU,CAAC,IAAI,CAACL,OAAO,CAACI,OAAO,CAAC;IAC/C,IAAI,CAACE,QAAQ,GAAGN,OAAO,CAACO,cAAc;EACxC;EAGAC,eAAeA,CAAA,EAEb;IACA,OAAOC,cAAY;EACrB;EAEAC,KAAKA,CAAA,EAAW;IACd,IAAI,CAACC,kBAAkB,CAAC,CAAC;IACzB,MAAMC,IAAI,GAAG,IAAI,CAACC,SAAS,CAAC,CAAW;IACvC,MAAMC,OAAO,GAAG,IAAI,CAACD,SAAS,CAAC,CAAc;IAC7C,IAAI,CAACE,SAAS,CAAC,CAAC;IAChBH,IAAI,CAACI,MAAM,GAAG,IAAI;IAClB,IAAI,CAACC,aAAa,CAACL,IAAI,EAAEE,OAAO,CAAC;IACjCF,IAAI,CAACI,MAAM,GAAG,IAAI,CAACE,KAAK,CAACF,MAAM;IAC/B,OAAOJ,IAAI;EACb;AACF;AAACO,OAAA,CAAAC,OAAA,GAAAvB,MAAA;AAED,SAASQ,UAAUA,CAACD,OAAmB,EAAc;EACnD,MAAMiB,SAAqB,GAAG,IAAIC,GAAG,CAAC,CAAC;EACvC,KAAK,MAAMC,MAAM,IAAInB,OAAO,EAAE;IAC5B,MAAM,CAACoB,IAAI,EAAExB,OAAO,CAAC,GAAGyB,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,EAAE,CAAC,CAAC,CAAC;IACrE,IAAI,CAACF,SAAS,CAACM,GAAG,CAACH,IAAI,CAAC,EAAEH,SAAS,CAACO,GAAG,CAACJ,IAAI,EAAExB,OAAO,IAAI,CAAC,CAAC,CAAC;EAC9D;EACA,OAAOqB,SAAS;AAClB"}

421
node_modules/@babel/parser/lib/parser/lval.js generated vendored Normal file
View File

@ -0,0 +1,421 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ParseBindingListFlags = void 0;
var _types = require("../tokenizer/types");
var _identifier = require("../util/identifier");
var _node = require("./node");
var _scopeflags = require("../util/scopeflags");
var _parseError = require("../parse-error");
const getOwn = (object, key) => Object.hasOwnProperty.call(object, key) && object[key];
const unwrapParenthesizedExpression = node => {
return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
};
var ParseBindingListFlags = {
ALLOW_EMPTY: 1,
IS_FUNCTION_PARAMS: 2,
IS_CONSTRUCTOR_PARAMS: 4
};
exports.ParseBindingListFlags = ParseBindingListFlags;
class LValParser extends _node.NodeUtils {
toAssignable(node, isLHS = false) {
var _node$extra, _node$extra3;
let parenthesized = undefined;
if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) {
parenthesized = unwrapParenthesizedExpression(node);
if (isLHS) {
if (parenthesized.type === "Identifier") {
this.expressionScope.recordArrowParameterBindingError(_parseError.Errors.InvalidParenthesizedAssignment, {
at: node
});
} else if (parenthesized.type !== "MemberExpression") {
this.raise(_parseError.Errors.InvalidParenthesizedAssignment, {
at: node
});
}
} else {
this.raise(_parseError.Errors.InvalidParenthesizedAssignment, {
at: node
});
}
}
switch (node.type) {
case "Identifier":
case "ObjectPattern":
case "ArrayPattern":
case "AssignmentPattern":
case "RestElement":
break;
case "ObjectExpression":
node.type = "ObjectPattern";
for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
var _node$extra2;
const prop = node.properties[i];
const isLast = i === last;
this.toAssignableObjectExpressionProp(prop, isLast, isLHS);
if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: node.extra.trailingCommaLoc
});
}
}
break;
case "ObjectProperty":
{
const {
key,
value
} = node;
if (this.isPrivateName(key)) {
this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
}
this.toAssignable(value, isLHS);
break;
}
case "SpreadElement":
{
throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller.");
}
case "ArrayExpression":
node.type = "ArrayPattern";
this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS);
break;
case "AssignmentExpression":
if (node.operator !== "=") {
this.raise(_parseError.Errors.MissingEqInAssignment, {
at: node.left.loc.end
});
}
node.type = "AssignmentPattern";
delete node.operator;
this.toAssignable(node.left, isLHS);
break;
case "ParenthesizedExpression":
this.toAssignable(parenthesized, isLHS);
break;
default:
}
}
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
if (prop.type === "ObjectMethod") {
this.raise(prop.kind === "get" || prop.kind === "set" ? _parseError.Errors.PatternHasAccessor : _parseError.Errors.PatternHasMethod, {
at: prop.key
});
} else if (prop.type === "SpreadElement") {
prop.type = "RestElement";
const arg = prop.argument;
this.checkToRestConversion(arg, false);
this.toAssignable(arg, isLHS);
if (!isLast) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: prop
});
}
} else {
this.toAssignable(prop, isLHS);
}
}
toAssignableList(exprList, trailingCommaLoc, isLHS) {
const end = exprList.length - 1;
for (let i = 0; i <= end; i++) {
const elt = exprList[i];
if (!elt) continue;
if (elt.type === "SpreadElement") {
elt.type = "RestElement";
const arg = elt.argument;
this.checkToRestConversion(arg, true);
this.toAssignable(arg, isLHS);
} else {
this.toAssignable(elt, isLHS);
}
if (elt.type === "RestElement") {
if (i < end) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: elt
});
} else if (trailingCommaLoc) {
this.raise(_parseError.Errors.RestTrailingComma, {
at: trailingCommaLoc
});
}
}
}
}
isAssignable(node, isBinding) {
switch (node.type) {
case "Identifier":
case "ObjectPattern":
case "ArrayPattern":
case "AssignmentPattern":
case "RestElement":
return true;
case "ObjectExpression":
{
const last = node.properties.length - 1;
return node.properties.every((prop, i) => {
return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop);
});
}
case "ObjectProperty":
return this.isAssignable(node.value);
case "SpreadElement":
return this.isAssignable(node.argument);
case "ArrayExpression":
return node.elements.every(element => element === null || this.isAssignable(element));
case "AssignmentExpression":
return node.operator === "=";
case "ParenthesizedExpression":
return this.isAssignable(node.expression);
case "MemberExpression":
case "OptionalMemberExpression":
return !isBinding;
default:
return false;
}
}
toReferencedList(exprList, isParenthesizedExpr) {
return exprList;
}
toReferencedListDeep(exprList, isParenthesizedExpr) {
this.toReferencedList(exprList, isParenthesizedExpr);
for (const expr of exprList) {
if ((expr == null ? void 0 : expr.type) === "ArrayExpression") {
this.toReferencedListDeep(expr.elements);
}
}
}
parseSpread(refExpressionErrors) {
const node = this.startNode();
this.next();
node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined);
return this.finishNode(node, "SpreadElement");
}
parseRestBinding() {
const node = this.startNode();
this.next();
node.argument = this.parseBindingAtom();
return this.finishNode(node, "RestElement");
}
parseBindingAtom() {
switch (this.state.type) {
case 0:
{
const node = this.startNode();
this.next();
node.elements = this.parseBindingList(3, 93, ParseBindingListFlags.ALLOW_EMPTY);
return this.finishNode(node, "ArrayPattern");
}
case 5:
return this.parseObjectLike(8, true);
}
return this.parseIdentifier();
}
parseBindingList(close, closeCharCode, flags) {
const allowEmpty = flags & ParseBindingListFlags.ALLOW_EMPTY;
const elts = [];
let first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(12);
}
if (allowEmpty && this.match(12)) {
elts.push(null);
} else if (this.eat(close)) {
break;
} else if (this.match(21)) {
elts.push(this.parseAssignableListItemTypes(this.parseRestBinding(), flags));
if (!this.checkCommaAfterRest(closeCharCode)) {
this.expect(close);
break;
}
} else {
const decorators = [];
if (this.match(26) && this.hasPlugin("decorators")) {
this.raise(_parseError.Errors.UnsupportedParameterDecorator, {
at: this.state.startLoc
});
}
while (this.match(26)) {
decorators.push(this.parseDecorator());
}
elts.push(this.parseAssignableListItem(flags, decorators));
}
}
return elts;
}
parseBindingRestProperty(prop) {
this.next();
prop.argument = this.parseIdentifier();
this.checkCommaAfterRest(125);
return this.finishNode(prop, "RestElement");
}
parseBindingProperty() {
const prop = this.startNode();
const {
type,
startLoc
} = this.state;
if (type === 21) {
return this.parseBindingRestProperty(prop);
} else if (type === 136) {
this.expectPlugin("destructuringPrivate", startLoc);
this.classScope.usePrivateName(this.state.value, startLoc);
prop.key = this.parsePrivateName();
} else {
this.parsePropertyName(prop);
}
prop.method = false;
return this.parseObjPropValue(prop, startLoc, false, false, true, false);
}
parseAssignableListItem(flags, decorators) {
const left = this.parseMaybeDefault();
this.parseAssignableListItemTypes(left, flags);
const elt = this.parseMaybeDefault(left.loc.start, left);
if (decorators.length) {
left.decorators = decorators;
}
return elt;
}
parseAssignableListItemTypes(param, flags) {
return param;
}
parseMaybeDefault(startLoc, left) {
var _startLoc, _left;
(_startLoc = startLoc) != null ? _startLoc : startLoc = this.state.startLoc;
left = (_left = left) != null ? _left : this.parseBindingAtom();
if (!this.eat(29)) return left;
const node = this.startNodeAt(startLoc);
node.left = left;
node.right = this.parseMaybeAssignAllowIn();
return this.finishNode(node, "AssignmentPattern");
}
isValidLVal(type, isUnparenthesizedInAssign, binding) {
return getOwn({
AssignmentPattern: "left",
RestElement: "argument",
ObjectProperty: "value",
ParenthesizedExpression: "expression",
ArrayPattern: "elements",
ObjectPattern: "properties"
}, type);
}
checkLVal(expression, {
in: ancestor,
binding = _scopeflags.BindingFlag.TYPE_NONE,
checkClashes = false,
strictModeChanged = false,
hasParenthesizedAncestor = false
}) {
var _expression$extra;
const type = expression.type;
if (this.isObjectMethod(expression)) return;
if (type === "MemberExpression") {
if (binding !== _scopeflags.BindingFlag.TYPE_NONE) {
this.raise(_parseError.Errors.InvalidPropertyBindingPattern, {
at: expression
});
}
return;
}
if (type === "Identifier") {
this.checkIdentifier(expression, binding, strictModeChanged);
const {
name
} = expression;
if (checkClashes) {
if (checkClashes.has(name)) {
this.raise(_parseError.Errors.ParamDupe, {
at: expression
});
} else {
checkClashes.add(name);
}
}
return;
}
const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding);
if (validity === true) return;
if (validity === false) {
const ParseErrorClass = binding === _scopeflags.BindingFlag.TYPE_NONE ? _parseError.Errors.InvalidLhs : _parseError.Errors.InvalidLhsBinding;
this.raise(ParseErrorClass, {
at: expression,
ancestor
});
return;
}
const [key, isParenthesizedExpression] = Array.isArray(validity) ? validity : [validity, type === "ParenthesizedExpression"];
const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" || type === "ParenthesizedExpression" ? {
type
} : ancestor;
for (const child of [].concat(expression[key])) {
if (child) {
this.checkLVal(child, {
in: nextAncestor,
binding,
checkClashes,
strictModeChanged,
hasParenthesizedAncestor: isParenthesizedExpression
});
}
}
}
checkIdentifier(at, bindingType, strictModeChanged = false) {
if (this.state.strict && (strictModeChanged ? (0, _identifier.isStrictBindReservedWord)(at.name, this.inModule) : (0, _identifier.isStrictBindOnlyReservedWord)(at.name))) {
if (bindingType === _scopeflags.BindingFlag.TYPE_NONE) {
this.raise(_parseError.Errors.StrictEvalArguments, {
at,
referenceName: at.name
});
} else {
this.raise(_parseError.Errors.StrictEvalArgumentsBinding, {
at,
bindingName: at.name
});
}
}
if (bindingType & _scopeflags.BindingFlag.FLAG_NO_LET_IN_LEXICAL && at.name === "let") {
this.raise(_parseError.Errors.LetInLexicalBinding, {
at
});
}
if (!(bindingType & _scopeflags.BindingFlag.TYPE_NONE)) {
this.declareNameFromIdentifier(at, bindingType);
}
}
declareNameFromIdentifier(identifier, binding) {
this.scope.declareName(identifier.name, binding, identifier.loc.start);
}
checkToRestConversion(node, allowPattern) {
switch (node.type) {
case "ParenthesizedExpression":
this.checkToRestConversion(node.expression, allowPattern);
break;
case "Identifier":
case "MemberExpression":
break;
case "ArrayExpression":
case "ObjectExpression":
if (allowPattern) break;
default:
this.raise(_parseError.Errors.InvalidRestAssignmentPattern, {
at: node
});
}
}
checkCommaAfterRest(close) {
if (!this.match(12)) {
return false;
}
this.raise(this.lookaheadCharCode() === close ? _parseError.Errors.RestTrailingComma : _parseError.Errors.ElementAfterRest, {
at: this.state.startLoc
});
return true;
}
}
exports.default = LValParser;
//# sourceMappingURL=lval.js.map

1
node_modules/@babel/parser/lib/parser/lval.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

127
node_modules/@babel/parser/lib/parser/node.js generated vendored Normal file
View File

@ -0,0 +1,127 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NodeUtils = void 0;
exports.cloneIdentifier = cloneIdentifier;
exports.cloneStringLiteral = cloneStringLiteral;
var _util = require("./util");
var _location = require("../util/location");
class Node {
constructor(parser, pos, loc) {
this.type = "";
this.start = pos;
this.end = 0;
this.loc = new _location.SourceLocation(loc);
if (parser != null && parser.options.ranges) this.range = [pos, 0];
if (parser != null && parser.filename) this.loc.filename = parser.filename;
}
}
const NodePrototype = Node.prototype;
{
NodePrototype.__clone = function () {
const newNode = new Node(undefined, this.start, this.loc.start);
const keys = Object.keys(this);
for (let i = 0, length = keys.length; i < length; i++) {
const key = keys[i];
if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
newNode[key] = this[key];
}
}
return newNode;
};
}
function clonePlaceholder(node) {
return cloneIdentifier(node);
}
function cloneIdentifier(node) {
const {
type,
start,
end,
loc,
range,
extra,
name
} = node;
const cloned = Object.create(NodePrototype);
cloned.type = type;
cloned.start = start;
cloned.end = end;
cloned.loc = loc;
cloned.range = range;
cloned.extra = extra;
cloned.name = name;
if (type === "Placeholder") {
cloned.expectedNode = node.expectedNode;
}
return cloned;
}
function cloneStringLiteral(node) {
const {
type,
start,
end,
loc,
range,
extra
} = node;
if (type === "Placeholder") {
return clonePlaceholder(node);
}
const cloned = Object.create(NodePrototype);
cloned.type = type;
cloned.start = start;
cloned.end = end;
cloned.loc = loc;
cloned.range = range;
if (node.raw !== undefined) {
cloned.raw = node.raw;
} else {
cloned.extra = extra;
}
cloned.value = node.value;
return cloned;
}
class NodeUtils extends _util.default {
startNode() {
return new Node(this, this.state.start, this.state.startLoc);
}
startNodeAt(loc) {
return new Node(this, loc.index, loc);
}
startNodeAtNode(type) {
return this.startNodeAt(type.loc.start);
}
finishNode(node, type) {
return this.finishNodeAt(node, type, this.state.lastTokEndLoc);
}
finishNodeAt(node, type, endLoc) {
if (process.env.NODE_ENV !== "production" && node.end > 0) {
throw new Error("Do not call finishNode*() twice on the same node." + " Instead use resetEndLocation() or change type directly.");
}
node.type = type;
node.end = endLoc.index;
node.loc.end = endLoc;
if (this.options.ranges) node.range[1] = endLoc.index;
if (this.options.attachComment) this.processComment(node);
return node;
}
resetStartLocation(node, startLoc) {
node.start = startLoc.index;
node.loc.start = startLoc;
if (this.options.ranges) node.range[0] = startLoc.index;
}
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
node.end = endLoc.index;
node.loc.end = endLoc;
if (this.options.ranges) node.range[1] = endLoc.index;
}
resetStartLocationFromNode(node, locationNode) {
this.resetStartLocation(node, locationNode.loc.start);
}
}
exports.NodeUtils = NodeUtils;
//# sourceMappingURL=node.js.map

1
node_modules/@babel/parser/lib/parser/node.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2033
node_modules/@babel/parser/lib/parser/statement.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

238
node_modules/@babel/parser/lib/parser/util.js generated vendored Normal file
View File

@ -0,0 +1,238 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ExpressionErrors = void 0;
var _types = require("../tokenizer/types");
var _tokenizer = require("../tokenizer");
var _whitespace = require("../util/whitespace");
var _identifier = require("../util/identifier");
var _classScope = require("../util/class-scope");
var _expressionScope = require("../util/expression-scope");
var _scopeflags = require("../util/scopeflags");
var _productionParameter = require("../util/production-parameter");
var _parseError = require("../parse-error");
class UtilParser extends _tokenizer.default {
addExtra(node, key, value, enumerable = true) {
if (!node) return;
const extra = node.extra = node.extra || {};
if (enumerable) {
extra[key] = value;
} else {
Object.defineProperty(extra, key, {
enumerable,
value
});
}
}
isContextual(token) {
return this.state.type === token && !this.state.containsEsc;
}
isUnparsedContextual(nameStart, name) {
const nameEnd = nameStart + name.length;
if (this.input.slice(nameStart, nameEnd) === name) {
const nextCh = this.input.charCodeAt(nameEnd);
return !((0, _identifier.isIdentifierChar)(nextCh) || (nextCh & 0xfc00) === 0xd800);
}
return false;
}
isLookaheadContextual(name) {
const next = this.nextTokenStart();
return this.isUnparsedContextual(next, name);
}
eatContextual(token) {
if (this.isContextual(token)) {
this.next();
return true;
}
return false;
}
expectContextual(token, toParseError) {
if (!this.eatContextual(token)) {
if (toParseError != null) {
throw this.raise(toParseError, {
at: this.state.startLoc
});
}
this.unexpected(null, token);
}
}
canInsertSemicolon() {
return this.match(137) || this.match(8) || this.hasPrecedingLineBreak();
}
hasPrecedingLineBreak() {
return _whitespace.lineBreak.test(this.input.slice(this.state.lastTokEndLoc.index, this.state.start));
}
hasFollowingLineBreak() {
_whitespace.skipWhiteSpaceToLineBreak.lastIndex = this.state.end;
return _whitespace.skipWhiteSpaceToLineBreak.test(this.input);
}
isLineTerminator() {
return this.eat(13) || this.canInsertSemicolon();
}
semicolon(allowAsi = true) {
if (allowAsi ? this.isLineTerminator() : this.eat(13)) return;
this.raise(_parseError.Errors.MissingSemicolon, {
at: this.state.lastTokEndLoc
});
}
expect(type, loc) {
this.eat(type) || this.unexpected(loc, type);
}
tryParse(fn, oldState = this.state.clone()) {
const abortSignal = {
node: null
};
try {
const node = fn((node = null) => {
abortSignal.node = node;
throw abortSignal;
});
if (this.state.errors.length > oldState.errors.length) {
const failState = this.state;
this.state = oldState;
this.state.tokensLength = failState.tokensLength;
return {
node,
error: failState.errors[oldState.errors.length],
thrown: false,
aborted: false,
failState
};
}
return {
node,
error: null,
thrown: false,
aborted: false,
failState: null
};
} catch (error) {
const failState = this.state;
this.state = oldState;
if (error instanceof SyntaxError) {
return {
node: null,
error,
thrown: true,
aborted: false,
failState
};
}
if (error === abortSignal) {
return {
node: abortSignal.node,
error: null,
thrown: false,
aborted: true,
failState
};
}
throw error;
}
}
checkExpressionErrors(refExpressionErrors, andThrow) {
if (!refExpressionErrors) return false;
const {
shorthandAssignLoc,
doubleProtoLoc,
privateKeyLoc,
optionalParametersLoc
} = refExpressionErrors;
const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc;
if (!andThrow) {
return hasErrors;
}
if (shorthandAssignLoc != null) {
this.raise(_parseError.Errors.InvalidCoverInitializedName, {
at: shorthandAssignLoc
});
}
if (doubleProtoLoc != null) {
this.raise(_parseError.Errors.DuplicateProto, {
at: doubleProtoLoc
});
}
if (privateKeyLoc != null) {
this.raise(_parseError.Errors.UnexpectedPrivateField, {
at: privateKeyLoc
});
}
if (optionalParametersLoc != null) {
this.unexpected(optionalParametersLoc);
}
}
isLiteralPropertyName() {
return (0, _types.tokenIsLiteralPropertyName)(this.state.type);
}
isPrivateName(node) {
return node.type === "PrivateName";
}
getPrivateNameSV(node) {
return node.id.name;
}
hasPropertyAsPrivateName(node) {
return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property);
}
isObjectProperty(node) {
return node.type === "ObjectProperty";
}
isObjectMethod(node) {
return node.type === "ObjectMethod";
}
initializeScopes(inModule = this.options.sourceType === "module") {
const oldLabels = this.state.labels;
this.state.labels = [];
const oldExportedIdentifiers = this.exportedIdentifiers;
this.exportedIdentifiers = new Set();
const oldInModule = this.inModule;
this.inModule = inModule;
const oldScope = this.scope;
const ScopeHandler = this.getScopeHandler();
this.scope = new ScopeHandler(this, inModule);
const oldProdParam = this.prodParam;
this.prodParam = new _productionParameter.default();
const oldClassScope = this.classScope;
this.classScope = new _classScope.default(this);
const oldExpressionScope = this.expressionScope;
this.expressionScope = new _expressionScope.default(this);
return () => {
this.state.labels = oldLabels;
this.exportedIdentifiers = oldExportedIdentifiers;
this.inModule = oldInModule;
this.scope = oldScope;
this.prodParam = oldProdParam;
this.classScope = oldClassScope;
this.expressionScope = oldExpressionScope;
};
}
enterInitialScopes() {
let paramFlags = _productionParameter.PARAM;
if (this.inModule) {
paramFlags |= _productionParameter.PARAM_AWAIT;
}
this.scope.enter(_scopeflags.ScopeFlag.PROGRAM);
this.prodParam.enter(paramFlags);
}
checkDestructuringPrivate(refExpressionErrors) {
const {
privateKeyLoc
} = refExpressionErrors;
if (privateKeyLoc !== null) {
this.expectPlugin("destructuringPrivate", privateKeyLoc);
}
}
}
exports.default = UtilParser;
class ExpressionErrors {
constructor() {
this.shorthandAssignLoc = null;
this.doubleProtoLoc = null;
this.privateKeyLoc = null;
this.optionalParametersLoc = null;
}
}
exports.ExpressionErrors = ExpressionErrors;
//# sourceMappingURL=util.js.map

1
node_modules/@babel/parser/lib/parser/util.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

136
node_modules/@babel/parser/lib/plugin-utils.js generated vendored Normal file
View File

@ -0,0 +1,136 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPluginOption = getPluginOption;
exports.hasPlugin = hasPlugin;
exports.mixinPlugins = exports.mixinPluginNames = void 0;
exports.validatePlugins = validatePlugins;
var _estree = require("./plugins/estree");
var _flow = require("./plugins/flow");
var _jsx = require("./plugins/jsx");
var _typescript = require("./plugins/typescript");
var _placeholders = require("./plugins/placeholders");
var _v8intrinsic = require("./plugins/v8intrinsic");
function hasPlugin(plugins, expectedConfig) {
const [expectedName, expectedOptions] = typeof expectedConfig === "string" ? [expectedConfig, {}] : expectedConfig;
const expectedKeys = Object.keys(expectedOptions);
const expectedOptionsIsEmpty = expectedKeys.length === 0;
return plugins.some(p => {
if (typeof p === "string") {
return expectedOptionsIsEmpty && p === expectedName;
} else {
const [pluginName, pluginOptions] = p;
if (pluginName !== expectedName) {
return false;
}
for (const key of expectedKeys) {
if (pluginOptions[key] !== expectedOptions[key]) {
return false;
}
}
return true;
}
});
}
function getPluginOption(plugins, name, option) {
const plugin = plugins.find(plugin => {
if (Array.isArray(plugin)) {
return plugin[0] === name;
} else {
return plugin === name;
}
});
if (plugin && Array.isArray(plugin) && plugin.length > 1) {
return plugin[1][option];
}
return null;
}
const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"];
const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"];
const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"];
function validatePlugins(plugins) {
if (hasPlugin(plugins, "decorators")) {
if (hasPlugin(plugins, "decorators-legacy")) {
throw new Error("Cannot use the decorators and decorators-legacy plugin together");
}
const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") {
throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");
}
const allowCallParenthesized = getPluginOption(plugins, "decorators", "allowCallParenthesized");
if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") {
throw new Error("'allowCallParenthesized' must be a boolean.");
}
}
if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
throw new Error("Cannot combine flow and typescript plugins.");
}
if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
}
if (hasPlugin(plugins, "pipelineOperator")) {
const proposal = getPluginOption(plugins, "pipelineOperator", "proposal");
if (!PIPELINE_PROPOSALS.includes(proposal)) {
const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", ");
throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`);
}
const tupleSyntaxIsHash = hasPlugin(plugins, ["recordAndTuple", {
syntaxType: "hash"
}]);
if (proposal === "hack") {
if (hasPlugin(plugins, "placeholders")) {
throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");
}
if (hasPlugin(plugins, "v8intrinsic")) {
throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
}
const topicToken = getPluginOption(plugins, "pipelineOperator", "topicToken");
if (!TOPIC_TOKENS.includes(topicToken)) {
const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", ");
throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`);
}
if (topicToken === "#" && tupleSyntaxIsHash) {
throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "hack", topicToken: "#" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
}
} else if (proposal === "smart" && tupleSyntaxIsHash) {
throw new Error('Plugin conflict between `["pipelineOperator", { proposal: "smart" }]` and `["recordAndtuple", { syntaxType: "hash"}]`.');
}
}
if (hasPlugin(plugins, "moduleAttributes")) {
{
if (hasPlugin(plugins, "importAssertions") || hasPlugin(plugins, "importAttributes")) {
throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");
}
const moduleAttributesVersionPluginOption = getPluginOption(plugins, "moduleAttributes", "version");
if (moduleAttributesVersionPluginOption !== "may-2020") {
throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'.");
}
}
}
if (hasPlugin(plugins, "importAssertions") && hasPlugin(plugins, "importAttributes")) {
throw new Error("Cannot combine importAssertions and importAttributes plugins.");
}
if (hasPlugin(plugins, "recordAndTuple") && getPluginOption(plugins, "recordAndTuple", "syntaxType") != null && !RECORD_AND_TUPLE_SYNTAX_TYPES.includes(getPluginOption(plugins, "recordAndTuple", "syntaxType"))) {
throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", "));
}
if (hasPlugin(plugins, "asyncDoExpressions") && !hasPlugin(plugins, "doExpressions")) {
const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");
error.missingPlugins = "doExpressions";
throw error;
}
}
const mixinPlugins = {
estree: _estree.default,
jsx: _jsx.default,
flow: _flow.default,
typescript: _typescript.default,
v8intrinsic: _v8intrinsic.default,
placeholders: _placeholders.default
};
exports.mixinPlugins = mixinPlugins;
const mixinPluginNames = Object.keys(mixinPlugins);
exports.mixinPluginNames = mixinPluginNames;
//# sourceMappingURL=plugin-utils.js.map

1
node_modules/@babel/parser/lib/plugin-utils.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

340
node_modules/@babel/parser/lib/plugins/estree.js generated vendored Normal file
View File

@ -0,0 +1,340 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _parseError = require("../parse-error");
const {
defineProperty
} = Object;
const toUnenumerable = (object, key) => defineProperty(object, key, {
enumerable: false,
value: object[key]
});
function toESTreeLocation(node) {
node.loc.start && toUnenumerable(node.loc.start, "index");
node.loc.end && toUnenumerable(node.loc.end, "index");
return node;
}
var _default = superClass => class ESTreeParserMixin extends superClass {
parse() {
const file = toESTreeLocation(super.parse());
if (this.options.tokens) {
file.tokens = file.tokens.map(toESTreeLocation);
}
return file;
}
parseRegExpLiteral({
pattern,
flags
}) {
let regex = null;
try {
regex = new RegExp(pattern, flags);
} catch (e) {}
const node = this.estreeParseLiteral(regex);
node.regex = {
pattern,
flags
};
return node;
}
parseBigIntLiteral(value) {
let bigInt;
try {
bigInt = BigInt(value);
} catch (_unused) {
bigInt = null;
}
const node = this.estreeParseLiteral(bigInt);
node.bigint = String(node.value || value);
return node;
}
parseDecimalLiteral(value) {
const decimal = null;
const node = this.estreeParseLiteral(decimal);
node.decimal = String(node.value || value);
return node;
}
estreeParseLiteral(value) {
return this.parseLiteral(value, "Literal");
}
parseStringLiteral(value) {
return this.estreeParseLiteral(value);
}
parseNumericLiteral(value) {
return this.estreeParseLiteral(value);
}
parseNullLiteral() {
return this.estreeParseLiteral(null);
}
parseBooleanLiteral(value) {
return this.estreeParseLiteral(value);
}
directiveToStmt(directive) {
const expression = directive.value;
delete directive.value;
expression.type = "Literal";
expression.raw = expression.extra.raw;
expression.value = expression.extra.expressionValue;
const stmt = directive;
stmt.type = "ExpressionStatement";
stmt.expression = expression;
stmt.directive = expression.extra.rawValue;
delete expression.extra;
return stmt;
}
initFunction(node, isAsync) {
super.initFunction(node, isAsync);
node.expression = false;
}
checkDeclaration(node) {
if (node != null && this.isObjectProperty(node)) {
this.checkDeclaration(node.value);
} else {
super.checkDeclaration(node);
}
}
getObjectOrClassMethodParams(method) {
return method.value.params;
}
isValidDirective(stmt) {
var _stmt$expression$extr;
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized);
}
parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) {
super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse);
const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
node.body = directiveStatements.concat(node.body);
delete node.directives;
}
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
if (method.typeParameters) {
method.value.typeParameters = method.typeParameters;
delete method.typeParameters;
}
classBody.body.push(method);
}
parsePrivateName() {
const node = super.parsePrivateName();
{
if (!this.getPluginOption("estree", "classFeatures")) {
return node;
}
}
return this.convertPrivateNameToPrivateIdentifier(node);
}
convertPrivateNameToPrivateIdentifier(node) {
const name = super.getPrivateNameSV(node);
node = node;
delete node.id;
node.name = name;
node.type = "PrivateIdentifier";
return node;
}
isPrivateName(node) {
{
if (!this.getPluginOption("estree", "classFeatures")) {
return super.isPrivateName(node);
}
}
return node.type === "PrivateIdentifier";
}
getPrivateNameSV(node) {
{
if (!this.getPluginOption("estree", "classFeatures")) {
return super.getPrivateNameSV(node);
}
}
return node.name;
}
parseLiteral(value, type) {
const node = super.parseLiteral(value, type);
node.raw = node.extra.raw;
delete node.extra;
return node;
}
parseFunctionBody(node, allowExpression, isMethod = false) {
super.parseFunctionBody(node, allowExpression, isMethod);
node.expression = node.body.type !== "BlockStatement";
}
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
let funcNode = this.startNode();
funcNode.kind = node.kind;
funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
funcNode.type = "FunctionExpression";
delete funcNode.kind;
node.value = funcNode;
if (type === "ClassPrivateMethod") {
node.computed = false;
}
return this.finishNode(node, "MethodDefinition");
}
parseClassProperty(...args) {
const propertyNode = super.parseClassProperty(...args);
{
if (!this.getPluginOption("estree", "classFeatures")) {
return propertyNode;
}
}
propertyNode.type = "PropertyDefinition";
return propertyNode;
}
parseClassPrivateProperty(...args) {
const propertyNode = super.parseClassPrivateProperty(...args);
{
if (!this.getPluginOption("estree", "classFeatures")) {
return propertyNode;
}
}
propertyNode.type = "PropertyDefinition";
propertyNode.computed = false;
return propertyNode;
}
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
if (node) {
node.type = "Property";
if (node.kind === "method") {
node.kind = "init";
}
node.shorthand = false;
}
return node;
}
parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) {
const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors);
if (node) {
node.kind = "init";
node.type = "Property";
}
return node;
}
isValidLVal(type, isUnparenthesizedInAssign, binding) {
return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding);
}
isAssignable(node, isBinding) {
if (node != null && this.isObjectProperty(node)) {
return this.isAssignable(node.value, isBinding);
}
return super.isAssignable(node, isBinding);
}
toAssignable(node, isLHS = false) {
if (node != null && this.isObjectProperty(node)) {
const {
key,
value
} = node;
if (this.isPrivateName(key)) {
this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start);
}
this.toAssignable(value, isLHS);
} else {
super.toAssignable(node, isLHS);
}
}
toAssignableObjectExpressionProp(prop, isLast, isLHS) {
if (prop.kind === "get" || prop.kind === "set") {
this.raise(_parseError.Errors.PatternHasAccessor, {
at: prop.key
});
} else if (prop.method) {
this.raise(_parseError.Errors.PatternHasMethod, {
at: prop.key
});
} else {
super.toAssignableObjectExpressionProp(prop, isLast, isLHS);
}
}
finishCallExpression(unfinished, optional) {
const node = super.finishCallExpression(unfinished, optional);
if (node.callee.type === "Import") {
node.type = "ImportExpression";
node.source = node.arguments[0];
if (this.hasPlugin("importAttributes") || this.hasPlugin("importAssertions")) {
var _node$arguments$;
node.attributes = (_node$arguments$ = node.arguments[1]) != null ? _node$arguments$ : null;
}
delete node.arguments;
delete node.callee;
}
return node;
}
toReferencedArguments(node) {
if (node.type === "ImportExpression") {
return;
}
super.toReferencedArguments(node);
}
parseExport(unfinished, decorators) {
const exportStartLoc = this.state.lastTokStartLoc;
const node = super.parseExport(unfinished, decorators);
switch (node.type) {
case "ExportAllDeclaration":
node.exported = null;
break;
case "ExportNamedDeclaration":
if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
node.type = "ExportAllDeclaration";
node.exported = node.specifiers[0].exported;
delete node.specifiers;
}
case "ExportDefaultDeclaration":
{
var _declaration$decorato;
const {
declaration
} = node;
if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) {
this.resetStartLocation(node, exportStartLoc);
}
}
break;
}
return node;
}
parseSubscript(base, startLoc, noCalls, state) {
const node = super.parseSubscript(base, startLoc, noCalls, state);
if (state.optionalChainMember) {
if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
node.type = node.type.substring(8);
}
if (state.stop) {
const chain = this.startNodeAtNode(node);
chain.expression = node;
return this.finishNode(chain, "ChainExpression");
}
} else if (node.type === "MemberExpression" || node.type === "CallExpression") {
node.optional = false;
}
return node;
}
hasPropertyAsPrivateName(node) {
if (node.type === "ChainExpression") {
node = node.expression;
}
return super.hasPropertyAsPrivateName(node);
}
isObjectProperty(node) {
return node.type === "Property" && node.kind === "init" && !node.method;
}
isObjectMethod(node) {
return node.method || node.kind === "get" || node.kind === "set";
}
finishNodeAt(node, type, endLoc) {
return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
}
resetStartLocation(node, startLoc) {
super.resetStartLocation(node, startLoc);
toESTreeLocation(node);
}
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
super.resetEndLocation(node, endLoc);
toESTreeLocation(node);
}
};
exports.default = _default;
//# sourceMappingURL=estree.js.map

1
node_modules/@babel/parser/lib/plugins/estree.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2474
node_modules/@babel/parser/lib/plugins/flow/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

44
node_modules/@babel/parser/lib/plugins/flow/scope.js generated vendored Normal file
View File

@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _scope = require("../../util/scope");
var _scopeflags = require("../../util/scopeflags");
class FlowScope extends _scope.Scope {
constructor(...args) {
super(...args);
this.declareFunctions = new Set();
}
}
class FlowScopeHandler extends _scope.default {
createScope(flags) {
return new FlowScope(flags);
}
declareName(name, bindingType, loc) {
const scope = this.currentScope();
if (bindingType & _scopeflags.BindingFlag.FLAG_FLOW_DECLARE_FN) {
this.checkRedeclarationInScope(scope, name, bindingType, loc);
this.maybeExportDefined(scope, name);
scope.declareFunctions.add(name);
return;
}
super.declareName(name, bindingType, loc);
}
isRedeclaredInScope(scope, name, bindingType) {
if (super.isRedeclaredInScope(scope, name, bindingType)) return true;
if (bindingType & _scopeflags.BindingFlag.FLAG_FLOW_DECLARE_FN) {
return !scope.declareFunctions.has(name) && (scope.lexical.has(name) || scope.functions.has(name));
}
return false;
}
checkLocalExport(id) {
if (!this.scopeStack[0].declareFunctions.has(id.name)) {
super.checkLocalExport(id);
}
}
}
exports.default = FlowScopeHandler;
//# sourceMappingURL=scope.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_scope","require","_scopeflags","FlowScope","Scope","constructor","args","declareFunctions","Set","FlowScopeHandler","ScopeHandler","createScope","flags","declareName","name","bindingType","loc","scope","currentScope","BindingFlag","FLAG_FLOW_DECLARE_FN","checkRedeclarationInScope","maybeExportDefined","add","isRedeclaredInScope","has","lexical","functions","checkLocalExport","id","scopeStack","exports","default"],"sources":["../../../src/plugins/flow/scope.ts"],"sourcesContent":["import type { Position } from \"../../util/location\";\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BindingFlag,\n type ScopeFlag,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport type * as N from \"../../types\";\n\n// Reference implementation: https://github.com/facebook/flow/blob/23aeb2a2ef6eb4241ce178fde5d8f17c5f747fb5/src/typing/env.ml#L536-L584\nclass FlowScope extends Scope {\n // declare function foo(): type;\n declareFunctions: Set<string> = new Set();\n}\n\nexport default class FlowScopeHandler extends ScopeHandler<FlowScope> {\n createScope(flags: ScopeFlag): FlowScope {\n return new FlowScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, loc: Position) {\n const scope = this.currentScope();\n if (bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN) {\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n scope.declareFunctions.add(name);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n }\n\n isRedeclaredInScope(\n scope: FlowScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (super.isRedeclaredInScope(scope, name, bindingType)) return true;\n\n if (bindingType & BindingFlag.FLAG_FLOW_DECLARE_FN) {\n return (\n !scope.declareFunctions.has(name) &&\n (scope.lexical.has(name) || scope.functions.has(name))\n );\n }\n\n return false;\n }\n\n checkLocalExport(id: N.Identifier) {\n if (!this.scopeStack[0].declareFunctions.has(id.name)) {\n super.checkLocalExport(id);\n }\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAQA,MAAME,SAAS,SAASC,YAAK,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAA,KAE5BC,gBAAgB,GAAgB,IAAIC,GAAG,CAAC,CAAC;EAAA;AAC3C;AAEe,MAAMC,gBAAgB,SAASC,cAAY,CAAY;EACpEC,WAAWA,CAACC,KAAgB,EAAa;IACvC,OAAO,IAAIT,SAAS,CAACS,KAAK,CAAC;EAC7B;EAEAC,WAAWA,CAACC,IAAY,EAAEC,WAAyB,EAAEC,GAAa,EAAE;IAClE,MAAMC,KAAK,GAAG,IAAI,CAACC,YAAY,CAAC,CAAC;IACjC,IAAIH,WAAW,GAAGI,uBAAW,CAACC,oBAAoB,EAAE;MAClD,IAAI,CAACC,yBAAyB,CAACJ,KAAK,EAAEH,IAAI,EAAEC,WAAW,EAAEC,GAAG,CAAC;MAC7D,IAAI,CAACM,kBAAkB,CAACL,KAAK,EAAEH,IAAI,CAAC;MACpCG,KAAK,CAACV,gBAAgB,CAACgB,GAAG,CAACT,IAAI,CAAC;MAChC;IACF;IAEA,KAAK,CAACD,WAAW,CAACC,IAAI,EAAEC,WAAW,EAAEC,GAAG,CAAC;EAC3C;EAEAQ,mBAAmBA,CACjBP,KAAgB,EAChBH,IAAY,EACZC,WAAyB,EAChB;IACT,IAAI,KAAK,CAACS,mBAAmB,CAACP,KAAK,EAAEH,IAAI,EAAEC,WAAW,CAAC,EAAE,OAAO,IAAI;IAEpE,IAAIA,WAAW,GAAGI,uBAAW,CAACC,oBAAoB,EAAE;MAClD,OACE,CAACH,KAAK,CAACV,gBAAgB,CAACkB,GAAG,CAACX,IAAI,CAAC,KAChCG,KAAK,CAACS,OAAO,CAACD,GAAG,CAACX,IAAI,CAAC,IAAIG,KAAK,CAACU,SAAS,CAACF,GAAG,CAACX,IAAI,CAAC,CAAC;IAE1D;IAEA,OAAO,KAAK;EACd;EAEAc,gBAAgBA,CAACC,EAAgB,EAAE;IACjC,IAAI,CAAC,IAAI,CAACC,UAAU,CAAC,CAAC,CAAC,CAACvB,gBAAgB,CAACkB,GAAG,CAACI,EAAE,CAACf,IAAI,CAAC,EAAE;MACrD,KAAK,CAACc,gBAAgB,CAACC,EAAE,CAAC;IAC5B;EACF;AACF;AAACE,OAAA,CAAAC,OAAA,GAAAvB,gBAAA"}

444
node_modules/@babel/parser/lib/plugins/jsx/index.js generated vendored Normal file
View File

@ -0,0 +1,444 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _xhtml = require("./xhtml");
var _types = require("../../tokenizer/types");
var _context = require("../../tokenizer/context");
var _identifier = require("../../util/identifier");
var _whitespace = require("../../util/whitespace");
var _parseError = require("../../parse-error");
const JsxErrors = (0, _parseError.ParseErrorEnum)`jsx`({
AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
MissingClosingTagElement: ({
openingTagName
}) => `Expected corresponding JSX closing tag for <${openingTagName}>.`,
MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",
UnexpectedToken: ({
unexpected,
HTMLEntity
}) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`,
UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.",
UnterminatedJsxContent: "Unterminated JSX contents.",
UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
});
function isFragment(object) {
return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
}
function getQualifiedJSXName(object) {
if (object.type === "JSXIdentifier") {
return object.name;
}
if (object.type === "JSXNamespacedName") {
return object.namespace.name + ":" + object.name.name;
}
if (object.type === "JSXMemberExpression") {
return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
}
throw new Error("Node had unexpected type: " + object.type);
}
var _default = superClass => class JSXParserMixin extends superClass {
jsxReadToken() {
let out = "";
let chunkStart = this.state.pos;
for (;;) {
if (this.state.pos >= this.length) {
throw this.raise(JsxErrors.UnterminatedJsxContent, {
at: this.state.startLoc
});
}
const ch = this.input.charCodeAt(this.state.pos);
switch (ch) {
case 60:
case 123:
if (this.state.pos === this.state.start) {
if (ch === 60 && this.state.canStartJSXElement) {
++this.state.pos;
this.finishToken(140);
} else {
super.getTokenFromCode(ch);
}
return;
}
out += this.input.slice(chunkStart, this.state.pos);
this.finishToken(139, out);
return;
case 38:
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.pos;
break;
case 62:
case 125:
;
default:
if ((0, _whitespace.isNewLine)(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(true);
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
}
}
jsxReadNewLine(normalizeCRLF) {
const ch = this.input.charCodeAt(this.state.pos);
let out;
++this.state.pos;
if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
++this.state.pos;
out = normalizeCRLF ? "\n" : "\r\n";
} else {
out = String.fromCharCode(ch);
}
++this.state.curLine;
this.state.lineStart = this.state.pos;
return out;
}
jsxReadString(quote) {
let out = "";
let chunkStart = ++this.state.pos;
for (;;) {
if (this.state.pos >= this.length) {
throw this.raise(_parseError.Errors.UnterminatedString, {
at: this.state.startLoc
});
}
const ch = this.input.charCodeAt(this.state.pos);
if (ch === quote) break;
if (ch === 38) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.pos;
} else if ((0, _whitespace.isNewLine)(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(false);
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
out += this.input.slice(chunkStart, this.state.pos++);
this.finishToken(131, out);
}
jsxReadEntity() {
const startPos = ++this.state.pos;
if (this.codePointAtPos(this.state.pos) === 35) {
++this.state.pos;
let radix = 10;
if (this.codePointAtPos(this.state.pos) === 120) {
radix = 16;
++this.state.pos;
}
const codePoint = this.readInt(radix, undefined, false, "bail");
if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) {
++this.state.pos;
return String.fromCodePoint(codePoint);
}
} else {
let count = 0;
let semi = false;
while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) == 59)) {
++this.state.pos;
}
if (semi) {
const desc = this.input.slice(startPos, this.state.pos);
const entity = _xhtml.default[desc];
++this.state.pos;
if (entity) {
return entity;
}
}
}
this.state.pos = startPos;
return "&";
}
jsxReadWord() {
let ch;
const start = this.state.pos;
do {
ch = this.input.charCodeAt(++this.state.pos);
} while ((0, _identifier.isIdentifierChar)(ch) || ch === 45);
this.finishToken(138, this.input.slice(start, this.state.pos));
}
jsxParseIdentifier() {
const node = this.startNode();
if (this.match(138)) {
node.name = this.state.value;
} else if ((0, _types.tokenIsKeyword)(this.state.type)) {
node.name = (0, _types.tokenLabelName)(this.state.type);
} else {
this.unexpected();
}
this.next();
return this.finishNode(node, "JSXIdentifier");
}
jsxParseNamespacedName() {
const startLoc = this.state.startLoc;
const name = this.jsxParseIdentifier();
if (!this.eat(14)) return name;
const node = this.startNodeAt(startLoc);
node.namespace = name;
node.name = this.jsxParseIdentifier();
return this.finishNode(node, "JSXNamespacedName");
}
jsxParseElementName() {
const startLoc = this.state.startLoc;
let node = this.jsxParseNamespacedName();
if (node.type === "JSXNamespacedName") {
return node;
}
while (this.eat(16)) {
const newNode = this.startNodeAt(startLoc);
newNode.object = node;
newNode.property = this.jsxParseIdentifier();
node = this.finishNode(newNode, "JSXMemberExpression");
}
return node;
}
jsxParseAttributeValue() {
let node;
switch (this.state.type) {
case 5:
node = this.startNode();
this.setContext(_context.types.brace);
this.next();
node = this.jsxParseExpressionContainer(node, _context.types.j_oTag);
if (node.expression.type === "JSXEmptyExpression") {
this.raise(JsxErrors.AttributeIsEmpty, {
at: node
});
}
return node;
case 140:
case 131:
return this.parseExprAtom();
default:
throw this.raise(JsxErrors.UnsupportedJsxValue, {
at: this.state.startLoc
});
}
}
jsxParseEmptyExpression() {
const node = this.startNodeAt(this.state.lastTokEndLoc);
return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc);
}
jsxParseSpreadChild(node) {
this.next();
node.expression = this.parseExpression();
this.setContext(_context.types.j_expr);
this.state.canStartJSXElement = true;
this.expect(8);
return this.finishNode(node, "JSXSpreadChild");
}
jsxParseExpressionContainer(node, previousContext) {
if (this.match(8)) {
node.expression = this.jsxParseEmptyExpression();
} else {
const expression = this.parseExpression();
;
node.expression = expression;
}
this.setContext(previousContext);
this.state.canStartJSXElement = true;
this.expect(8);
return this.finishNode(node, "JSXExpressionContainer");
}
jsxParseAttribute() {
const node = this.startNode();
if (this.match(5)) {
this.setContext(_context.types.brace);
this.next();
this.expect(21);
node.argument = this.parseMaybeAssignAllowIn();
this.setContext(_context.types.j_oTag);
this.state.canStartJSXElement = true;
this.expect(8);
return this.finishNode(node, "JSXSpreadAttribute");
}
node.name = this.jsxParseNamespacedName();
node.value = this.eat(29) ? this.jsxParseAttributeValue() : null;
return this.finishNode(node, "JSXAttribute");
}
jsxParseOpeningElementAt(startLoc) {
const node = this.startNodeAt(startLoc);
if (this.eat(141)) {
return this.finishNode(node, "JSXOpeningFragment");
}
node.name = this.jsxParseElementName();
return this.jsxParseOpeningElementAfterName(node);
}
jsxParseOpeningElementAfterName(node) {
const attributes = [];
while (!this.match(56) && !this.match(141)) {
attributes.push(this.jsxParseAttribute());
}
node.attributes = attributes;
node.selfClosing = this.eat(56);
this.expect(141);
return this.finishNode(node, "JSXOpeningElement");
}
jsxParseClosingElementAt(startLoc) {
const node = this.startNodeAt(startLoc);
if (this.eat(141)) {
return this.finishNode(node, "JSXClosingFragment");
}
node.name = this.jsxParseElementName();
this.expect(141);
return this.finishNode(node, "JSXClosingElement");
}
jsxParseElementAt(startLoc) {
const node = this.startNodeAt(startLoc);
const children = [];
const openingElement = this.jsxParseOpeningElementAt(startLoc);
let closingElement = null;
if (!openingElement.selfClosing) {
contents: for (;;) {
switch (this.state.type) {
case 140:
startLoc = this.state.startLoc;
this.next();
if (this.eat(56)) {
closingElement = this.jsxParseClosingElementAt(startLoc);
break contents;
}
children.push(this.jsxParseElementAt(startLoc));
break;
case 139:
children.push(this.parseExprAtom());
break;
case 5:
{
const node = this.startNode();
this.setContext(_context.types.brace);
this.next();
if (this.match(21)) {
children.push(this.jsxParseSpreadChild(node));
} else {
children.push(this.jsxParseExpressionContainer(node, _context.types.j_expr));
}
break;
}
default:
this.unexpected();
}
}
if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) {
this.raise(JsxErrors.MissingClosingTagFragment, {
at: closingElement
});
} else if (!isFragment(openingElement) && isFragment(closingElement)) {
this.raise(JsxErrors.MissingClosingTagElement, {
at: closingElement,
openingTagName: getQualifiedJSXName(openingElement.name)
});
} else if (!isFragment(openingElement) && !isFragment(closingElement)) {
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
this.raise(JsxErrors.MissingClosingTagElement, {
at: closingElement,
openingTagName: getQualifiedJSXName(openingElement.name)
});
}
}
}
if (isFragment(openingElement)) {
node.openingFragment = openingElement;
node.closingFragment = closingElement;
} else {
node.openingElement = openingElement;
node.closingElement = closingElement;
}
node.children = children;
if (this.match(47)) {
throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, {
at: this.state.startLoc
});
}
return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
}
jsxParseElement() {
const startLoc = this.state.startLoc;
this.next();
return this.jsxParseElementAt(startLoc);
}
setContext(newContext) {
const {
context
} = this.state;
context[context.length - 1] = newContext;
}
parseExprAtom(refExpressionErrors) {
if (this.match(139)) {
return this.parseLiteral(this.state.value, "JSXText");
} else if (this.match(140)) {
return this.jsxParseElement();
} else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) {
this.replaceToken(140);
return this.jsxParseElement();
} else {
return super.parseExprAtom(refExpressionErrors);
}
}
skipSpace() {
const curContext = this.curContext();
if (!curContext.preserveSpace) super.skipSpace();
}
getTokenFromCode(code) {
const context = this.curContext();
if (context === _context.types.j_expr) {
this.jsxReadToken();
return;
}
if (context === _context.types.j_oTag || context === _context.types.j_cTag) {
if ((0, _identifier.isIdentifierStart)(code)) {
this.jsxReadWord();
return;
}
if (code === 62) {
++this.state.pos;
this.finishToken(141);
return;
}
if ((code === 34 || code === 39) && context === _context.types.j_oTag) {
this.jsxReadString(code);
return;
}
}
if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
++this.state.pos;
this.finishToken(140);
return;
}
super.getTokenFromCode(code);
}
updateContext(prevType) {
const {
context,
type
} = this.state;
if (type === 56 && prevType === 140) {
context.splice(-2, 2, _context.types.j_cTag);
this.state.canStartJSXElement = false;
} else if (type === 140) {
context.push(_context.types.j_oTag);
} else if (type === 141) {
const out = context[context.length - 1];
if (out === _context.types.j_oTag && prevType === 56 || out === _context.types.j_cTag) {
context.pop();
this.state.canStartJSXElement = context[context.length - 1] === _context.types.j_expr;
} else {
this.setContext(_context.types.j_expr);
this.state.canStartJSXElement = true;
}
} else {
this.state.canStartJSXElement = (0, _types.tokenComesBeforeExpression)(type);
}
}
};
exports.default = _default;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

266
node_modules/@babel/parser/lib/plugins/jsx/xhtml.js generated vendored Normal file
View File

@ -0,0 +1,266 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const entities = {
__proto__: null,
quot: "\u0022",
amp: "&",
apos: "\u0027",
lt: "<",
gt: ">",
nbsp: "\u00A0",
iexcl: "\u00A1",
cent: "\u00A2",
pound: "\u00A3",
curren: "\u00A4",
yen: "\u00A5",
brvbar: "\u00A6",
sect: "\u00A7",
uml: "\u00A8",
copy: "\u00A9",
ordf: "\u00AA",
laquo: "\u00AB",
not: "\u00AC",
shy: "\u00AD",
reg: "\u00AE",
macr: "\u00AF",
deg: "\u00B0",
plusmn: "\u00B1",
sup2: "\u00B2",
sup3: "\u00B3",
acute: "\u00B4",
micro: "\u00B5",
para: "\u00B6",
middot: "\u00B7",
cedil: "\u00B8",
sup1: "\u00B9",
ordm: "\u00BA",
raquo: "\u00BB",
frac14: "\u00BC",
frac12: "\u00BD",
frac34: "\u00BE",
iquest: "\u00BF",
Agrave: "\u00C0",
Aacute: "\u00C1",
Acirc: "\u00C2",
Atilde: "\u00C3",
Auml: "\u00C4",
Aring: "\u00C5",
AElig: "\u00C6",
Ccedil: "\u00C7",
Egrave: "\u00C8",
Eacute: "\u00C9",
Ecirc: "\u00CA",
Euml: "\u00CB",
Igrave: "\u00CC",
Iacute: "\u00CD",
Icirc: "\u00CE",
Iuml: "\u00CF",
ETH: "\u00D0",
Ntilde: "\u00D1",
Ograve: "\u00D2",
Oacute: "\u00D3",
Ocirc: "\u00D4",
Otilde: "\u00D5",
Ouml: "\u00D6",
times: "\u00D7",
Oslash: "\u00D8",
Ugrave: "\u00D9",
Uacute: "\u00DA",
Ucirc: "\u00DB",
Uuml: "\u00DC",
Yacute: "\u00DD",
THORN: "\u00DE",
szlig: "\u00DF",
agrave: "\u00E0",
aacute: "\u00E1",
acirc: "\u00E2",
atilde: "\u00E3",
auml: "\u00E4",
aring: "\u00E5",
aelig: "\u00E6",
ccedil: "\u00E7",
egrave: "\u00E8",
eacute: "\u00E9",
ecirc: "\u00EA",
euml: "\u00EB",
igrave: "\u00EC",
iacute: "\u00ED",
icirc: "\u00EE",
iuml: "\u00EF",
eth: "\u00F0",
ntilde: "\u00F1",
ograve: "\u00F2",
oacute: "\u00F3",
ocirc: "\u00F4",
otilde: "\u00F5",
ouml: "\u00F6",
divide: "\u00F7",
oslash: "\u00F8",
ugrave: "\u00F9",
uacute: "\u00FA",
ucirc: "\u00FB",
uuml: "\u00FC",
yacute: "\u00FD",
thorn: "\u00FE",
yuml: "\u00FF",
OElig: "\u0152",
oelig: "\u0153",
Scaron: "\u0160",
scaron: "\u0161",
Yuml: "\u0178",
fnof: "\u0192",
circ: "\u02C6",
tilde: "\u02DC",
Alpha: "\u0391",
Beta: "\u0392",
Gamma: "\u0393",
Delta: "\u0394",
Epsilon: "\u0395",
Zeta: "\u0396",
Eta: "\u0397",
Theta: "\u0398",
Iota: "\u0399",
Kappa: "\u039A",
Lambda: "\u039B",
Mu: "\u039C",
Nu: "\u039D",
Xi: "\u039E",
Omicron: "\u039F",
Pi: "\u03A0",
Rho: "\u03A1",
Sigma: "\u03A3",
Tau: "\u03A4",
Upsilon: "\u03A5",
Phi: "\u03A6",
Chi: "\u03A7",
Psi: "\u03A8",
Omega: "\u03A9",
alpha: "\u03B1",
beta: "\u03B2",
gamma: "\u03B3",
delta: "\u03B4",
epsilon: "\u03B5",
zeta: "\u03B6",
eta: "\u03B7",
theta: "\u03B8",
iota: "\u03B9",
kappa: "\u03BA",
lambda: "\u03BB",
mu: "\u03BC",
nu: "\u03BD",
xi: "\u03BE",
omicron: "\u03BF",
pi: "\u03C0",
rho: "\u03C1",
sigmaf: "\u03C2",
sigma: "\u03C3",
tau: "\u03C4",
upsilon: "\u03C5",
phi: "\u03C6",
chi: "\u03C7",
psi: "\u03C8",
omega: "\u03C9",
thetasym: "\u03D1",
upsih: "\u03D2",
piv: "\u03D6",
ensp: "\u2002",
emsp: "\u2003",
thinsp: "\u2009",
zwnj: "\u200C",
zwj: "\u200D",
lrm: "\u200E",
rlm: "\u200F",
ndash: "\u2013",
mdash: "\u2014",
lsquo: "\u2018",
rsquo: "\u2019",
sbquo: "\u201A",
ldquo: "\u201C",
rdquo: "\u201D",
bdquo: "\u201E",
dagger: "\u2020",
Dagger: "\u2021",
bull: "\u2022",
hellip: "\u2026",
permil: "\u2030",
prime: "\u2032",
Prime: "\u2033",
lsaquo: "\u2039",
rsaquo: "\u203A",
oline: "\u203E",
frasl: "\u2044",
euro: "\u20AC",
image: "\u2111",
weierp: "\u2118",
real: "\u211C",
trade: "\u2122",
alefsym: "\u2135",
larr: "\u2190",
uarr: "\u2191",
rarr: "\u2192",
darr: "\u2193",
harr: "\u2194",
crarr: "\u21B5",
lArr: "\u21D0",
uArr: "\u21D1",
rArr: "\u21D2",
dArr: "\u21D3",
hArr: "\u21D4",
forall: "\u2200",
part: "\u2202",
exist: "\u2203",
empty: "\u2205",
nabla: "\u2207",
isin: "\u2208",
notin: "\u2209",
ni: "\u220B",
prod: "\u220F",
sum: "\u2211",
minus: "\u2212",
lowast: "\u2217",
radic: "\u221A",
prop: "\u221D",
infin: "\u221E",
ang: "\u2220",
and: "\u2227",
or: "\u2228",
cap: "\u2229",
cup: "\u222A",
int: "\u222B",
there4: "\u2234",
sim: "\u223C",
cong: "\u2245",
asymp: "\u2248",
ne: "\u2260",
equiv: "\u2261",
le: "\u2264",
ge: "\u2265",
sub: "\u2282",
sup: "\u2283",
nsub: "\u2284",
sube: "\u2286",
supe: "\u2287",
oplus: "\u2295",
otimes: "\u2297",
perp: "\u22A5",
sdot: "\u22C5",
lceil: "\u2308",
rceil: "\u2309",
lfloor: "\u230A",
rfloor: "\u230B",
lang: "\u2329",
rang: "\u232A",
loz: "\u25CA",
spades: "\u2660",
clubs: "\u2663",
hearts: "\u2665",
diams: "\u2666"
};
var _default = entities;
exports.default = _default;
//# sourceMappingURL=xhtml.js.map

File diff suppressed because one or more lines are too long

198
node_modules/@babel/parser/lib/plugins/placeholders.js generated vendored Normal file
View File

@ -0,0 +1,198 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _types = require("../tokenizer/types");
var _parseError = require("../parse-error");
const PlaceholderErrors = (0, _parseError.ParseErrorEnum)`placeholders`({
ClassNameIsRequired: "A class name is required.",
UnexpectedSpace: "Unexpected space in placeholder."
});
var _default = superClass => class PlaceholdersParserMixin extends superClass {
parsePlaceholder(expectedNode) {
if (this.match(142)) {
const node = this.startNode();
this.next();
this.assertNoSpace();
node.name = super.parseIdentifier(true);
this.assertNoSpace();
this.expect(142);
return this.finishPlaceholder(node, expectedNode);
}
}
finishPlaceholder(node, expectedNode) {
const isFinished = !!(node.expectedNode && node.type === "Placeholder");
node.expectedNode = expectedNode;
return isFinished ? node : this.finishNode(node, "Placeholder");
}
getTokenFromCode(code) {
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
this.finishOp(142, 2);
} else {
super.getTokenFromCode(code);
}
}
parseExprAtom(refExpressionErrors) {
return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors);
}
parseIdentifier(liberal) {
return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal);
}
checkReservedWord(word, startLoc, checkKeywords, isBinding) {
if (word !== undefined) {
super.checkReservedWord(word, startLoc, checkKeywords, isBinding);
}
}
parseBindingAtom() {
return this.parsePlaceholder("Pattern") || super.parseBindingAtom();
}
isValidLVal(type, isParenthesized, binding) {
return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding);
}
toAssignable(node, isLHS) {
if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
node.expectedNode = "Pattern";
} else {
super.toAssignable(node, isLHS);
}
}
chStartsBindingIdentifier(ch, pos) {
if (super.chStartsBindingIdentifier(ch, pos)) {
return true;
}
const nextToken = this.lookahead();
if (nextToken.type === 142) {
return true;
}
return false;
}
verifyBreakContinue(node, isBreak) {
if (node.label && node.label.type === "Placeholder") return;
super.verifyBreakContinue(node, isBreak);
}
parseExpressionStatement(node, expr) {
var _expr$extra;
if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) {
return super.parseExpressionStatement(node, expr);
}
if (this.match(14)) {
const stmt = node;
stmt.label = this.finishPlaceholder(expr, "Identifier");
this.next();
stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration();
return this.finishNode(stmt, "LabeledStatement");
}
this.semicolon();
node.name = expr.name;
return this.finishPlaceholder(node, "Statement");
}
parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) {
return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse);
}
parseFunctionId(requireId) {
return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId);
}
parseClass(node, isStatement, optionalId) {
const type = isStatement ? "ClassDeclaration" : "ClassExpression";
this.next();
const oldStrict = this.state.strict;
const placeholder = this.parsePlaceholder("Identifier");
if (placeholder) {
if (this.match(81) || this.match(142) || this.match(5)) {
node.id = placeholder;
} else if (optionalId || !isStatement) {
node.id = null;
node.body = this.finishPlaceholder(placeholder, "ClassBody");
return this.finishNode(node, type);
} else {
throw this.raise(PlaceholderErrors.ClassNameIsRequired, {
at: this.state.startLoc
});
}
} else {
this.parseClassId(node, isStatement, optionalId);
}
super.parseClassSuper(node);
node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict);
return this.finishNode(node, type);
}
parseExport(node, decorators) {
const placeholder = this.parsePlaceholder("Identifier");
if (!placeholder) return super.parseExport(node, decorators);
if (!this.isContextual(97) && !this.match(12)) {
node.specifiers = [];
node.source = null;
node.declaration = this.finishPlaceholder(placeholder, "Declaration");
return this.finishNode(node, "ExportNamedDeclaration");
}
this.expectPlugin("exportDefaultFrom");
const specifier = this.startNode();
specifier.exported = placeholder;
node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
return super.parseExport(node, decorators);
}
isExportDefaultSpecifier() {
if (this.match(65)) {
const next = this.nextTokenStart();
if (this.isUnparsedContextual(next, "from")) {
if (this.input.startsWith((0, _types.tokenLabelName)(142), this.nextTokenStartSince(next + 4))) {
return true;
}
}
}
return super.isExportDefaultSpecifier();
}
maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
var _specifiers;
if ((_specifiers = node.specifiers) != null && _specifiers.length) {
return true;
}
return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
}
checkExport(node) {
const {
specifiers
} = node;
if (specifiers != null && specifiers.length) {
node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
}
super.checkExport(node);
node.specifiers = specifiers;
}
parseImport(node) {
const placeholder = this.parsePlaceholder("Identifier");
if (!placeholder) return super.parseImport(node);
node.specifiers = [];
if (!this.isContextual(97) && !this.match(12)) {
node.source = this.finishPlaceholder(placeholder, "StringLiteral");
this.semicolon();
return this.finishNode(node, "ImportDeclaration");
}
const specifier = this.startNodeAtNode(placeholder);
specifier.local = placeholder;
node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
if (this.eat(12)) {
const hasStarImport = this.maybeParseStarImportSpecifier(node);
if (!hasStarImport) this.parseNamedImportSpecifiers(node);
}
this.expectContextual(97);
node.source = this.parseImportSource();
this.semicolon();
return this.finishNode(node, "ImportDeclaration");
}
parseImportSource() {
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
}
assertNoSpace() {
if (this.state.start > this.state.lastTokEndLoc.index) {
this.raise(PlaceholderErrors.UnexpectedSpace, {
at: this.state.lastTokEndLoc
});
}
}
};
exports.default = _default;
//# sourceMappingURL=placeholders.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,121 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _scope = require("../../util/scope");
var _scopeflags = require("../../util/scopeflags");
var _parseError = require("../../parse-error");
class TypeScriptScope extends _scope.Scope {
constructor(...args) {
super(...args);
this.types = new Set();
this.enums = new Set();
this.constEnums = new Set();
this.classes = new Set();
this.exportOnlyBindings = new Set();
}
}
class TypeScriptScopeHandler extends _scope.default {
constructor(...args) {
super(...args);
this.importsStack = [];
}
createScope(flags) {
this.importsStack.push(new Set());
return new TypeScriptScope(flags);
}
enter(flags) {
if (flags == _scopeflags.ScopeFlag.TS_MODULE) {
this.importsStack.push(new Set());
}
super.enter(flags);
}
exit() {
const flags = super.exit();
if (flags == _scopeflags.ScopeFlag.TS_MODULE) {
this.importsStack.pop();
}
return flags;
}
hasImport(name, allowShadow) {
const len = this.importsStack.length;
if (this.importsStack[len - 1].has(name)) {
return true;
}
if (!allowShadow && len > 1) {
for (let i = 0; i < len - 1; i++) {
if (this.importsStack[i].has(name)) return true;
}
}
return false;
}
declareName(name, bindingType, loc) {
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_IMPORT) {
if (this.hasImport(name, true)) {
this.parser.raise(_parseError.Errors.VarRedeclaration, {
at: loc,
identifierName: name
});
}
this.importsStack[this.importsStack.length - 1].add(name);
return;
}
const scope = this.currentScope();
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_EXPORT_ONLY) {
this.maybeExportDefined(scope, name);
scope.exportOnlyBindings.add(name);
return;
}
super.declareName(name, bindingType, loc);
if (bindingType & _scopeflags.BindingFlag.KIND_TYPE) {
if (!(bindingType & _scopeflags.BindingFlag.KIND_VALUE)) {
this.checkRedeclarationInScope(scope, name, bindingType, loc);
this.maybeExportDefined(scope, name);
}
scope.types.add(name);
}
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_ENUM) scope.enums.add(name);
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_CONST_ENUM) {
scope.constEnums.add(name);
}
if (bindingType & _scopeflags.BindingFlag.FLAG_CLASS) scope.classes.add(name);
}
isRedeclaredInScope(scope, name, bindingType) {
if (scope.enums.has(name)) {
if (bindingType & _scopeflags.BindingFlag.FLAG_TS_ENUM) {
const isConst = !!(bindingType & _scopeflags.BindingFlag.FLAG_TS_CONST_ENUM);
const wasConst = scope.constEnums.has(name);
return isConst !== wasConst;
}
return true;
}
if (bindingType & _scopeflags.BindingFlag.FLAG_CLASS && scope.classes.has(name)) {
if (scope.lexical.has(name)) {
return !!(bindingType & _scopeflags.BindingFlag.KIND_VALUE);
} else {
return false;
}
}
if (bindingType & _scopeflags.BindingFlag.KIND_TYPE && scope.types.has(name)) {
return true;
}
return super.isRedeclaredInScope(scope, name, bindingType);
}
checkLocalExport(id) {
const {
name
} = id;
if (this.hasImport(name)) return;
const len = this.scopeStack.length;
for (let i = len - 1; i >= 0; i--) {
const scope = this.scopeStack[i];
if (scope.types.has(name) || scope.exportOnlyBindings.has(name)) return;
}
super.checkLocalExport(id);
}
}
exports.default = TypeScriptScopeHandler;
//# sourceMappingURL=scope.js.map

File diff suppressed because one or more lines are too long

31
node_modules/@babel/parser/lib/plugins/v8intrinsic.js generated vendored Normal file
View File

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _types = require("../tokenizer/types");
var _default = superClass => class V8IntrinsicMixin extends superClass {
parseV8Intrinsic() {
if (this.match(54)) {
const v8IntrinsicStartLoc = this.state.startLoc;
const node = this.startNode();
this.next();
if ((0, _types.tokenIsIdentifier)(this.state.type)) {
const name = this.parseIdentifierName();
const identifier = this.createIdentifier(node, name);
identifier.type = "V8IntrinsicIdentifier";
if (this.match(10)) {
return identifier;
}
}
this.unexpected(v8IntrinsicStartLoc);
}
}
parseExprAtom(refExpressionErrors) {
return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors);
}
};
exports.default = _default;
//# sourceMappingURL=v8intrinsic.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_types","require","_default","superClass","V8IntrinsicMixin","parseV8Intrinsic","match","v8IntrinsicStartLoc","state","startLoc","node","startNode","next","tokenIsIdentifier","type","name","parseIdentifierName","identifier","createIdentifier","unexpected","parseExprAtom","refExpressionErrors","exports","default"],"sources":["../../src/plugins/v8intrinsic.ts"],"sourcesContent":["import type Parser from \"../parser\";\nimport { tokenIsIdentifier, tt } from \"../tokenizer/types\";\nimport type * as N from \"../types\";\nimport type { ExpressionErrors } from \"../parser/util\";\n\nexport default (superClass: typeof Parser) =>\n class V8IntrinsicMixin extends superClass implements Parser {\n parseV8Intrinsic(): N.Expression {\n if (this.match(tt.modulo)) {\n const v8IntrinsicStartLoc = this.state.startLoc;\n // let the `loc` of Identifier starts from `%`\n const node = this.startNode<N.Identifier>();\n this.next(); // eat '%'\n if (tokenIsIdentifier(this.state.type)) {\n const name = this.parseIdentifierName();\n const identifier = this.createIdentifier(node, name);\n // @ts-expect-error: avoid mutating AST types\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(tt.parenL)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStartLoc);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(refExpressionErrors?: ExpressionErrors | null): N.Expression {\n return (\n this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors)\n );\n }\n };\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAA2D,IAAAC,QAAA,GAI3CC,UAAyB,IACvC,MAAMC,gBAAgB,SAASD,UAAU,CAAmB;EAC1DE,gBAAgBA,CAAA,EAAiB;IAC/B,IAAI,IAAI,CAACC,KAAK,GAAU,CAAC,EAAE;MACzB,MAAMC,mBAAmB,GAAG,IAAI,CAACC,KAAK,CAACC,QAAQ;MAE/C,MAAMC,IAAI,GAAG,IAAI,CAACC,SAAS,CAAe,CAAC;MAC3C,IAAI,CAACC,IAAI,CAAC,CAAC;MACX,IAAI,IAAAC,wBAAiB,EAAC,IAAI,CAACL,KAAK,CAACM,IAAI,CAAC,EAAE;QACtC,MAAMC,IAAI,GAAG,IAAI,CAACC,mBAAmB,CAAC,CAAC;QACvC,MAAMC,UAAU,GAAG,IAAI,CAACC,gBAAgB,CAACR,IAAI,EAAEK,IAAI,CAAC;QAEpDE,UAAU,CAACH,IAAI,GAAG,uBAAuB;QACzC,IAAI,IAAI,CAACR,KAAK,GAAU,CAAC,EAAE;UACzB,OAAOW,UAAU;QACnB;MACF;MACA,IAAI,CAACE,UAAU,CAACZ,mBAAmB,CAAC;IACtC;EACF;EAMAa,aAAaA,CAACC,mBAA6C,EAAgB;IACzE,OACE,IAAI,CAAChB,gBAAgB,CAAC,CAAC,IAAI,KAAK,CAACe,aAAa,CAACC,mBAAmB,CAAC;EAEvE;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAArB,QAAA"}

27
node_modules/@babel/parser/lib/tokenizer/context.js generated vendored Normal file
View File

@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.types = exports.TokContext = void 0;
class TokContext {
constructor(token, preserveSpace) {
this.token = void 0;
this.preserveSpace = void 0;
this.token = token;
this.preserveSpace = !!preserveSpace;
}
}
exports.TokContext = TokContext;
const types = {
brace: new TokContext("{"),
j_oTag: new TokContext("<tag"),
j_cTag: new TokContext("</tag"),
j_expr: new TokContext("<tag>...</tag>", true)
};
exports.types = types;
{
types.template = new TokContext("`", true);
}
//# sourceMappingURL=context.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["TokContext","constructor","token","preserveSpace","exports","types","brace","j_oTag","j_cTag","j_expr","template"],"sources":["../../src/tokenizer/context.ts"],"sourcesContent":["// The token context is used in JSX plugin to track\n// jsx tag / jsx text / normal JavaScript expression\n\nexport class TokContext {\n constructor(token: string, preserveSpace?: boolean) {\n this.token = token;\n this.preserveSpace = !!preserveSpace;\n }\n\n token: string;\n preserveSpace: boolean;\n}\n\nconst types: {\n [key: string]: TokContext;\n} = {\n brace: new TokContext(\"{\"), // normal JavaScript expression\n j_oTag: new TokContext(\"<tag\"), // JSX opening tag\n j_cTag: new TokContext(\"</tag\"), // JSX closing tag\n j_expr: new TokContext(\"<tag>...</tag>\", true), // JSX expressions\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n types.template = new TokContext(\"`\", true);\n}\n\nexport { types };\n"],"mappings":";;;;;;AAGO,MAAMA,UAAU,CAAC;EACtBC,WAAWA,CAACC,KAAa,EAAEC,aAAuB,EAAE;IAAA,KAKpDD,KAAK;IAAA,KACLC,aAAa;IALX,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,aAAa,GAAG,CAAC,CAACA,aAAa;EACtC;AAIF;AAACC,OAAA,CAAAJ,UAAA,GAAAA,UAAA;AAED,MAAMK,KAEL,GAAG;EACFC,KAAK,EAAE,IAAIN,UAAU,CAAC,GAAG,CAAC;EAC1BO,MAAM,EAAE,IAAIP,UAAU,CAAC,MAAM,CAAC;EAC9BQ,MAAM,EAAE,IAAIR,UAAU,CAAC,OAAO,CAAC;EAC/BS,MAAM,EAAE,IAAIT,UAAU,CAAC,gBAAgB,EAAE,IAAI;AAC/C,CAAC;AAACI,OAAA,CAAAC,KAAA,GAAAA,KAAA;AAEiC;EACjCA,KAAK,CAACK,QAAQ,GAAG,IAAIV,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC;AAC5C"}

1119
node_modules/@babel/parser/lib/tokenizer/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

82
node_modules/@babel/parser/lib/tokenizer/state.js generated vendored Normal file
View File

@ -0,0 +1,82 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _location = require("../util/location");
var _context = require("./context");
var _types = require("./types");
class State {
constructor() {
this.strict = void 0;
this.curLine = void 0;
this.lineStart = void 0;
this.startLoc = void 0;
this.endLoc = void 0;
this.errors = [];
this.potentialArrowAt = -1;
this.noArrowAt = [];
this.noArrowParamsConversionAt = [];
this.maybeInArrowParameters = false;
this.inType = false;
this.noAnonFunctionType = false;
this.hasFlowComment = false;
this.isAmbientContext = false;
this.inAbstractClass = false;
this.inDisallowConditionalTypesContext = false;
this.topicContext = {
maxNumOfResolvableTopics: 0,
maxTopicIndex: null
};
this.soloAwait = false;
this.inFSharpPipelineDirectBody = false;
this.labels = [];
this.comments = [];
this.commentStack = [];
this.pos = 0;
this.type = 137;
this.value = null;
this.start = 0;
this.end = 0;
this.lastTokEndLoc = null;
this.lastTokStartLoc = null;
this.lastTokStart = 0;
this.context = [_context.types.brace];
this.canStartJSXElement = true;
this.containsEsc = false;
this.firstInvalidTemplateEscapePos = null;
this.strictErrors = new Map();
this.tokensLength = 0;
}
init({
strictMode,
sourceType,
startLine,
startColumn
}) {
this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module";
this.curLine = startLine;
this.lineStart = -startColumn;
this.startLoc = this.endLoc = new _location.Position(startLine, startColumn, 0);
}
curPosition() {
return new _location.Position(this.curLine, this.pos - this.lineStart, this.pos);
}
clone(skipArrays) {
const state = new State();
const keys = Object.keys(this);
for (let i = 0, length = keys.length; i < length; i++) {
const key = keys[i];
let val = this[key];
if (!skipArrays && Array.isArray(val)) {
val = val.slice();
}
state[key] = val;
}
return state;
}
}
exports.default = State;
//# sourceMappingURL=state.js.map

File diff suppressed because one or more lines are too long

586
node_modules/@babel/parser/lib/tokenizer/types.js generated vendored Normal file
View File

@ -0,0 +1,586 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExportedTokenType = void 0;
exports.getExportedToken = getExportedToken;
exports.isTokenType = isTokenType;
exports.keywords = void 0;
exports.tokenCanStartExpression = tokenCanStartExpression;
exports.tokenComesBeforeExpression = tokenComesBeforeExpression;
exports.tokenIsAssignment = tokenIsAssignment;
exports.tokenIsBinaryOperator = tokenIsBinaryOperator;
exports.tokenIsFlowInterfaceOrTypeOrOpaque = tokenIsFlowInterfaceOrTypeOrOpaque;
exports.tokenIsIdentifier = tokenIsIdentifier;
exports.tokenIsKeyword = tokenIsKeyword;
exports.tokenIsKeywordOrIdentifier = tokenIsKeywordOrIdentifier;
exports.tokenIsLiteralPropertyName = tokenIsLiteralPropertyName;
exports.tokenIsLoop = tokenIsLoop;
exports.tokenIsOperator = tokenIsOperator;
exports.tokenIsPostfix = tokenIsPostfix;
exports.tokenIsPrefix = tokenIsPrefix;
exports.tokenIsRightAssociative = tokenIsRightAssociative;
exports.tokenIsTSDeclarationStart = tokenIsTSDeclarationStart;
exports.tokenIsTSTypeOperator = tokenIsTSTypeOperator;
exports.tokenIsTemplate = tokenIsTemplate;
exports.tokenKeywordOrIdentifierIsKeyword = tokenKeywordOrIdentifierIsKeyword;
exports.tokenLabelName = tokenLabelName;
exports.tokenOperatorPrecedence = tokenOperatorPrecedence;
exports.tt = exports.tokenTypes = void 0;
var _context = require("./context");
const beforeExpr = true;
const startsExpr = true;
const isLoop = true;
const isAssign = true;
const prefix = true;
const postfix = true;
class ExportedTokenType {
constructor(label, conf = {}) {
this.label = void 0;
this.keyword = void 0;
this.beforeExpr = void 0;
this.startsExpr = void 0;
this.rightAssociative = void 0;
this.isLoop = void 0;
this.isAssign = void 0;
this.prefix = void 0;
this.postfix = void 0;
this.binop = void 0;
this.label = label;
this.keyword = conf.keyword;
this.beforeExpr = !!conf.beforeExpr;
this.startsExpr = !!conf.startsExpr;
this.rightAssociative = !!conf.rightAssociative;
this.isLoop = !!conf.isLoop;
this.isAssign = !!conf.isAssign;
this.prefix = !!conf.prefix;
this.postfix = !!conf.postfix;
this.binop = conf.binop != null ? conf.binop : null;
{
this.updateContext = null;
}
}
}
exports.ExportedTokenType = ExportedTokenType;
const keywords = new Map();
exports.keywords = keywords;
function createKeyword(name, options = {}) {
options.keyword = name;
const token = createToken(name, options);
keywords.set(name, token);
return token;
}
function createBinop(name, binop) {
return createToken(name, {
beforeExpr,
binop
});
}
let tokenTypeCounter = -1;
const tokenTypes = [];
exports.tokenTypes = tokenTypes;
const tokenLabels = [];
const tokenBinops = [];
const tokenBeforeExprs = [];
const tokenStartsExprs = [];
const tokenPrefixes = [];
function createToken(name, options = {}) {
var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix;
++tokenTypeCounter;
tokenLabels.push(name);
tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1);
tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false);
tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false);
tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false);
tokenTypes.push(new ExportedTokenType(name, options));
return tokenTypeCounter;
}
function createKeywordLike(name, options = {}) {
var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2;
++tokenTypeCounter;
keywords.set(name, tokenTypeCounter);
tokenLabels.push(name);
tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1);
tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false);
tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false);
tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false);
tokenTypes.push(new ExportedTokenType("name", options));
return tokenTypeCounter;
}
const tt = {
bracketL: createToken("[", {
beforeExpr,
startsExpr
}),
bracketHashL: createToken("#[", {
beforeExpr,
startsExpr
}),
bracketBarL: createToken("[|", {
beforeExpr,
startsExpr
}),
bracketR: createToken("]"),
bracketBarR: createToken("|]"),
braceL: createToken("{", {
beforeExpr,
startsExpr
}),
braceBarL: createToken("{|", {
beforeExpr,
startsExpr
}),
braceHashL: createToken("#{", {
beforeExpr,
startsExpr
}),
braceR: createToken("}"),
braceBarR: createToken("|}"),
parenL: createToken("(", {
beforeExpr,
startsExpr
}),
parenR: createToken(")"),
comma: createToken(",", {
beforeExpr
}),
semi: createToken(";", {
beforeExpr
}),
colon: createToken(":", {
beforeExpr
}),
doubleColon: createToken("::", {
beforeExpr
}),
dot: createToken("."),
question: createToken("?", {
beforeExpr
}),
questionDot: createToken("?."),
arrow: createToken("=>", {
beforeExpr
}),
template: createToken("template"),
ellipsis: createToken("...", {
beforeExpr
}),
backQuote: createToken("`", {
startsExpr
}),
dollarBraceL: createToken("${", {
beforeExpr,
startsExpr
}),
templateTail: createToken("...`", {
startsExpr
}),
templateNonTail: createToken("...${", {
beforeExpr,
startsExpr
}),
at: createToken("@"),
hash: createToken("#", {
startsExpr
}),
interpreterDirective: createToken("#!..."),
eq: createToken("=", {
beforeExpr,
isAssign
}),
assign: createToken("_=", {
beforeExpr,
isAssign
}),
slashAssign: createToken("_=", {
beforeExpr,
isAssign
}),
xorAssign: createToken("_=", {
beforeExpr,
isAssign
}),
moduloAssign: createToken("_=", {
beforeExpr,
isAssign
}),
incDec: createToken("++/--", {
prefix,
postfix,
startsExpr
}),
bang: createToken("!", {
beforeExpr,
prefix,
startsExpr
}),
tilde: createToken("~", {
beforeExpr,
prefix,
startsExpr
}),
doubleCaret: createToken("^^", {
startsExpr
}),
doubleAt: createToken("@@", {
startsExpr
}),
pipeline: createBinop("|>", 0),
nullishCoalescing: createBinop("??", 1),
logicalOR: createBinop("||", 1),
logicalAND: createBinop("&&", 2),
bitwiseOR: createBinop("|", 3),
bitwiseXOR: createBinop("^", 4),
bitwiseAND: createBinop("&", 5),
equality: createBinop("==/!=/===/!==", 6),
lt: createBinop("</>/<=/>=", 7),
gt: createBinop("</>/<=/>=", 7),
relational: createBinop("</>/<=/>=", 7),
bitShift: createBinop("<</>>/>>>", 8),
bitShiftL: createBinop("<</>>/>>>", 8),
bitShiftR: createBinop("<</>>/>>>", 8),
plusMin: createToken("+/-", {
beforeExpr,
binop: 9,
prefix,
startsExpr
}),
modulo: createToken("%", {
binop: 10,
startsExpr
}),
star: createToken("*", {
binop: 10
}),
slash: createBinop("/", 10),
exponent: createToken("**", {
beforeExpr,
binop: 11,
rightAssociative: true
}),
_in: createKeyword("in", {
beforeExpr,
binop: 7
}),
_instanceof: createKeyword("instanceof", {
beforeExpr,
binop: 7
}),
_break: createKeyword("break"),
_case: createKeyword("case", {
beforeExpr
}),
_catch: createKeyword("catch"),
_continue: createKeyword("continue"),
_debugger: createKeyword("debugger"),
_default: createKeyword("default", {
beforeExpr
}),
_else: createKeyword("else", {
beforeExpr
}),
_finally: createKeyword("finally"),
_function: createKeyword("function", {
startsExpr
}),
_if: createKeyword("if"),
_return: createKeyword("return", {
beforeExpr
}),
_switch: createKeyword("switch"),
_throw: createKeyword("throw", {
beforeExpr,
prefix,
startsExpr
}),
_try: createKeyword("try"),
_var: createKeyword("var"),
_const: createKeyword("const"),
_with: createKeyword("with"),
_new: createKeyword("new", {
beforeExpr,
startsExpr
}),
_this: createKeyword("this", {
startsExpr
}),
_super: createKeyword("super", {
startsExpr
}),
_class: createKeyword("class", {
startsExpr
}),
_extends: createKeyword("extends", {
beforeExpr
}),
_export: createKeyword("export"),
_import: createKeyword("import", {
startsExpr
}),
_null: createKeyword("null", {
startsExpr
}),
_true: createKeyword("true", {
startsExpr
}),
_false: createKeyword("false", {
startsExpr
}),
_typeof: createKeyword("typeof", {
beforeExpr,
prefix,
startsExpr
}),
_void: createKeyword("void", {
beforeExpr,
prefix,
startsExpr
}),
_delete: createKeyword("delete", {
beforeExpr,
prefix,
startsExpr
}),
_do: createKeyword("do", {
isLoop,
beforeExpr
}),
_for: createKeyword("for", {
isLoop
}),
_while: createKeyword("while", {
isLoop
}),
_as: createKeywordLike("as", {
startsExpr
}),
_assert: createKeywordLike("assert", {
startsExpr
}),
_async: createKeywordLike("async", {
startsExpr
}),
_await: createKeywordLike("await", {
startsExpr
}),
_from: createKeywordLike("from", {
startsExpr
}),
_get: createKeywordLike("get", {
startsExpr
}),
_let: createKeywordLike("let", {
startsExpr
}),
_meta: createKeywordLike("meta", {
startsExpr
}),
_of: createKeywordLike("of", {
startsExpr
}),
_sent: createKeywordLike("sent", {
startsExpr
}),
_set: createKeywordLike("set", {
startsExpr
}),
_static: createKeywordLike("static", {
startsExpr
}),
_using: createKeywordLike("using", {
startsExpr
}),
_yield: createKeywordLike("yield", {
startsExpr
}),
_asserts: createKeywordLike("asserts", {
startsExpr
}),
_checks: createKeywordLike("checks", {
startsExpr
}),
_exports: createKeywordLike("exports", {
startsExpr
}),
_global: createKeywordLike("global", {
startsExpr
}),
_implements: createKeywordLike("implements", {
startsExpr
}),
_intrinsic: createKeywordLike("intrinsic", {
startsExpr
}),
_infer: createKeywordLike("infer", {
startsExpr
}),
_is: createKeywordLike("is", {
startsExpr
}),
_mixins: createKeywordLike("mixins", {
startsExpr
}),
_proto: createKeywordLike("proto", {
startsExpr
}),
_require: createKeywordLike("require", {
startsExpr
}),
_satisfies: createKeywordLike("satisfies", {
startsExpr
}),
_keyof: createKeywordLike("keyof", {
startsExpr
}),
_readonly: createKeywordLike("readonly", {
startsExpr
}),
_unique: createKeywordLike("unique", {
startsExpr
}),
_abstract: createKeywordLike("abstract", {
startsExpr
}),
_declare: createKeywordLike("declare", {
startsExpr
}),
_enum: createKeywordLike("enum", {
startsExpr
}),
_module: createKeywordLike("module", {
startsExpr
}),
_namespace: createKeywordLike("namespace", {
startsExpr
}),
_interface: createKeywordLike("interface", {
startsExpr
}),
_type: createKeywordLike("type", {
startsExpr
}),
_opaque: createKeywordLike("opaque", {
startsExpr
}),
name: createToken("name", {
startsExpr
}),
string: createToken("string", {
startsExpr
}),
num: createToken("num", {
startsExpr
}),
bigint: createToken("bigint", {
startsExpr
}),
decimal: createToken("decimal", {
startsExpr
}),
regexp: createToken("regexp", {
startsExpr
}),
privateName: createToken("#name", {
startsExpr
}),
eof: createToken("eof"),
jsxName: createToken("jsxName"),
jsxText: createToken("jsxText", {
beforeExpr: true
}),
jsxTagStart: createToken("jsxTagStart", {
startsExpr: true
}),
jsxTagEnd: createToken("jsxTagEnd"),
placeholder: createToken("%%", {
startsExpr: true
})
};
exports.tt = tt;
function tokenIsIdentifier(token) {
return token >= 93 && token <= 130;
}
function tokenKeywordOrIdentifierIsKeyword(token) {
return token <= 92;
}
function tokenIsKeywordOrIdentifier(token) {
return token >= 58 && token <= 130;
}
function tokenIsLiteralPropertyName(token) {
return token >= 58 && token <= 134;
}
function tokenComesBeforeExpression(token) {
return tokenBeforeExprs[token];
}
function tokenCanStartExpression(token) {
return tokenStartsExprs[token];
}
function tokenIsAssignment(token) {
return token >= 29 && token <= 33;
}
function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
return token >= 127 && token <= 129;
}
function tokenIsLoop(token) {
return token >= 90 && token <= 92;
}
function tokenIsKeyword(token) {
return token >= 58 && token <= 92;
}
function tokenIsOperator(token) {
return token >= 39 && token <= 59;
}
function tokenIsPostfix(token) {
return token === 34;
}
function tokenIsPrefix(token) {
return tokenPrefixes[token];
}
function tokenIsTSTypeOperator(token) {
return token >= 119 && token <= 121;
}
function tokenIsTSDeclarationStart(token) {
return token >= 122 && token <= 128;
}
function tokenLabelName(token) {
return tokenLabels[token];
}
function tokenOperatorPrecedence(token) {
return tokenBinops[token];
}
function tokenIsBinaryOperator(token) {
return tokenBinops[token] !== -1;
}
function tokenIsRightAssociative(token) {
return token === 57;
}
function tokenIsTemplate(token) {
return token >= 24 && token <= 25;
}
function getExportedToken(token) {
return tokenTypes[token];
}
function isTokenType(obj) {
return typeof obj === "number";
}
{
tokenTypes[8].updateContext = context => {
context.pop();
};
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => {
context.push(_context.types.brace);
};
tokenTypes[22].updateContext = context => {
if (context[context.length - 1] === _context.types.template) {
context.pop();
} else {
context.push(_context.types.template);
}
};
tokenTypes[140].updateContext = context => {
context.push(_context.types.j_expr, _context.types.j_oTag);
};
}
//# sourceMappingURL=types.js.map

File diff suppressed because one or more lines are too long

92
node_modules/@babel/parser/lib/util/class-scope.js generated vendored Normal file
View File

@ -0,0 +1,92 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ClassScope = void 0;
var _scopeflags = require("./scopeflags");
var _parseError = require("../parse-error");
class ClassScope {
constructor() {
this.privateNames = new Set();
this.loneAccessors = new Map();
this.undefinedPrivateNames = new Map();
}
}
exports.ClassScope = ClassScope;
class ClassScopeHandler {
constructor(parser) {
this.parser = void 0;
this.stack = [];
this.undefinedPrivateNames = new Map();
this.parser = parser;
}
current() {
return this.stack[this.stack.length - 1];
}
enter() {
this.stack.push(new ClassScope());
}
exit() {
const oldClassScope = this.stack.pop();
const current = this.current();
for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) {
if (current) {
if (!current.undefinedPrivateNames.has(name)) {
current.undefinedPrivateNames.set(name, loc);
}
} else {
this.parser.raise(_parseError.Errors.InvalidPrivateFieldResolution, {
at: loc,
identifierName: name
});
}
}
}
declarePrivateName(name, elementType, loc) {
const {
privateNames,
loneAccessors,
undefinedPrivateNames
} = this.current();
let redefined = privateNames.has(name);
if (elementType & _scopeflags.ClassElementType.KIND_ACCESSOR) {
const accessor = redefined && loneAccessors.get(name);
if (accessor) {
const oldStatic = accessor & _scopeflags.ClassElementType.FLAG_STATIC;
const newStatic = elementType & _scopeflags.ClassElementType.FLAG_STATIC;
const oldKind = accessor & _scopeflags.ClassElementType.KIND_ACCESSOR;
const newKind = elementType & _scopeflags.ClassElementType.KIND_ACCESSOR;
redefined = oldKind === newKind || oldStatic !== newStatic;
if (!redefined) loneAccessors.delete(name);
} else if (!redefined) {
loneAccessors.set(name, elementType);
}
}
if (redefined) {
this.parser.raise(_parseError.Errors.PrivateNameRedeclaration, {
at: loc,
identifierName: name
});
}
privateNames.add(name);
undefinedPrivateNames.delete(name);
}
usePrivateName(name, loc) {
let classScope;
for (classScope of this.stack) {
if (classScope.privateNames.has(name)) return;
}
if (classScope) {
classScope.undefinedPrivateNames.set(name, loc);
} else {
this.parser.raise(_parseError.Errors.InvalidPrivateFieldResolution, {
at: loc,
identifierName: name
});
}
}
}
exports.default = ClassScopeHandler;
//# sourceMappingURL=class-scope.js.map

File diff suppressed because one or more lines are too long

142
node_modules/@babel/parser/lib/util/expression-scope.js generated vendored Normal file
View File

@ -0,0 +1,142 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.newArrowHeadScope = newArrowHeadScope;
exports.newAsyncArrowScope = newAsyncArrowScope;
exports.newExpressionScope = newExpressionScope;
exports.newParameterDeclarationScope = newParameterDeclarationScope;
var _parseError = require("../parse-error");
class ExpressionScope {
constructor(type = 0) {
this.type = type;
}
canBeArrowParameterDeclaration() {
return this.type === 2 || this.type === 1;
}
isCertainlyParameterDeclaration() {
return this.type === 3;
}
}
class ArrowHeadParsingScope extends ExpressionScope {
constructor(type) {
super(type);
this.declarationErrors = new Map();
}
recordDeclarationError(ParsingErrorClass, {
at
}) {
const index = at.index;
this.declarationErrors.set(index, [ParsingErrorClass, at]);
}
clearDeclarationError(index) {
this.declarationErrors.delete(index);
}
iterateErrors(iterator) {
this.declarationErrors.forEach(iterator);
}
}
class ExpressionScopeHandler {
constructor(parser) {
this.parser = void 0;
this.stack = [new ExpressionScope()];
this.parser = parser;
}
enter(scope) {
this.stack.push(scope);
}
exit() {
this.stack.pop();
}
recordParameterInitializerError(toParseError, {
at: node
}) {
const origin = {
at: node.loc.start
};
const {
stack
} = this;
let i = stack.length - 1;
let scope = stack[i];
while (!scope.isCertainlyParameterDeclaration()) {
if (scope.canBeArrowParameterDeclaration()) {
scope.recordDeclarationError(toParseError, origin);
} else {
return;
}
scope = stack[--i];
}
this.parser.raise(toParseError, origin);
}
recordArrowParameterBindingError(error, {
at: node
}) {
const {
stack
} = this;
const scope = stack[stack.length - 1];
const origin = {
at: node.loc.start
};
if (scope.isCertainlyParameterDeclaration()) {
this.parser.raise(error, origin);
} else if (scope.canBeArrowParameterDeclaration()) {
scope.recordDeclarationError(error, origin);
} else {
return;
}
}
recordAsyncArrowParametersError({
at
}) {
const {
stack
} = this;
let i = stack.length - 1;
let scope = stack[i];
while (scope.canBeArrowParameterDeclaration()) {
if (scope.type === 2) {
scope.recordDeclarationError(_parseError.Errors.AwaitBindingIdentifier, {
at
});
}
scope = stack[--i];
}
}
validateAsPattern() {
const {
stack
} = this;
const currentScope = stack[stack.length - 1];
if (!currentScope.canBeArrowParameterDeclaration()) return;
currentScope.iterateErrors(([toParseError, loc]) => {
this.parser.raise(toParseError, {
at: loc
});
let i = stack.length - 2;
let scope = stack[i];
while (scope.canBeArrowParameterDeclaration()) {
scope.clearDeclarationError(loc.index);
scope = stack[--i];
}
});
}
}
exports.default = ExpressionScopeHandler;
function newParameterDeclarationScope() {
return new ExpressionScope(3);
}
function newArrowHeadScope() {
return new ArrowHeadParsingScope(1);
}
function newAsyncArrowScope() {
return new ArrowHeadParsingScope(2);
}
function newExpressionScope() {
return new ExpressionScope();
}
//# sourceMappingURL=expression-scope.js.map

File diff suppressed because one or more lines are too long

62
node_modules/@babel/parser/lib/util/identifier.js generated vendored Normal file
View File

@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.canBeReservedWord = canBeReservedWord;
Object.defineProperty(exports, "isIdentifierChar", {
enumerable: true,
get: function () {
return _helperValidatorIdentifier.isIdentifierChar;
}
});
Object.defineProperty(exports, "isIdentifierStart", {
enumerable: true,
get: function () {
return _helperValidatorIdentifier.isIdentifierStart;
}
});
exports.isIteratorStart = isIteratorStart;
Object.defineProperty(exports, "isKeyword", {
enumerable: true,
get: function () {
return _helperValidatorIdentifier.isKeyword;
}
});
Object.defineProperty(exports, "isReservedWord", {
enumerable: true,
get: function () {
return _helperValidatorIdentifier.isReservedWord;
}
});
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
enumerable: true,
get: function () {
return _helperValidatorIdentifier.isStrictBindOnlyReservedWord;
}
});
Object.defineProperty(exports, "isStrictBindReservedWord", {
enumerable: true,
get: function () {
return _helperValidatorIdentifier.isStrictBindReservedWord;
}
});
Object.defineProperty(exports, "isStrictReservedWord", {
enumerable: true,
get: function () {
return _helperValidatorIdentifier.isStrictReservedWord;
}
});
exports.keywordRelationalOperator = void 0;
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
const keywordRelationalOperator = /^in(stanceof)?$/;
exports.keywordRelationalOperator = keywordRelationalOperator;
function isIteratorStart(current, next, next2) {
return current === 64 && next === 64 && (0, _helperValidatorIdentifier.isIdentifierStart)(next2);
}
const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]);
function canBeReservedWord(word) {
return reservedWordLikeSet.has(word);
}
//# sourceMappingURL=identifier.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["_helperValidatorIdentifier","require","keywordRelationalOperator","exports","isIteratorStart","current","next","next2","isIdentifierStart","reservedWordLikeSet","Set","canBeReservedWord","word","has"],"sources":["../../src/util/identifier.ts"],"sourcesContent":["/* eslint max-len: 0 */\n\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart } from \"@babel/helper-validator-identifier\";\n\nexport {\n isIdentifierStart,\n isIdentifierChar,\n isReservedWord,\n isStrictBindOnlyReservedWord,\n isStrictBindReservedWord,\n isStrictReservedWord,\n isKeyword,\n} from \"@babel/helper-validator-identifier\";\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(\n current: number,\n next: number,\n next2: number,\n): boolean {\n return (\n current === charCodes.atSign &&\n next === charCodes.atSign &&\n isIdentifierStart(next2)\n );\n}\n\n// This is the comprehensive set of JavaScript reserved words\n// If a word is in this set, it could be a reserved word,\n// depending on sourceType/strictMode/binding info. In other words\n// if a word is not in this set, it is not a reserved word under\n// any circumstance.\nconst reservedWordLikeSet = new Set([\n \"break\",\n \"case\",\n \"catch\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"var\",\n \"const\",\n \"while\",\n \"with\",\n \"new\",\n \"this\",\n \"super\",\n \"class\",\n \"extends\",\n \"export\",\n \"import\",\n \"null\",\n \"true\",\n \"false\",\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"void\",\n \"delete\",\n // strict\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n // strictBind\n \"eval\",\n \"arguments\",\n // reservedWorkLike\n \"enum\",\n \"await\",\n]);\n\nexport function canBeReservedWord(word: string): boolean {\n return reservedWordLikeSet.has(word);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,0BAAA,GAAAC,OAAA;AAYO,MAAMC,yBAAyB,GAAG,iBAAiB;AAACC,OAAA,CAAAD,yBAAA,GAAAA,yBAAA;AAIpD,SAASE,eAAeA,CAC7BC,OAAe,EACfC,IAAY,EACZC,KAAa,EACJ;EACT,OACEF,OAAO,OAAqB,IAC5BC,IAAI,OAAqB,IACzB,IAAAE,4CAAiB,EAACD,KAAK,CAAC;AAE5B;AAOA,MAAME,mBAAmB,GAAG,IAAIC,GAAG,CAAC,CAClC,OAAO,EACP,MAAM,EACN,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,EAER,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,OAAO,EAEP,MAAM,EACN,WAAW,EAEX,MAAM,EACN,OAAO,CACR,CAAC;AAEK,SAASC,iBAAiBA,CAACC,IAAY,EAAW;EACvD,OAAOH,mBAAmB,CAACI,GAAG,CAACD,IAAI,CAAC;AACtC"}

39
node_modules/@babel/parser/lib/util/location.js generated vendored Normal file
View File

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SourceLocation = exports.Position = void 0;
exports.createPositionWithColumnOffset = createPositionWithColumnOffset;
class Position {
constructor(line, col, index) {
this.line = void 0;
this.column = void 0;
this.index = void 0;
this.line = line;
this.column = col;
this.index = index;
}
}
exports.Position = Position;
class SourceLocation {
constructor(start, end) {
this.start = void 0;
this.end = void 0;
this.filename = void 0;
this.identifierName = void 0;
this.start = start;
this.end = end;
}
}
exports.SourceLocation = SourceLocation;
function createPositionWithColumnOffset(position, columnOffset) {
const {
line,
column,
index
} = position;
return new Position(line, column + columnOffset, index + columnOffset);
}
//# sourceMappingURL=location.js.map

1
node_modules/@babel/parser/lib/util/location.js.map generated vendored Normal file
View File

@ -0,0 +1 @@
{"version":3,"names":["Position","constructor","line","col","index","column","exports","SourceLocation","start","end","filename","identifierName","createPositionWithColumnOffset","position","columnOffset"],"sources":["../../src/util/location.ts"],"sourcesContent":["export type Pos = {\n start: number;\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n index: number;\n\n constructor(line: number, col: number, index: number) {\n this.line = line;\n this.column = col;\n this.index = index;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: string | undefined | null;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n/**\n * creates a new position with a non-zero column offset from the given position.\n * This function should be only be used when we create AST node out of the token\n * boundaries, such as TemplateElement ends before tt.templateNonTail. This\n * function does not skip whitespaces.\n */\nexport function createPositionWithColumnOffset(\n position: Position,\n columnOffset: number,\n) {\n const { line, column, index } = position;\n return new Position(line, column + columnOffset, index + columnOffset);\n}\n"],"mappings":";;;;;;;AAOO,MAAMA,QAAQ,CAAC;EAKpBC,WAAWA,CAACC,IAAY,EAAEC,GAAW,EAAEC,KAAa,EAAE;IAAA,KAJtDF,IAAI;IAAA,KACJG,MAAM;IAAA,KACND,KAAK;IAGH,IAAI,CAACF,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACG,MAAM,GAAGF,GAAG;IACjB,IAAI,CAACC,KAAK,GAAGA,KAAK;EACpB;AACF;AAACE,OAAA,CAAAN,QAAA,GAAAA,QAAA;AAEM,MAAMO,cAAc,CAAC;EAM1BN,WAAWA,CAACO,KAAe,EAAEC,GAAc,EAAE;IAAA,KAL7CD,KAAK;IAAA,KACLC,GAAG;IAAA,KACHC,QAAQ;IAAA,KACRC,cAAc;IAGZ,IAAI,CAACH,KAAK,GAAGA,KAAK;IAElB,IAAI,CAACC,GAAG,GAAGA,GAAG;EAChB;AACF;AAACH,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAQM,SAASK,8BAA8BA,CAC5CC,QAAkB,EAClBC,YAAoB,EACpB;EACA,MAAM;IAAEZ,IAAI;IAAEG,MAAM;IAAED;EAAM,CAAC,GAAGS,QAAQ;EACxC,OAAO,IAAIb,QAAQ,CAACE,IAAI,EAAEG,MAAM,GAAGS,YAAY,EAAEV,KAAK,GAAGU,YAAY,CAAC;AACxE"}

View File

@ -0,0 +1,49 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.PARAM_YIELD = exports.PARAM_RETURN = exports.PARAM_IN = exports.PARAM_AWAIT = exports.PARAM = void 0;
exports.functionFlags = functionFlags;
const PARAM = 0b0000,
PARAM_YIELD = 0b0001,
PARAM_AWAIT = 0b0010,
PARAM_RETURN = 0b0100,
PARAM_IN = 0b1000;
exports.PARAM_IN = PARAM_IN;
exports.PARAM_RETURN = PARAM_RETURN;
exports.PARAM_AWAIT = PARAM_AWAIT;
exports.PARAM_YIELD = PARAM_YIELD;
exports.PARAM = PARAM;
class ProductionParameterHandler {
constructor() {
this.stacks = [];
}
enter(flags) {
this.stacks.push(flags);
}
exit() {
this.stacks.pop();
}
currentFlags() {
return this.stacks[this.stacks.length - 1];
}
get hasAwait() {
return (this.currentFlags() & PARAM_AWAIT) > 0;
}
get hasYield() {
return (this.currentFlags() & PARAM_YIELD) > 0;
}
get hasReturn() {
return (this.currentFlags() & PARAM_RETURN) > 0;
}
get hasIn() {
return (this.currentFlags() & PARAM_IN) > 0;
}
}
exports.default = ProductionParameterHandler;
function functionFlags(isAsync, isGenerator) {
return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);
}
//# sourceMappingURL=production-parameter.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["PARAM","PARAM_YIELD","PARAM_AWAIT","PARAM_RETURN","PARAM_IN","exports","ProductionParameterHandler","constructor","stacks","enter","flags","push","exit","pop","currentFlags","length","hasAwait","hasYield","hasReturn","hasIn","default","functionFlags","isAsync","isGenerator"],"sources":["../../src/util/production-parameter.ts"],"sourcesContent":["export const // Initial Parameter flags\n PARAM = 0b0000,\n // track [Yield] production parameter\n PARAM_YIELD = 0b0001,\n // track [Await] production parameter\n PARAM_AWAIT = 0b0010,\n // track [Return] production parameter\n PARAM_RETURN = 0b0100,\n PARAM_IN = 0b1000; // track [In] production parameter\n\n// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport type ParamKind = number;\n\n// todo(flow->ts) - check if more granular type can be used,\n// type below is not good because things like PARAM_AWAIT|PARAM_YIELD are not included\n// export type ParamKind =\n// | typeof PARAM\n// | typeof PARAM_AWAIT\n// | typeof PARAM_IN\n// | typeof PARAM_RETURN\n// | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array<number> = [];\n enter(flags: number) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): number {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n\n get hasIn(): boolean {\n return (this.currentFlags() & PARAM_IN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n"],"mappings":";;;;;;;AAAO,MACLA,KAAK,GAAG,MAAM;EAEdC,WAAW,GAAG,MAAM;EAEpBC,WAAW,GAAG,MAAM;EAEpBC,YAAY,GAAG,MAAM;EACrBC,QAAQ,GAAG,MAAM;AAACC,OAAA,CAAAD,QAAA,GAAAA,QAAA;AAAAC,OAAA,CAAAF,YAAA,GAAAA,YAAA;AAAAE,OAAA,CAAAH,WAAA,GAAAA,WAAA;AAAAG,OAAA,CAAAJ,WAAA,GAAAA,WAAA;AAAAI,OAAA,CAAAL,KAAA,GAAAA,KAAA;AAkCL,MAAMM,0BAA0B,CAAC;EAAAC,YAAA;IAAA,KAC9CC,MAAM,GAAkB,EAAE;EAAA;EAC1BC,KAAKA,CAACC,KAAa,EAAE;IACnB,IAAI,CAACF,MAAM,CAACG,IAAI,CAACD,KAAK,CAAC;EACzB;EAEAE,IAAIA,CAAA,EAAG;IACL,IAAI,CAACJ,MAAM,CAACK,GAAG,CAAC,CAAC;EACnB;EAEAC,YAAYA,CAAA,EAAW;IACrB,OAAO,IAAI,CAACN,MAAM,CAAC,IAAI,CAACA,MAAM,CAACO,MAAM,GAAG,CAAC,CAAC;EAC5C;EAEA,IAAIC,QAAQA,CAAA,EAAY;IACtB,OAAO,CAAC,IAAI,CAACF,YAAY,CAAC,CAAC,GAAGZ,WAAW,IAAI,CAAC;EAChD;EAEA,IAAIe,QAAQA,CAAA,EAAY;IACtB,OAAO,CAAC,IAAI,CAACH,YAAY,CAAC,CAAC,GAAGb,WAAW,IAAI,CAAC;EAChD;EAEA,IAAIiB,SAASA,CAAA,EAAY;IACvB,OAAO,CAAC,IAAI,CAACJ,YAAY,CAAC,CAAC,GAAGX,YAAY,IAAI,CAAC;EACjD;EAEA,IAAIgB,KAAKA,CAAA,EAAY;IACnB,OAAO,CAAC,IAAI,CAACL,YAAY,CAAC,CAAC,GAAGV,QAAQ,IAAI,CAAC;EAC7C;AACF;AAACC,OAAA,CAAAe,OAAA,GAAAd,0BAAA;AAEM,SAASe,aAAaA,CAC3BC,OAAgB,EAChBC,WAAoB,EACT;EACX,OAAO,CAACD,OAAO,GAAGpB,WAAW,GAAG,CAAC,KAAKqB,WAAW,GAAGtB,WAAW,GAAG,CAAC,CAAC;AACtE"}

161
node_modules/@babel/parser/lib/util/scope.js generated vendored Normal file
View File

@ -0,0 +1,161 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.Scope = void 0;
var _scopeflags = require("./scopeflags");
var _parseError = require("../parse-error");
class Scope {
constructor(flags) {
this.var = new Set();
this.lexical = new Set();
this.functions = new Set();
this.flags = flags;
}
}
exports.Scope = Scope;
class ScopeHandler {
constructor(parser, inModule) {
this.parser = void 0;
this.scopeStack = [];
this.inModule = void 0;
this.undefinedExports = new Map();
this.parser = parser;
this.inModule = inModule;
}
get inTopLevel() {
return (this.currentScope().flags & _scopeflags.ScopeFlag.PROGRAM) > 0;
}
get inFunction() {
return (this.currentVarScopeFlags() & _scopeflags.ScopeFlag.FUNCTION) > 0;
}
get allowSuper() {
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.SUPER) > 0;
}
get allowDirectSuper() {
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.DIRECT_SUPER) > 0;
}
get inClass() {
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.CLASS) > 0;
}
get inClassAndNotInNonArrowFunction() {
const flags = this.currentThisScopeFlags();
return (flags & _scopeflags.ScopeFlag.CLASS) > 0 && (flags & _scopeflags.ScopeFlag.FUNCTION) === 0;
}
get inStaticBlock() {
for (let i = this.scopeStack.length - 1;; i--) {
const {
flags
} = this.scopeStack[i];
if (flags & _scopeflags.ScopeFlag.STATIC_BLOCK) {
return true;
}
if (flags & (_scopeflags.ScopeFlag.VAR | _scopeflags.ScopeFlag.CLASS)) {
return false;
}
}
}
get inNonArrowFunction() {
return (this.currentThisScopeFlags() & _scopeflags.ScopeFlag.FUNCTION) > 0;
}
get treatFunctionsAsVar() {
return this.treatFunctionsAsVarInScope(this.currentScope());
}
createScope(flags) {
return new Scope(flags);
}
enter(flags) {
this.scopeStack.push(this.createScope(flags));
}
exit() {
const scope = this.scopeStack.pop();
return scope.flags;
}
treatFunctionsAsVarInScope(scope) {
return !!(scope.flags & (_scopeflags.ScopeFlag.FUNCTION | _scopeflags.ScopeFlag.STATIC_BLOCK) || !this.parser.inModule && scope.flags & _scopeflags.ScopeFlag.PROGRAM);
}
declareName(name, bindingType, loc) {
let scope = this.currentScope();
if (bindingType & _scopeflags.BindingFlag.SCOPE_LEXICAL || bindingType & _scopeflags.BindingFlag.SCOPE_FUNCTION) {
this.checkRedeclarationInScope(scope, name, bindingType, loc);
if (bindingType & _scopeflags.BindingFlag.SCOPE_FUNCTION) {
scope.functions.add(name);
} else {
scope.lexical.add(name);
}
if (bindingType & _scopeflags.BindingFlag.SCOPE_LEXICAL) {
this.maybeExportDefined(scope, name);
}
} else if (bindingType & _scopeflags.BindingFlag.SCOPE_VAR) {
for (let i = this.scopeStack.length - 1; i >= 0; --i) {
scope = this.scopeStack[i];
this.checkRedeclarationInScope(scope, name, bindingType, loc);
scope.var.add(name);
this.maybeExportDefined(scope, name);
if (scope.flags & _scopeflags.ScopeFlag.VAR) break;
}
}
if (this.parser.inModule && scope.flags & _scopeflags.ScopeFlag.PROGRAM) {
this.undefinedExports.delete(name);
}
}
maybeExportDefined(scope, name) {
if (this.parser.inModule && scope.flags & _scopeflags.ScopeFlag.PROGRAM) {
this.undefinedExports.delete(name);
}
}
checkRedeclarationInScope(scope, name, bindingType, loc) {
if (this.isRedeclaredInScope(scope, name, bindingType)) {
this.parser.raise(_parseError.Errors.VarRedeclaration, {
at: loc,
identifierName: name
});
}
}
isRedeclaredInScope(scope, name, bindingType) {
if (!(bindingType & _scopeflags.BindingFlag.KIND_VALUE)) return false;
if (bindingType & _scopeflags.BindingFlag.SCOPE_LEXICAL) {
return scope.lexical.has(name) || scope.functions.has(name) || scope.var.has(name);
}
if (bindingType & _scopeflags.BindingFlag.SCOPE_FUNCTION) {
return scope.lexical.has(name) || !this.treatFunctionsAsVarInScope(scope) && scope.var.has(name);
}
return scope.lexical.has(name) && !(scope.flags & _scopeflags.ScopeFlag.SIMPLE_CATCH && scope.lexical.values().next().value === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.has(name);
}
checkLocalExport(id) {
const {
name
} = id;
const topLevelScope = this.scopeStack[0];
if (!topLevelScope.lexical.has(name) && !topLevelScope.var.has(name) && !topLevelScope.functions.has(name)) {
this.undefinedExports.set(name, id.loc.start);
}
}
currentScope() {
return this.scopeStack[this.scopeStack.length - 1];
}
currentVarScopeFlags() {
for (let i = this.scopeStack.length - 1;; i--) {
const {
flags
} = this.scopeStack[i];
if (flags & _scopeflags.ScopeFlag.VAR) {
return flags;
}
}
}
currentThisScopeFlags() {
for (let i = this.scopeStack.length - 1;; i--) {
const {
flags
} = this.scopeStack[i];
if (flags & (_scopeflags.ScopeFlag.VAR | _scopeflags.ScopeFlag.CLASS) && !(flags & _scopeflags.ScopeFlag.ARROW)) {
return flags;
}
}
}
}
exports.default = ScopeHandler;
//# sourceMappingURL=scope.js.map

1
node_modules/@babel/parser/lib/util/scope.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

67
node_modules/@babel/parser/lib/util/scopeflags.js generated vendored Normal file
View File

@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ScopeFlag = exports.ClassElementType = exports.BindingFlag = void 0;
var ScopeFlag = {
OTHER: 0,
PROGRAM: 1,
FUNCTION: 2,
ARROW: 4,
SIMPLE_CATCH: 8,
SUPER: 16,
DIRECT_SUPER: 32,
CLASS: 64,
STATIC_BLOCK: 128,
TS_MODULE: 256,
VAR: 387
};
exports.ScopeFlag = ScopeFlag;
var BindingFlag = {
KIND_VALUE: 1,
KIND_TYPE: 2,
SCOPE_VAR: 4,
SCOPE_LEXICAL: 8,
SCOPE_FUNCTION: 16,
SCOPE_OUTSIDE: 32,
FLAG_NONE: 64,
FLAG_CLASS: 128,
FLAG_TS_ENUM: 256,
FLAG_TS_CONST_ENUM: 512,
FLAG_TS_EXPORT_ONLY: 1024,
FLAG_FLOW_DECLARE_FN: 2048,
FLAG_TS_IMPORT: 4096,
FLAG_NO_LET_IN_LEXICAL: 8192,
TYPE_CLASS: 8331,
TYPE_LEXICAL: 8201,
TYPE_CATCH_PARAM: 9,
TYPE_VAR: 5,
TYPE_FUNCTION: 17,
TYPE_TS_INTERFACE: 130,
TYPE_TS_TYPE: 2,
TYPE_TS_ENUM: 8459,
TYPE_TS_AMBIENT: 1024,
TYPE_NONE: 64,
TYPE_OUTSIDE: 65,
TYPE_TS_CONST_ENUM: 8971,
TYPE_TS_NAMESPACE: 1024,
TYPE_TS_TYPE_IMPORT: 4098,
TYPE_TS_VALUE_IMPORT: 4096,
TYPE_FLOW_DECLARE_FN: 2048
};
exports.BindingFlag = BindingFlag;
var ClassElementType = {
OTHER: 0,
FLAG_STATIC: 4,
KIND_GETTER: 2,
KIND_SETTER: 1,
KIND_ACCESSOR: 3,
STATIC_GETTER: 6,
STATIC_SETTER: 5,
INSTANCE_GETTER: 2,
INSTANCE_SETTER: 1
};
exports.ClassElementType = ClassElementType;
//# sourceMappingURL=scopeflags.js.map

File diff suppressed because one or more lines are too long

59
node_modules/@babel/parser/lib/util/whitespace.js generated vendored Normal file
View File

@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isNewLine = isNewLine;
exports.isWhitespace = isWhitespace;
exports.skipWhiteSpaceToLineBreak = exports.skipWhiteSpaceInLine = exports.skipWhiteSpace = exports.lineBreakG = exports.lineBreak = void 0;
const lineBreak = /\r\n?|[\n\u2028\u2029]/;
exports.lineBreak = lineBreak;
const lineBreakG = new RegExp(lineBreak.source, "g");
exports.lineBreakG = lineBreakG;
function isNewLine(code) {
switch (code) {
case 10:
case 13:
case 8232:
case 8233:
return true;
default:
return false;
}
}
const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
exports.skipWhiteSpace = skipWhiteSpace;
const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
exports.skipWhiteSpaceInLine = skipWhiteSpaceInLine;
const skipWhiteSpaceToLineBreak = new RegExp("(?=(" + skipWhiteSpaceInLine.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y");
exports.skipWhiteSpaceToLineBreak = skipWhiteSpaceToLineBreak;
function isWhitespace(code) {
switch (code) {
case 0x0009:
case 0x000b:
case 0x000c:
case 32:
case 160:
case 5760:
case 0x2000:
case 0x2001:
case 0x2002:
case 0x2003:
case 0x2004:
case 0x2005:
case 0x2006:
case 0x2007:
case 0x2008:
case 0x2009:
case 0x200a:
case 0x202f:
case 0x205f:
case 0x3000:
case 0xfeff:
return true;
default:
return false;
}
}
//# sourceMappingURL=whitespace.js.map

View File

@ -0,0 +1 @@
{"version":3,"names":["lineBreak","exports","lineBreakG","RegExp","source","isNewLine","code","skipWhiteSpace","skipWhiteSpaceInLine","skipWhiteSpaceToLineBreak","isWhitespace"],"sources":["../../src/util/whitespace.ts"],"sourcesContent":["import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// Skip whitespace and single-line comments, including /* no newline here */.\n// After this RegExp matches, its lastIndex points to a line terminator, or\n// the start of multi-line comment (which is effectively a line terminator),\n// or the end of string.\nexport const skipWhiteSpaceToLineBreak = new RegExp(\n // Unfortunately JS doesn't support Perl's atomic /(?>pattern)/ or\n // possessive quantifiers, so we use a trick to prevent backtracking\n // when the look-ahead for line terminator fails.\n \"(?=(\" +\n // Capture the whitespace and comments that should be skipped inside\n // a look-ahead assertion, and then re-match the group as a unit.\n skipWhiteSpaceInLine.source +\n \"))\\\\1\" +\n // Look-ahead for either line terminator, start of multi-line comment,\n // or end of string.\n /(?=[\\n\\r\\u2028\\u2029]|\\/\\*(?!.*?\\*\\/)|$)/.source,\n \"y\", // sticky\n);\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n"],"mappings":";;;;;;;;AAIO,MAAMA,SAAS,GAAG,wBAAwB;AAACC,OAAA,CAAAD,SAAA,GAAAA,SAAA;AAC3C,MAAME,UAAU,GAAG,IAAIC,MAAM,CAACH,SAAS,CAACI,MAAM,EAAE,GAAG,CAAC;AAACH,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAGrD,SAASG,SAASA,CAACC,IAAY,EAAW;EAC/C,QAAQA,IAAI;IACV;IACA;IACA;IACA;MACE,OAAO,IAAI;IAEb;MACE,OAAO,KAAK;EAChB;AACF;AAEO,MAAMC,cAAc,GAAG,+BAA+B;AAACN,OAAA,CAAAM,cAAA,GAAAA,cAAA;AAEvD,MAAMC,oBAAoB,GAC/B,gDAAgD;AAACP,OAAA,CAAAO,oBAAA,GAAAA,oBAAA;AAM5C,MAAMC,yBAAyB,GAAG,IAAIN,MAAM,CAIjD,MAAM,GAGJK,oBAAoB,CAACJ,MAAM,GAC3B,OAAO,GAGP,0CAA0C,CAACA,MAAM,EACnD,GACF,CAAC;AAACH,OAAA,CAAAQ,yBAAA,GAAAA,yBAAA;AAGK,SAASC,YAAYA,CAACJ,IAAY,EAAW;EAClD,QAAQA,IAAI;IACV,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX;IACA;IACA;IACA,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,MAAM;MACT,OAAO,IAAI;IAEb;MACE,OAAO,KAAK;EAChB;AACF"}