@sanity/cli 3.69.1-corel.489 → 3.70.1-corel.513
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -5887,7 +5887,6 @@ function tryGetVersion(modulePath) {
|
|
5887
5887
|
const PACKAGES_TO_EXCLUDE = [
|
5888
5888
|
"@sanity/block-content-to-html",
|
5889
5889
|
"@sanity/block-content-to-react",
|
5890
|
-
"@sanity/block-tools",
|
5891
5890
|
"@sanity/client"
|
5892
5891
|
], defaultOptions = {
|
5893
5892
|
includeCli: !0
|
@@ -26703,32 +26702,34 @@ async function applyEnvVariables(root2, envData, targetName = ".env") {
|
|
26703
26702
|
const templatePath = await Promise.any(
|
26704
26703
|
templateValidator.ENV_TEMPLATE_FILES.map(async (file) => (await fs.access(path$3.join(root2, file)), file))
|
26705
26704
|
).catch(() => {
|
26706
|
-
throw new Error("Could not find .env.template, .env.example or .env.local.example file");
|
26707
26705
|
});
|
26708
|
-
|
26709
|
-
|
26710
|
-
const
|
26711
|
-
|
26712
|
-
|
26713
|
-
|
26714
|
-
|
26715
|
-
|
26706
|
+
if (templatePath)
|
26707
|
+
try {
|
26708
|
+
const templateContent = await fs.readFile(path$3.join(root2, templatePath), "utf8"), { projectId, dataset, readToken = "" } = envData, findAndReplaceVariable = (content, varRegex, value, useQuotes2) => {
|
26709
|
+
const varPattern = typeof varRegex == "string" ? varRegex : varRegex.source, pattern = new RegExp(`.*${varPattern}=.*$`, "gm"), matches = content.matchAll(pattern);
|
26710
|
+
return Array.from(matches).reduce((updatedContent, match2) => {
|
26711
|
+
if (!match2[0]) return updatedContent;
|
26712
|
+
const varName = match2[0].split("=")[0].trim();
|
26713
|
+
return updatedContent.replace(
|
26714
|
+
new RegExp(`${varName}=.*$`, "gm"),
|
26715
|
+
`${varName}=${useQuotes2 ? `"${value}"` : value}`
|
26716
|
+
);
|
26717
|
+
}, content);
|
26718
|
+
};
|
26719
|
+
let envContent = templateContent;
|
26720
|
+
const vars = [
|
26721
|
+
{ pattern: ENV_VAR.PROJECT_ID, value: projectId },
|
26722
|
+
{ pattern: ENV_VAR.DATASET, value: dataset },
|
26723
|
+
{ pattern: ENV_VAR.READ_TOKEN, value: readToken }
|
26724
|
+
], useQuotes = templateContent.includes('="');
|
26725
|
+
for (const { pattern, value } of vars)
|
26726
|
+
envContent = findAndReplaceVariable(envContent, pattern, value, useQuotes);
|
26727
|
+
await fs.writeFile(path$3.join(root2, targetName), envContent);
|
26728
|
+
} catch {
|
26729
|
+
throw new Error(
|
26730
|
+
"Failed to set environment variables. This could be due to file permissions or the .env file format. See https://www.sanity.io/docs/environment-variables for details on environment variable setup."
|
26716
26731
|
);
|
26717
|
-
}
|
26718
|
-
let envContent = templateContent;
|
26719
|
-
const vars = [
|
26720
|
-
{ pattern: ENV_VAR.PROJECT_ID, value: projectId },
|
26721
|
-
{ pattern: ENV_VAR.DATASET, value: dataset },
|
26722
|
-
{ pattern: ENV_VAR.READ_TOKEN, value: readToken }
|
26723
|
-
], useQuotes = templateContent.includes('="');
|
26724
|
-
for (const { pattern, value } of vars)
|
26725
|
-
envContent = findAndReplaceVariable(envContent, pattern, value, useQuotes);
|
26726
|
-
await fs.writeFile(path$3.join(root2, targetName), envContent);
|
26727
|
-
} catch {
|
26728
|
-
throw new Error(
|
26729
|
-
"Failed to set environment variables. This could be due to file permissions or the .env file format. See https://www.sanity.io/docs/environment-variables for details on environment variable setup."
|
26730
|
-
);
|
26731
|
-
}
|
26732
|
+
}
|
26732
26733
|
}
|
26733
26734
|
async function tryApplyPackageName(root2, name) {
|
26734
26735
|
try {
|
@@ -37707,7 +37708,46 @@ function requireLib$1() {
|
|
37707
37708
|
}
|
37708
37709
|
return ParseErrorConstructors;
|
37709
37710
|
}
|
37710
|
-
const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors))
|
37711
|
+
const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
|
37712
|
+
function createDefaultOptions() {
|
37713
|
+
return {
|
37714
|
+
sourceType: "script",
|
37715
|
+
sourceFilename: void 0,
|
37716
|
+
startIndex: 0,
|
37717
|
+
startColumn: 0,
|
37718
|
+
startLine: 1,
|
37719
|
+
allowAwaitOutsideFunction: !1,
|
37720
|
+
allowReturnOutsideFunction: !1,
|
37721
|
+
allowNewTargetOutsideFunction: !1,
|
37722
|
+
allowImportExportEverywhere: !1,
|
37723
|
+
allowSuperOutsideMethod: !1,
|
37724
|
+
allowUndeclaredExports: !1,
|
37725
|
+
plugins: [],
|
37726
|
+
strictMode: null,
|
37727
|
+
ranges: !1,
|
37728
|
+
tokens: !1,
|
37729
|
+
createImportExpressions: !1,
|
37730
|
+
createParenthesizedExpressions: !1,
|
37731
|
+
errorRecovery: !1,
|
37732
|
+
attachComment: !0,
|
37733
|
+
annexB: !0
|
37734
|
+
};
|
37735
|
+
}
|
37736
|
+
function getOptions(opts) {
|
37737
|
+
const options2 = createDefaultOptions();
|
37738
|
+
if (opts == null)
|
37739
|
+
return options2;
|
37740
|
+
if (opts.annexB != null && opts.annexB !== !1)
|
37741
|
+
throw new Error("The `annexB` option can only be set to `false`.");
|
37742
|
+
for (const key2 of Object.keys(options2))
|
37743
|
+
opts[key2] != null && (options2[key2] = opts[key2]);
|
37744
|
+
if (options2.startLine === 1)
|
37745
|
+
opts.startIndex == null && options2.startColumn > 0 ? options2.startIndex = options2.startColumn : opts.startColumn == null && options2.startIndex > 0 && (options2.startColumn = options2.startIndex);
|
37746
|
+
else if ((opts.startColumn == null || opts.startIndex == null) && opts.startIndex != null)
|
37747
|
+
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
37748
|
+
return options2;
|
37749
|
+
}
|
37750
|
+
const {
|
37711
37751
|
defineProperty: defineProperty2
|
37712
37752
|
} = Object, toUnenumerable = (object, key2) => {
|
37713
37753
|
object && defineProperty2(object, key2, {
|
@@ -37721,7 +37761,7 @@ function requireLib$1() {
|
|
37721
37761
|
var estree = (superClass) => class extends superClass {
|
37722
37762
|
parse() {
|
37723
37763
|
const file = toESTreeLocation(super.parse());
|
37724
|
-
return this.
|
37764
|
+
return this.optionFlags & 128 && (file.tokens = file.tokens.map(toESTreeLocation)), file;
|
37725
37765
|
}
|
37726
37766
|
parseRegExpLiteral({
|
37727
37767
|
pattern,
|
@@ -37791,9 +37831,6 @@ function requireLib$1() {
|
|
37791
37831
|
const directiveStatements = node.directives.map((d) => this.directiveToStmt(d));
|
37792
37832
|
node.body = directiveStatements.concat(node.body), delete node.directives;
|
37793
37833
|
}
|
37794
|
-
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
37795
|
-
this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", !0), method.typeParameters && (method.value.typeParameters = method.typeParameters, delete method.typeParameters), classBody.body.push(method);
|
37796
|
-
}
|
37797
37834
|
parsePrivateName() {
|
37798
37835
|
const node = super.parsePrivateName();
|
37799
37836
|
return this.getPluginOption("estree", "classFeatures") ? this.convertPrivateNameToPrivateIdentifier(node) : node;
|
@@ -37817,7 +37854,11 @@ function requireLib$1() {
|
|
37817
37854
|
}
|
37818
37855
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope = !1) {
|
37819
37856
|
let funcNode = this.startNode();
|
37820
|
-
|
37857
|
+
funcNode.kind = node.kind, funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope), funcNode.type = "FunctionExpression", delete funcNode.kind, node.value = funcNode;
|
37858
|
+
const {
|
37859
|
+
typeParameters
|
37860
|
+
} = node;
|
37861
|
+
return typeParameters && (delete node.typeParameters, funcNode.typeParameters = typeParameters, funcNode.start = typeParameters.start, funcNode.loc.start = typeParameters.loc.start), type2 === "ClassPrivateMethod" && (node.computed = !1), this.finishNode(node, "MethodDefinition");
|
37821
37862
|
}
|
37822
37863
|
nameIsConstructor(key2) {
|
37823
37864
|
return key2.type === "Literal" ? key2.value === "constructor" : super.nameIsConstructor(key2);
|
@@ -38721,6 +38762,12 @@ function requireLib$1() {
|
|
38721
38762
|
case "ImportDeclaration":
|
38722
38763
|
adjustInnerComments(node, node.specifiers, commentWS);
|
38723
38764
|
break;
|
38765
|
+
case "TSEnumDeclaration":
|
38766
|
+
adjustInnerComments(node, node.members, commentWS);
|
38767
|
+
break;
|
38768
|
+
case "TSEnumBody":
|
38769
|
+
adjustInnerComments(node, node.members, commentWS);
|
38770
|
+
break;
|
38724
38771
|
default:
|
38725
38772
|
setInnerComments(node, comments2);
|
38726
38773
|
}
|
@@ -39138,7 +39185,7 @@ function requireLib$1() {
|
|
39138
39185
|
class Tokenizer extends CommentsParser {
|
39139
39186
|
constructor(options2, input2) {
|
39140
39187
|
super(), this.isLookahead = void 0, this.tokens = [], this.errorHandlers_readInt = {
|
39141
|
-
invalidDigit: (pos2, lineStart, curLine, radix) => this.
|
39188
|
+
invalidDigit: (pos2, lineStart, curLine, radix) => this.optionFlags & 1024 ? (this.raise(Errors.InvalidDigit, buildPosition(pos2, lineStart, curLine), {
|
39142
39189
|
radix
|
39143
39190
|
}), !0) : !1,
|
39144
39191
|
numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence),
|
@@ -39164,7 +39211,7 @@ function requireLib$1() {
|
|
39164
39211
|
this.tokens.length = this.state.tokensLength, this.tokens.push(token2), ++this.state.tokensLength;
|
39165
39212
|
}
|
39166
39213
|
next() {
|
39167
|
-
this.checkKeywordEscapes(), this.
|
39214
|
+
this.checkKeywordEscapes(), this.optionFlags & 128 && this.pushToken(new Token(this.state)), this.state.lastTokEndLoc = this.state.endLoc, this.state.lastTokStartLoc = this.state.startLoc, this.nextToken();
|
39168
39215
|
}
|
39169
39216
|
eat(type2) {
|
39170
39217
|
return this.match(type2) ? (this.next(), !0) : !1;
|
@@ -39249,7 +39296,7 @@ function requireLib$1() {
|
|
39249
39296
|
end: this.sourceToOffsetPos(end + commentEnd.length),
|
39250
39297
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
39251
39298
|
};
|
39252
|
-
return this.
|
39299
|
+
return this.optionFlags & 128 && this.pushToken(comment), comment;
|
39253
39300
|
}
|
39254
39301
|
skipLineComment(startSkip) {
|
39255
39302
|
const start = this.state.pos;
|
@@ -39267,10 +39314,10 @@ function requireLib$1() {
|
|
39267
39314
|
end: this.sourceToOffsetPos(end),
|
39268
39315
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
39269
39316
|
};
|
39270
|
-
return this.
|
39317
|
+
return this.optionFlags & 128 && this.pushToken(comment), comment;
|
39271
39318
|
}
|
39272
39319
|
skipSpace() {
|
39273
|
-
const spaceStart = this.state.pos, comments2 = [];
|
39320
|
+
const spaceStart = this.state.pos, comments2 = this.optionFlags & 2048 ? [] : null;
|
39274
39321
|
loop: for (; this.state.pos < this.length; ) {
|
39275
39322
|
const ch = this.input.charCodeAt(this.state.pos);
|
39276
39323
|
switch (ch) {
|
@@ -39290,12 +39337,12 @@ function requireLib$1() {
|
|
39290
39337
|
switch (this.input.charCodeAt(this.state.pos + 1)) {
|
39291
39338
|
case 42: {
|
39292
39339
|
const comment = this.skipBlockComment("*/");
|
39293
|
-
comment !== void 0 && (this.addComment(comment),
|
39340
|
+
comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
|
39294
39341
|
break;
|
39295
39342
|
}
|
39296
39343
|
case 47: {
|
39297
39344
|
const comment = this.skipLineComment(2);
|
39298
|
-
comment !== void 0 && (this.addComment(comment),
|
39345
|
+
comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
|
39299
39346
|
break;
|
39300
39347
|
}
|
39301
39348
|
default:
|
@@ -39305,25 +39352,25 @@ function requireLib$1() {
|
|
39305
39352
|
default:
|
39306
39353
|
if (isWhitespace(ch))
|
39307
39354
|
++this.state.pos;
|
39308
|
-
else if (ch === 45 && !this.inModule && this.
|
39355
|
+
else if (ch === 45 && !this.inModule && this.optionFlags & 4096) {
|
39309
39356
|
const pos2 = this.state.pos;
|
39310
39357
|
if (this.input.charCodeAt(pos2 + 1) === 45 && this.input.charCodeAt(pos2 + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
|
39311
39358
|
const comment = this.skipLineComment(3);
|
39312
|
-
comment !== void 0 && (this.addComment(comment),
|
39359
|
+
comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
|
39313
39360
|
} else
|
39314
39361
|
break loop;
|
39315
|
-
} else if (ch === 60 && !this.inModule && this.
|
39362
|
+
} else if (ch === 60 && !this.inModule && this.optionFlags & 4096) {
|
39316
39363
|
const pos2 = this.state.pos;
|
39317
39364
|
if (this.input.charCodeAt(pos2 + 1) === 33 && this.input.charCodeAt(pos2 + 2) === 45 && this.input.charCodeAt(pos2 + 3) === 45) {
|
39318
39365
|
const comment = this.skipLineComment(4);
|
39319
|
-
comment !== void 0 && (this.addComment(comment),
|
39366
|
+
comment !== void 0 && (this.addComment(comment), comments2?.push(comment));
|
39320
39367
|
} else
|
39321
39368
|
break loop;
|
39322
39369
|
} else
|
39323
39370
|
break loop;
|
39324
39371
|
}
|
39325
39372
|
}
|
39326
|
-
if (comments2
|
39373
|
+
if (comments2?.length > 0) {
|
39327
39374
|
const end = this.state.pos, commentWhitespace = {
|
39328
39375
|
start: this.sourceToOffsetPos(spaceStart),
|
39329
39376
|
end: this.sourceToOffsetPos(end),
|
@@ -39790,7 +39837,7 @@ function requireLib$1() {
|
|
39790
39837
|
}
|
39791
39838
|
raise(toParseError, at, details = {}) {
|
39792
39839
|
const loc = at instanceof Position ? at : at.loc.start, error2 = toParseError(loc, details);
|
39793
|
-
if (!this.
|
39840
|
+
if (!(this.optionFlags & 1024)) throw error2;
|
39794
39841
|
return this.isLookahead || this.state.errors.push(error2), error2;
|
39795
39842
|
}
|
39796
39843
|
raiseOverwrite(toParseError, at, details = {}) {
|
@@ -40166,7 +40213,7 @@ function requireLib$1() {
|
|
40166
40213
|
}
|
40167
40214
|
class Node {
|
40168
40215
|
constructor(parser2, pos2, loc) {
|
40169
|
-
this.type = "", this.start = pos2, this.end = 0, this.loc = new SourceLocation(loc), parser2
|
40216
|
+
this.type = "", this.start = pos2, this.end = 0, this.loc = new SourceLocation(loc), parser2?.optionFlags & 64 && (this.range = [pos2, 0]), parser2 != null && parser2.filename && (this.loc.filename = parser2.filename);
|
40170
40217
|
}
|
40171
40218
|
}
|
40172
40219
|
const NodePrototype = Node.prototype;
|
@@ -40222,13 +40269,13 @@ function requireLib$1() {
|
|
40222
40269
|
return this.finishNodeAt(node, type2, this.state.lastTokEndLoc);
|
40223
40270
|
}
|
40224
40271
|
finishNodeAt(node, type2, endLoc) {
|
40225
|
-
return node.type = type2, node.end = endLoc.index, node.loc.end = endLoc, this.
|
40272
|
+
return node.type = type2, node.end = endLoc.index, node.loc.end = endLoc, this.optionFlags & 64 && (node.range[1] = endLoc.index), this.optionFlags & 2048 && this.processComment(node), node;
|
40226
40273
|
}
|
40227
40274
|
resetStartLocation(node, startLoc) {
|
40228
|
-
node.start = startLoc.index, node.loc.start = startLoc, this.
|
40275
|
+
node.start = startLoc.index, node.loc.start = startLoc, this.optionFlags & 64 && (node.range[0] = startLoc.index);
|
40229
40276
|
}
|
40230
40277
|
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
|
40231
|
-
node.end = endLoc.index, node.loc.end = endLoc, this.
|
40278
|
+
node.end = endLoc.index, node.loc.end = endLoc, this.optionFlags & 64 && (node.range[1] = endLoc.index);
|
40232
40279
|
}
|
40233
40280
|
resetStartLocationFromNode(node, locationNode) {
|
40234
40281
|
this.resetStartLocation(node, locationNode.loc.start);
|
@@ -40525,15 +40572,34 @@ function requireLib$1() {
|
|
40525
40572
|
} while (!this.match(48));
|
40526
40573
|
return this.expect(48), this.state.inType = oldInType, this.finishNode(node, "TypeParameterDeclaration");
|
40527
40574
|
}
|
40575
|
+
flowInTopLevelContext(cb) {
|
40576
|
+
if (this.curContext() !== types2.brace) {
|
40577
|
+
const oldContext = this.state.context;
|
40578
|
+
this.state.context = [oldContext[0]];
|
40579
|
+
try {
|
40580
|
+
return cb();
|
40581
|
+
} finally {
|
40582
|
+
this.state.context = oldContext;
|
40583
|
+
}
|
40584
|
+
} else
|
40585
|
+
return cb();
|
40586
|
+
}
|
40587
|
+
flowParseTypeParameterInstantiationInExpression() {
|
40588
|
+
if (this.reScan_lt() === 47)
|
40589
|
+
return this.flowParseTypeParameterInstantiation();
|
40590
|
+
}
|
40528
40591
|
flowParseTypeParameterInstantiation() {
|
40529
40592
|
const node = this.startNode(), oldInType = this.state.inType;
|
40530
|
-
|
40531
|
-
|
40532
|
-
|
40533
|
-
|
40534
|
-
|
40593
|
+
return this.state.inType = !0, node.params = [], this.flowInTopLevelContext(() => {
|
40594
|
+
this.expect(47);
|
40595
|
+
const oldNoAnonFunctionType = this.state.noAnonFunctionType;
|
40596
|
+
for (this.state.noAnonFunctionType = !1; !this.match(48); )
|
40597
|
+
node.params.push(this.flowParseType()), this.match(48) || this.expect(12);
|
40598
|
+
this.state.noAnonFunctionType = oldNoAnonFunctionType;
|
40599
|
+
}), this.state.inType = oldInType, !this.state.inType && this.curContext() === types2.brace && this.reScan_lt_gt(), this.expect(48), this.finishNode(node, "TypeParameterInstantiation");
|
40535
40600
|
}
|
40536
40601
|
flowParseTypeParameterInstantiationCallOrNew() {
|
40602
|
+
if (this.reScan_lt() !== 47) return;
|
40537
40603
|
const node = this.startNode(), oldInType = this.state.inType;
|
40538
40604
|
for (node.params = [], this.state.inType = !0, this.expect(47); !this.match(48); )
|
40539
40605
|
node.params.push(this.flowParseTypeOrImplicitInstantiation()), this.match(48) || this.expect(12);
|
@@ -41080,7 +41146,7 @@ function requireLib$1() {
|
|
41080
41146
|
method.variance && this.unexpected(method.variance.loc.start), delete method.variance, this.match(47) && (method.typeParameters = this.flowParseTypeParameterDeclaration()), super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
|
41081
41147
|
}
|
41082
41148
|
parseClassSuper(node) {
|
41083
|
-
if (super.parseClassSuper(node), node.superClass && this.match(47) && (node.superTypeParameters = this.
|
41149
|
+
if (super.parseClassSuper(node), node.superClass && (this.match(47) || this.match(51)) && (node.superTypeParameters = this.flowParseTypeParameterInstantiationInExpression()), this.isContextual(113)) {
|
41084
41150
|
this.next();
|
41085
41151
|
const implemented = node.implements = [];
|
41086
41152
|
do {
|
@@ -41277,8 +41343,8 @@ function requireLib$1() {
|
|
41277
41343
|
return subscriptState.stop = !0, base2;
|
41278
41344
|
this.next();
|
41279
41345
|
const node = this.startNodeAt(startLoc);
|
41280
|
-
return node.callee = base2, node.typeArguments = this.
|
41281
|
-
} else if (!noCalls && this.shouldParseTypes() && this.match(47)) {
|
41346
|
+
return node.callee = base2, node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(), this.expect(10), node.arguments = this.parseCallExpressionArguments(11), node.optional = !0, this.finishCallExpression(node, !0);
|
41347
|
+
} else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) {
|
41282
41348
|
const node = this.startNodeAt(startLoc);
|
41283
41349
|
node.callee = base2;
|
41284
41350
|
const result = this.tryParse(() => (node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(), this.expect(10), node.arguments = super.parseCallExpressionArguments(11), subscriptState.optionalChainMember && (node.optional = !1), this.finishCallExpression(node, subscriptState.optionalChainMember)));
|
@@ -41584,6 +41650,9 @@ function requireLib$1() {
|
|
41584
41650
|
const id = this.parseIdentifier();
|
41585
41651
|
return node.id = id, node.body = this.flowEnumBody(this.startNode(), id), this.finishNode(node, "EnumDeclaration");
|
41586
41652
|
}
|
41653
|
+
jsxParseOpeningElementAfterName(node) {
|
41654
|
+
return this.shouldParseTypes() && (this.match(47) || this.match(51)) && (node.typeArguments = this.flowParseTypeParameterInstantiationInExpression()), super.jsxParseOpeningElementAfterName(node);
|
41655
|
+
}
|
41587
41656
|
isLookaheadToken_lt() {
|
41588
41657
|
const next = this.nextTokenStart();
|
41589
41658
|
if (this.input.charCodeAt(next) === 60) {
|
@@ -41592,6 +41661,18 @@ function requireLib$1() {
|
|
41592
41661
|
}
|
41593
41662
|
return !1;
|
41594
41663
|
}
|
41664
|
+
reScan_lt_gt() {
|
41665
|
+
const {
|
41666
|
+
type: type2
|
41667
|
+
} = this.state;
|
41668
|
+
type2 === 47 ? (this.state.pos -= 1, this.readToken_lt()) : type2 === 48 && (this.state.pos -= 1, this.readToken_gt());
|
41669
|
+
}
|
41670
|
+
reScan_lt() {
|
41671
|
+
const {
|
41672
|
+
type: type2
|
41673
|
+
} = this.state;
|
41674
|
+
return type2 === 51 ? (this.state.pos -= 2, this.finishOp(47, 1), 47) : type2;
|
41675
|
+
}
|
41595
41676
|
maybeUnwrapTypeCastExpression(node) {
|
41596
41677
|
return node.type === "TypeCastExpression" ? node.expression : node;
|
41597
41678
|
}
|
@@ -42695,7 +42776,7 @@ function requireLib$1() {
|
|
42695
42776
|
}
|
42696
42777
|
tsParseImportType() {
|
42697
42778
|
const node = this.startNode();
|
42698
|
-
return this.expect(83), this.expect(10), this.match(134)
|
42779
|
+
return this.expect(83), this.expect(10), this.match(134) ? node.argument = this.parseStringLiteral(this.state.value) : (this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc), node.argument = super.parseExprAtom()), this.eat(12) && !this.match(11) ? (node.options = super.parseMaybeAssignAllowIn(), this.eat(12)) : node.options = null, this.expect(11), this.eat(16) && (node.qualifier = this.tsParseEntityName()), this.match(47) && (node.typeParameters = this.tsParseTypeArguments()), this.finishNode(node, "TSImportType");
|
42699
42780
|
}
|
42700
42781
|
tsParseEntityName(allowReservedWords = !0) {
|
42701
42782
|
let entity = this.parseIdentifier(allowReservedWords);
|
@@ -43127,14 +43208,17 @@ function requireLib$1() {
|
|
43127
43208
|
return this.tsParseType();
|
43128
43209
|
}), this.semicolon(), this.finishNode(node, "TSTypeAliasDeclaration");
|
43129
43210
|
}
|
43130
|
-
|
43131
|
-
|
43132
|
-
|
43133
|
-
|
43211
|
+
tsInTopLevelContext(cb) {
|
43212
|
+
if (this.curContext() !== types2.brace) {
|
43213
|
+
const oldContext = this.state.context;
|
43214
|
+
this.state.context = [oldContext[0]];
|
43215
|
+
try {
|
43216
|
+
return cb();
|
43217
|
+
} finally {
|
43218
|
+
this.state.context = oldContext;
|
43219
|
+
}
|
43220
|
+
} else
|
43134
43221
|
return cb();
|
43135
|
-
} finally {
|
43136
|
-
this.state.context = oldContext;
|
43137
|
-
}
|
43138
43222
|
}
|
43139
43223
|
tsInType(cb) {
|
43140
43224
|
const oldInType = this.state.inType;
|
@@ -43180,6 +43264,10 @@ function requireLib$1() {
|
|
43180
43264
|
tsParseEnumDeclaration(node, properties = {}) {
|
43181
43265
|
return properties.const && (node.const = !0), properties.declare && (node.declare = !0), this.expectContextual(126), node.id = this.parseIdentifier(), this.checkIdentifier(node.id, node.const ? 8971 : 8459), this.expect(5), node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)), this.expect(8), this.finishNode(node, "TSEnumDeclaration");
|
43182
43266
|
}
|
43267
|
+
tsParseEnumBody() {
|
43268
|
+
const node = this.startNode();
|
43269
|
+
return this.expect(5), node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)), this.expect(8), this.finishNode(node, "TSEnumBody");
|
43270
|
+
}
|
43183
43271
|
tsParseModuleBlock() {
|
43184
43272
|
const node = this.startNode();
|
43185
43273
|
return this.scope.enter(0), this.expect(5), super.parseBlockOrModuleBlockBody(node.body = [], void 0, !0, 8), this.scope.exit(), this.finishNode(node, "TSModuleBlock");
|
@@ -43323,7 +43411,7 @@ function requireLib$1() {
|
|
43323
43411
|
}
|
43324
43412
|
tsParseTypeArguments() {
|
43325
43413
|
const node = this.startNode();
|
43326
|
-
return node.params = this.tsInType(() => this.
|
43414
|
+
return node.params = this.tsInType(() => this.tsInTopLevelContext(() => (this.expect(47), this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this))))), node.params.length === 0 ? this.raise(TSErrors.EmptyTypeArguments, node) : !this.state.inType && this.curContext() === types2.brace && this.reScan_lt_gt(), this.expect(48), this.finishNode(node, "TSTypeParameterInstantiation");
|
43327
43415
|
}
|
43328
43416
|
tsIsDeclarationStart() {
|
43329
43417
|
return tokenIsTSDeclarationStart(this.state.type);
|
@@ -43789,16 +43877,16 @@ function requireLib$1() {
|
|
43789
43877
|
parseBindingAtom() {
|
43790
43878
|
return this.state.type === 78 ? this.parseIdentifier(!0) : super.parseBindingAtom();
|
43791
43879
|
}
|
43792
|
-
parseMaybeDecoratorArguments(expr) {
|
43880
|
+
parseMaybeDecoratorArguments(expr, startLoc) {
|
43793
43881
|
if (this.match(47) || this.match(51)) {
|
43794
43882
|
const typeArguments = this.tsParseTypeArgumentsInExpression();
|
43795
43883
|
if (this.match(10)) {
|
43796
|
-
const call = super.parseMaybeDecoratorArguments(expr);
|
43884
|
+
const call = super.parseMaybeDecoratorArguments(expr, startLoc);
|
43797
43885
|
return call.typeParameters = typeArguments, call;
|
43798
43886
|
}
|
43799
43887
|
this.unexpected(null, 10);
|
43800
43888
|
}
|
43801
|
-
return super.parseMaybeDecoratorArguments(expr);
|
43889
|
+
return super.parseMaybeDecoratorArguments(expr, startLoc);
|
43802
43890
|
}
|
43803
43891
|
checkCommaAfterRest(close) {
|
43804
43892
|
return this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close ? (this.next(), !1) : super.checkCommaAfterRest(close);
|
@@ -43904,7 +43992,7 @@ function requireLib$1() {
|
|
43904
43992
|
}
|
43905
43993
|
parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope) {
|
43906
43994
|
const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type2, inClassScope);
|
43907
|
-
if (method.abstract && (this.hasPlugin("estree") ?
|
43995
|
+
if (method.abstract && (this.hasPlugin("estree") ? method.value : method).body) {
|
43908
43996
|
const {
|
43909
43997
|
key: key2
|
43910
43998
|
} = method;
|
@@ -44196,44 +44284,6 @@ function requireLib$1() {
|
|
44196
44284
|
v8intrinsic,
|
44197
44285
|
placeholders
|
44198
44286
|
}, mixinPluginNames = Object.keys(mixinPlugins);
|
44199
|
-
function createDefaultOptions() {
|
44200
|
-
return {
|
44201
|
-
sourceType: "script",
|
44202
|
-
sourceFilename: void 0,
|
44203
|
-
startIndex: 0,
|
44204
|
-
startColumn: 0,
|
44205
|
-
startLine: 1,
|
44206
|
-
allowAwaitOutsideFunction: !1,
|
44207
|
-
allowReturnOutsideFunction: !1,
|
44208
|
-
allowNewTargetOutsideFunction: !1,
|
44209
|
-
allowImportExportEverywhere: !1,
|
44210
|
-
allowSuperOutsideMethod: !1,
|
44211
|
-
allowUndeclaredExports: !1,
|
44212
|
-
plugins: [],
|
44213
|
-
strictMode: null,
|
44214
|
-
ranges: !1,
|
44215
|
-
tokens: !1,
|
44216
|
-
createImportExpressions: !1,
|
44217
|
-
createParenthesizedExpressions: !1,
|
44218
|
-
errorRecovery: !1,
|
44219
|
-
attachComment: !0,
|
44220
|
-
annexB: !0
|
44221
|
-
};
|
44222
|
-
}
|
44223
|
-
function getOptions(opts) {
|
44224
|
-
const options2 = createDefaultOptions();
|
44225
|
-
if (opts == null)
|
44226
|
-
return options2;
|
44227
|
-
if (opts.annexB != null && opts.annexB !== !1)
|
44228
|
-
throw new Error("The `annexB` option can only be set to `false`.");
|
44229
|
-
for (const key2 of Object.keys(options2))
|
44230
|
-
opts[key2] != null && (options2[key2] = opts[key2]);
|
44231
|
-
if (options2.startLine === 1)
|
44232
|
-
opts.startIndex == null && options2.startColumn > 0 ? options2.startIndex = options2.startColumn : opts.startColumn == null && options2.startIndex > 0 && (options2.startColumn = options2.startIndex);
|
44233
|
-
else if ((opts.startColumn == null || opts.startIndex == null) && opts.startIndex != null)
|
44234
|
-
throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");
|
44235
|
-
return options2;
|
44236
|
-
}
|
44237
44287
|
class ExpressionParser extends LValParser {
|
44238
44288
|
checkProto(prop, isRecord, protoRef, refExpressionErrors) {
|
44239
44289
|
if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand)
|
@@ -44253,7 +44303,7 @@ function requireLib$1() {
|
|
44253
44303
|
getExpression() {
|
44254
44304
|
this.enterInitialScopes(), this.nextToken();
|
44255
44305
|
const expr = this.parseExpression();
|
44256
|
-
return this.match(140) || this.unexpected(), this.finalizeRemainingComments(), expr.comments = this.comments, expr.errors = this.state.errors, this.
|
44306
|
+
return this.match(140) || this.unexpected(), this.finalizeRemainingComments(), expr.comments = this.comments, expr.errors = this.state.errors, this.optionFlags & 128 && (expr.tokens = this.tokens), expr;
|
44257
44307
|
}
|
44258
44308
|
parseExpression(disallowIn, refExpressionErrors) {
|
44259
44309
|
return disallowIn ? this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)) : this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors));
|
@@ -44543,7 +44593,7 @@ function requireLib$1() {
|
|
44543
44593
|
case 79:
|
44544
44594
|
return this.parseSuper();
|
44545
44595
|
case 83:
|
44546
|
-
return node = this.startNode(), this.next(), this.match(16) ? this.parseImportMetaProperty(node) : this.match(10) ? this.
|
44596
|
+
return node = this.startNode(), this.next(), this.match(16) ? this.parseImportMetaProperty(node) : this.match(10) ? this.optionFlags & 256 ? this.parseImportCall(node) : this.finishNode(node, "Import") : (this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc), this.finishNode(node, "Import"));
|
44547
44597
|
case 78:
|
44548
44598
|
return node = this.startNode(), this.next(), this.finishNode(node, "ThisExpression");
|
44549
44599
|
case 90:
|
@@ -44686,7 +44736,7 @@ function requireLib$1() {
|
|
44686
44736
|
}
|
44687
44737
|
parseSuper() {
|
44688
44738
|
const node = this.startNode();
|
44689
|
-
return this.next(), this.match(10) && !this.scope.allowDirectSuper && !this.
|
44739
|
+
return this.next(), this.match(10) && !this.scope.allowDirectSuper && !(this.optionFlags & 16) ? this.raise(Errors.SuperNotAllowed, node) : !this.scope.allowSuper && !(this.optionFlags & 16) && this.raise(Errors.UnexpectedSuper, node), !this.match(10) && !this.match(0) && !this.match(16) && this.raise(Errors.UnsupportedSuper, node), this.finishNode(node, "Super");
|
44690
44740
|
}
|
44691
44741
|
parsePrivateName() {
|
44692
44742
|
const node = this.startNode(), id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)), name = this.state.value;
|
@@ -44714,7 +44764,7 @@ function requireLib$1() {
|
|
44714
44764
|
this.inModule || this.raise(Errors.ImportMetaOutsideModule, id), this.sawUnambiguousESM = !0;
|
44715
44765
|
else if (this.isContextual(105) || this.isContextual(97)) {
|
44716
44766
|
const isSource = this.isContextual(105);
|
44717
|
-
if (
|
44767
|
+
if (this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"), !(this.optionFlags & 256))
|
44718
44768
|
throw this.raise(Errors.DynamicImportPhaseRequiresImportExpressions, this.state.startLoc, {
|
44719
44769
|
phase: this.state.value
|
44720
44770
|
});
|
@@ -44781,7 +44831,7 @@ function requireLib$1() {
|
|
44781
44831
|
return canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode)) ? (this.checkDestructuringPrivate(refExpressionErrors), this.expressionScope.validateAsPattern(), this.expressionScope.exit(), this.parseArrowExpression(arrowNode, exprList, !1), arrowNode) : (this.expressionScope.exit(), exprList.length || this.unexpected(this.state.lastTokStartLoc), optionalCommaStartLoc && this.unexpected(optionalCommaStartLoc), spreadStartLoc && this.unexpected(spreadStartLoc), this.checkExpressionErrors(refExpressionErrors, !0), this.toReferencedListDeep(exprList, !0), exprList.length > 1 ? (val = this.startNodeAt(innerStartLoc), val.expressions = exprList, this.finishNode(val, "SequenceExpression"), this.resetEndLocation(val, innerEndLoc)) : val = exprList[0], this.wrapParenthesis(startLoc, val));
|
44782
44832
|
}
|
44783
44833
|
wrapParenthesis(startLoc, expression) {
|
44784
|
-
if (!this.
|
44834
|
+
if (!(this.optionFlags & 512))
|
44785
44835
|
return this.addExtra(expression, "parenthesized", !0), this.addExtra(expression, "parenStart", startLoc.index), this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index), expression;
|
44786
44836
|
const parenExpression = this.startNodeAt(startLoc);
|
44787
44837
|
return parenExpression.expression = expression, this.finishNode(parenExpression, "ParenthesizedExpression");
|
@@ -44802,7 +44852,7 @@ function requireLib$1() {
|
|
44802
44852
|
const meta = this.createIdentifier(this.startNodeAtNode(node), "new");
|
44803
44853
|
this.next();
|
44804
44854
|
const metaProp = this.parseMetaProperty(node, meta, "target");
|
44805
|
-
return !this.scope.inNonArrowFunction && !this.scope.inClass && !this.
|
44855
|
+
return !this.scope.inNonArrowFunction && !this.scope.inClass && !(this.optionFlags & 4) && this.raise(Errors.UnexpectedNewTarget, metaProp), metaProp;
|
44806
44856
|
}
|
44807
44857
|
return this.parseNew(node);
|
44808
44858
|
}
|
@@ -45111,12 +45161,12 @@ function requireLib$1() {
|
|
45111
45161
|
}
|
45112
45162
|
}
|
45113
45163
|
recordAwaitIfAllowed() {
|
45114
|
-
const isAwaitAllowed = this.prodParam.hasAwait || this.
|
45164
|
+
const isAwaitAllowed = this.prodParam.hasAwait || this.optionFlags & 1 && !this.scope.inFunction;
|
45115
45165
|
return isAwaitAllowed && !this.scope.inFunction && (this.state.hasTopLevelAwait = !0), isAwaitAllowed;
|
45116
45166
|
}
|
45117
45167
|
parseAwait(startLoc) {
|
45118
45168
|
const node = this.startNodeAt(startLoc);
|
45119
|
-
return this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node), this.eat(55) && this.raise(Errors.ObsoleteAwaitStar, node), !this.scope.inFunction && !this.
|
45169
|
+
return this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node), this.eat(55) && this.raise(Errors.ObsoleteAwaitStar, node), !this.scope.inFunction && !(this.optionFlags & 1) && (this.isAmbiguousAwait() ? this.ambiguousScriptDifferentAst = !0 : this.sawUnambiguousESM = !0), this.state.soloAwait || (node.argument = this.parseMaybeUnary(null, !0)), this.finishNode(node, "AwaitExpression");
|
45120
45170
|
}
|
45121
45171
|
isAmbiguousAwait() {
|
45122
45172
|
if (this.hasPrecedingLineBreak()) return !0;
|
@@ -45372,11 +45422,11 @@ function requireLib$1() {
|
|
45372
45422
|
}
|
45373
45423
|
class StatementParser extends ExpressionParser {
|
45374
45424
|
parseTopLevel(file, program) {
|
45375
|
-
return file.program = this.parseProgram(program), file.comments = this.comments, this.
|
45425
|
+
return file.program = this.parseProgram(program), file.comments = this.comments, this.optionFlags & 128 && (file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex)), this.finishNode(file, "File");
|
45376
45426
|
}
|
45377
45427
|
parseProgram(program, end = 140, sourceType = this.options.sourceType) {
|
45378
45428
|
if (program.sourceType = sourceType, program.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(program, !0, !0, end), this.inModule) {
|
45379
|
-
if (!this.
|
45429
|
+
if (!(this.optionFlags & 32) && this.scope.undefinedExports.size > 0)
|
45380
45430
|
for (const [localName, at] of Array.from(this.scope.undefinedExports))
|
45381
45431
|
this.raise(Errors.ModuleExportUndefined, at, {
|
45382
45432
|
localName
|
@@ -45522,7 +45572,7 @@ function requireLib$1() {
|
|
45522
45572
|
break;
|
45523
45573
|
}
|
45524
45574
|
case 82: {
|
45525
|
-
!this.
|
45575
|
+
!(this.optionFlags & 8) && !topLevel && this.raise(Errors.UnexpectedImportExport, this.state.startLoc), this.next();
|
45526
45576
|
let result;
|
45527
45577
|
return startType === 83 ? (result = this.parseImport(node), result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value") && (this.sawUnambiguousESM = !0)) : (result = this.parseExport(node, decorators), (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") && (this.sawUnambiguousESM = !0)), this.assertModuleNodeAllowed(result), result;
|
45528
45578
|
}
|
@@ -45534,13 +45584,17 @@ function requireLib$1() {
|
|
45534
45584
|
return tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14) ? this.parseLabeledStatement(node, maybeName, expr, flags) : this.parseExpressionStatement(node, expr, decorators);
|
45535
45585
|
}
|
45536
45586
|
assertModuleNodeAllowed(node) {
|
45537
|
-
!this.
|
45587
|
+
!(this.optionFlags & 8) && !this.inModule && this.raise(Errors.ImportOutsideModule, node);
|
45538
45588
|
}
|
45539
45589
|
decoratorsEnabledBeforeExport() {
|
45540
45590
|
return this.hasPlugin("decorators-legacy") ? !0 : this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== !1;
|
45541
45591
|
}
|
45542
45592
|
maybeTakeDecorators(maybeDecorators, classNode, exportNode) {
|
45543
|
-
|
45593
|
+
if (maybeDecorators) {
|
45594
|
+
var _classNode$decorators;
|
45595
|
+
(_classNode$decorators = classNode.decorators) != null && _classNode$decorators.length ? (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") != "boolean" && this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]), classNode.decorators.unshift(...maybeDecorators)) : classNode.decorators = maybeDecorators, this.resetStartLocationFromNode(classNode, maybeDecorators[0]), exportNode && this.resetStartLocationFromNode(exportNode, classNode);
|
45596
|
+
}
|
45597
|
+
return classNode;
|
45544
45598
|
}
|
45545
45599
|
canHaveLeadingDecorator() {
|
45546
45600
|
return this.match(80);
|
@@ -45566,21 +45620,21 @@ function requireLib$1() {
|
|
45566
45620
|
const startLoc2 = this.state.startLoc;
|
45567
45621
|
this.next(), expr = this.parseExpression(), this.expect(11), expr = this.wrapParenthesis(startLoc2, expr);
|
45568
45622
|
const paramsStartLoc = this.state.startLoc;
|
45569
|
-
node.expression = this.parseMaybeDecoratorArguments(expr), this.getPluginOption("decorators", "allowCallParenthesized") === !1 && node.expression !== expr && this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
|
45623
|
+
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc2), this.getPluginOption("decorators", "allowCallParenthesized") === !1 && node.expression !== expr && this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc);
|
45570
45624
|
} else {
|
45571
45625
|
for (expr = this.parseIdentifier(!1); this.eat(16); ) {
|
45572
45626
|
const node2 = this.startNodeAt(startLoc);
|
45573
45627
|
node2.object = expr, this.match(139) ? (this.classScope.usePrivateName(this.state.value, this.state.startLoc), node2.property = this.parsePrivateName()) : node2.property = this.parseIdentifier(!0), node2.computed = !1, expr = this.finishNode(node2, "MemberExpression");
|
45574
45628
|
}
|
45575
|
-
node.expression = this.parseMaybeDecoratorArguments(expr);
|
45629
|
+
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc);
|
45576
45630
|
}
|
45577
45631
|
} else
|
45578
45632
|
node.expression = this.parseExprSubscripts();
|
45579
45633
|
return this.finishNode(node, "Decorator");
|
45580
45634
|
}
|
45581
|
-
parseMaybeDecoratorArguments(expr) {
|
45635
|
+
parseMaybeDecoratorArguments(expr, startLoc) {
|
45582
45636
|
if (this.eat(10)) {
|
45583
|
-
const node = this.
|
45637
|
+
const node = this.startNodeAt(startLoc);
|
45584
45638
|
return node.callee = expr, node.arguments = this.parseCallExpressionArguments(11), this.toReferencedList(node.arguments), this.finishNode(node, "CallExpression");
|
45585
45639
|
}
|
45586
45640
|
return expr;
|
@@ -45647,7 +45701,7 @@ function requireLib$1() {
|
|
45647
45701
|
return this.next(), node.test = this.parseHeaderExpression(), node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(), node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null, this.finishNode(node, "IfStatement");
|
45648
45702
|
}
|
45649
45703
|
parseReturnStatement(node) {
|
45650
|
-
return !this.prodParam.hasReturn && !this.
|
45704
|
+
return !this.prodParam.hasReturn && !(this.optionFlags & 2) && this.raise(Errors.IllegalReturn, this.state.startLoc), this.next(), this.isLineTerminator() ? node.argument = null : (node.argument = this.parseExpression(), this.semicolon()), this.finishNode(node, "ReturnStatement");
|
45651
45705
|
}
|
45652
45706
|
parseSwitchStatement(node) {
|
45653
45707
|
this.next(), node.discriminant = this.parseHeaderExpression();
|
@@ -46334,6 +46388,8 @@ function requireLib$1() {
|
|
46334
46388
|
class Parser extends StatementParser {
|
46335
46389
|
constructor(options2, input2, pluginsMap) {
|
46336
46390
|
options2 = getOptions(options2), super(options2, input2), this.options = options2, this.initializeScopes(), this.plugins = pluginsMap, this.filename = options2.sourceFilename, this.startIndex = options2.startIndex;
|
46391
|
+
let optionFlags = 0;
|
46392
|
+
options2.allowAwaitOutsideFunction && (optionFlags |= 1), options2.allowReturnOutsideFunction && (optionFlags |= 2), options2.allowImportExportEverywhere && (optionFlags |= 8), options2.allowSuperOutsideMethod && (optionFlags |= 16), options2.allowUndeclaredExports && (optionFlags |= 32), options2.allowNewTargetOutsideFunction && (optionFlags |= 4), options2.ranges && (optionFlags |= 64), options2.tokens && (optionFlags |= 128), options2.createImportExpressions && (optionFlags |= 256), options2.createParenthesizedExpressions && (optionFlags |= 512), options2.errorRecovery && (optionFlags |= 1024), options2.attachComment && (optionFlags |= 2048), options2.annexB && (optionFlags |= 4096), this.optionFlags = optionFlags;
|
46337
46393
|
}
|
46338
46394
|
getScopeHandler() {
|
46339
46395
|
return ScopeHandler;
|