houdini-svelte 2.1.19 → 2.1.20
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/build/plugin-cjs/index.js +392 -345
- package/build/plugin-esm/index.js +392 -345
- package/build/preprocess-cjs/index.js +387 -340
- package/build/preprocess-esm/index.js +387 -340
- package/build/test-cjs/index.js +609 -557
- package/build/test-esm/index.js +609 -557
- package/package.json +2 -2
package/build/test-esm/index.js
CHANGED
|
@@ -808,11 +808,11 @@ var require_types4 = __commonJS({
|
|
|
808
808
|
}();
|
|
809
809
|
exports.Def = Def;
|
|
810
810
|
var Field = function() {
|
|
811
|
-
function Field2(name, type, defaultFn,
|
|
811
|
+
function Field2(name, type, defaultFn, hidden8) {
|
|
812
812
|
this.name = name;
|
|
813
813
|
this.type = type;
|
|
814
814
|
this.defaultFn = defaultFn;
|
|
815
|
-
this.hidden = !!
|
|
815
|
+
this.hidden = !!hidden8;
|
|
816
816
|
}
|
|
817
817
|
Field2.prototype.toString = function() {
|
|
818
818
|
return JSON.stringify(this.name) + ": " + this.type;
|
|
@@ -1061,12 +1061,12 @@ var require_types4 = __commonJS({
|
|
|
1061
1061
|
});
|
|
1062
1062
|
return this;
|
|
1063
1063
|
};
|
|
1064
|
-
DefImpl2.prototype.field = function(name, type, defaultFn,
|
|
1064
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden8) {
|
|
1065
1065
|
if (this.finalized) {
|
|
1066
1066
|
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
1067
1067
|
return this;
|
|
1068
1068
|
}
|
|
1069
|
-
this.ownFields[name] = new Field(name, Type.from(type), defaultFn,
|
|
1069
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden8);
|
|
1070
1070
|
return this;
|
|
1071
1071
|
};
|
|
1072
1072
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -1667,13 +1667,13 @@ var require_scope4 = __commonJS({
|
|
|
1667
1667
|
var name = prefix + index;
|
|
1668
1668
|
return this.bindings[name] = types14.builders.identifier(name);
|
|
1669
1669
|
};
|
|
1670
|
-
Sp.injectTemporary = function(identifier,
|
|
1670
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
1671
1671
|
identifier || (identifier = this.declareTemporary());
|
|
1672
1672
|
var bodyPath = this.path.get("body");
|
|
1673
1673
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
1674
1674
|
bodyPath = bodyPath.get("body");
|
|
1675
1675
|
}
|
|
1676
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
1676
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
1677
1677
|
return identifier;
|
|
1678
1678
|
};
|
|
1679
1679
|
Sp.scan = function(force) {
|
|
@@ -2446,7 +2446,7 @@ var require_path_visitor4 = __commonJS({
|
|
|
2446
2446
|
return Context;
|
|
2447
2447
|
}
|
|
2448
2448
|
var sharedContextProtoMethods = /* @__PURE__ */ Object.create(null);
|
|
2449
|
-
sharedContextProtoMethods.reset = function
|
|
2449
|
+
sharedContextProtoMethods.reset = function reset8(path7) {
|
|
2450
2450
|
if (!(this instanceof this.Context)) {
|
|
2451
2451
|
throw new Error("");
|
|
2452
2452
|
}
|
|
@@ -7233,9 +7233,9 @@ var require_esprima7 = __commonJS({
|
|
|
7233
7233
|
}();
|
|
7234
7234
|
exports2.ForOfStatement = ForOfStatement;
|
|
7235
7235
|
var ForStatement = function() {
|
|
7236
|
-
function ForStatement2(
|
|
7236
|
+
function ForStatement2(init2, test, update, body) {
|
|
7237
7237
|
this.type = syntax_1.Syntax.ForStatement;
|
|
7238
|
-
this.init =
|
|
7238
|
+
this.init = init2;
|
|
7239
7239
|
this.test = test;
|
|
7240
7240
|
this.update = update;
|
|
7241
7241
|
this.body = body;
|
|
@@ -7575,10 +7575,10 @@ var require_esprima7 = __commonJS({
|
|
|
7575
7575
|
}();
|
|
7576
7576
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
7577
7577
|
var VariableDeclarator = function() {
|
|
7578
|
-
function VariableDeclarator2(id,
|
|
7578
|
+
function VariableDeclarator2(id, init2) {
|
|
7579
7579
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
7580
7580
|
this.id = id;
|
|
7581
|
-
this.init =
|
|
7581
|
+
this.init = init2;
|
|
7582
7582
|
}
|
|
7583
7583
|
return VariableDeclarator2;
|
|
7584
7584
|
}();
|
|
@@ -8283,8 +8283,8 @@ var require_esprima7 = __commonJS({
|
|
|
8283
8283
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
8284
8284
|
this.nextToken();
|
|
8285
8285
|
shorthand = true;
|
|
8286
|
-
var
|
|
8287
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
8286
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
8287
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
8288
8288
|
} else {
|
|
8289
8289
|
shorthand = true;
|
|
8290
8290
|
value = id;
|
|
@@ -9062,21 +9062,21 @@ var require_esprima7 = __commonJS({
|
|
|
9062
9062
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
9063
9063
|
}
|
|
9064
9064
|
}
|
|
9065
|
-
var
|
|
9065
|
+
var init2 = null;
|
|
9066
9066
|
if (kind === "const") {
|
|
9067
9067
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
9068
9068
|
if (this.match("=")) {
|
|
9069
9069
|
this.nextToken();
|
|
9070
|
-
|
|
9070
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
9071
9071
|
} else {
|
|
9072
9072
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
9073
9073
|
}
|
|
9074
9074
|
}
|
|
9075
9075
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
9076
9076
|
this.expect("=");
|
|
9077
|
-
|
|
9077
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
9078
9078
|
}
|
|
9079
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
9079
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
9080
9080
|
};
|
|
9081
9081
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
9082
9082
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -9140,17 +9140,17 @@ var require_esprima7 = __commonJS({
|
|
|
9140
9140
|
if (this.lookahead.type === 3) {
|
|
9141
9141
|
var keyToken = this.lookahead;
|
|
9142
9142
|
key = this.parseVariableIdentifier();
|
|
9143
|
-
var
|
|
9143
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
9144
9144
|
if (this.match("=")) {
|
|
9145
9145
|
params.push(keyToken);
|
|
9146
9146
|
shorthand = true;
|
|
9147
9147
|
this.nextToken();
|
|
9148
9148
|
var expr = this.parseAssignmentExpression();
|
|
9149
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
9149
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
9150
9150
|
} else if (!this.match(":")) {
|
|
9151
9151
|
params.push(keyToken);
|
|
9152
9152
|
shorthand = true;
|
|
9153
|
-
value =
|
|
9153
|
+
value = init2;
|
|
9154
9154
|
} else {
|
|
9155
9155
|
this.expect(":");
|
|
9156
9156
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -9235,14 +9235,14 @@ var require_esprima7 = __commonJS({
|
|
|
9235
9235
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
9236
9236
|
}
|
|
9237
9237
|
}
|
|
9238
|
-
var
|
|
9238
|
+
var init2 = null;
|
|
9239
9239
|
if (this.match("=")) {
|
|
9240
9240
|
this.nextToken();
|
|
9241
|
-
|
|
9241
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
9242
9242
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
9243
9243
|
this.expect("=");
|
|
9244
9244
|
}
|
|
9245
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
9245
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
9246
9246
|
};
|
|
9247
9247
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
9248
9248
|
var opt = { inFor: options.inFor };
|
|
@@ -9337,7 +9337,7 @@ var require_esprima7 = __commonJS({
|
|
|
9337
9337
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
9338
9338
|
};
|
|
9339
9339
|
Parser2.prototype.parseForStatement = function() {
|
|
9340
|
-
var
|
|
9340
|
+
var init2 = null;
|
|
9341
9341
|
var test = null;
|
|
9342
9342
|
var update = null;
|
|
9343
9343
|
var forIn = true;
|
|
@@ -9349,7 +9349,7 @@ var require_esprima7 = __commonJS({
|
|
|
9349
9349
|
this.nextToken();
|
|
9350
9350
|
} else {
|
|
9351
9351
|
if (this.matchKeyword("var")) {
|
|
9352
|
-
|
|
9352
|
+
init2 = this.createNode();
|
|
9353
9353
|
this.nextToken();
|
|
9354
9354
|
var previousAllowIn = this.context.allowIn;
|
|
9355
9355
|
this.context.allowIn = false;
|
|
@@ -9360,87 +9360,87 @@ var require_esprima7 = __commonJS({
|
|
|
9360
9360
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
9361
9361
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
9362
9362
|
}
|
|
9363
|
-
|
|
9363
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
9364
9364
|
this.nextToken();
|
|
9365
|
-
left =
|
|
9365
|
+
left = init2;
|
|
9366
9366
|
right = this.parseExpression();
|
|
9367
|
-
|
|
9367
|
+
init2 = null;
|
|
9368
9368
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
9369
|
-
|
|
9369
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
9370
9370
|
this.nextToken();
|
|
9371
|
-
left =
|
|
9371
|
+
left = init2;
|
|
9372
9372
|
right = this.parseAssignmentExpression();
|
|
9373
|
-
|
|
9373
|
+
init2 = null;
|
|
9374
9374
|
forIn = false;
|
|
9375
9375
|
} else {
|
|
9376
|
-
|
|
9376
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
9377
9377
|
this.expect(";");
|
|
9378
9378
|
}
|
|
9379
9379
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
9380
|
-
|
|
9380
|
+
init2 = this.createNode();
|
|
9381
9381
|
var kind = this.nextToken().value;
|
|
9382
9382
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
9383
|
-
|
|
9383
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
9384
9384
|
this.nextToken();
|
|
9385
|
-
left =
|
|
9385
|
+
left = init2;
|
|
9386
9386
|
right = this.parseExpression();
|
|
9387
|
-
|
|
9387
|
+
init2 = null;
|
|
9388
9388
|
} else {
|
|
9389
9389
|
var previousAllowIn = this.context.allowIn;
|
|
9390
9390
|
this.context.allowIn = false;
|
|
9391
9391
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
9392
9392
|
this.context.allowIn = previousAllowIn;
|
|
9393
9393
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
9394
|
-
|
|
9394
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
9395
9395
|
this.nextToken();
|
|
9396
|
-
left =
|
|
9396
|
+
left = init2;
|
|
9397
9397
|
right = this.parseExpression();
|
|
9398
|
-
|
|
9398
|
+
init2 = null;
|
|
9399
9399
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
9400
|
-
|
|
9400
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
9401
9401
|
this.nextToken();
|
|
9402
|
-
left =
|
|
9402
|
+
left = init2;
|
|
9403
9403
|
right = this.parseAssignmentExpression();
|
|
9404
|
-
|
|
9404
|
+
init2 = null;
|
|
9405
9405
|
forIn = false;
|
|
9406
9406
|
} else {
|
|
9407
9407
|
this.consumeSemicolon();
|
|
9408
|
-
|
|
9408
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
9409
9409
|
}
|
|
9410
9410
|
}
|
|
9411
9411
|
} else {
|
|
9412
9412
|
var initStartToken = this.lookahead;
|
|
9413
9413
|
var previousAllowIn = this.context.allowIn;
|
|
9414
9414
|
this.context.allowIn = false;
|
|
9415
|
-
|
|
9415
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
9416
9416
|
this.context.allowIn = previousAllowIn;
|
|
9417
9417
|
if (this.matchKeyword("in")) {
|
|
9418
|
-
if (!this.context.isAssignmentTarget ||
|
|
9418
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
9419
9419
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
9420
9420
|
}
|
|
9421
9421
|
this.nextToken();
|
|
9422
|
-
this.reinterpretExpressionAsPattern(
|
|
9423
|
-
left =
|
|
9422
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
9423
|
+
left = init2;
|
|
9424
9424
|
right = this.parseExpression();
|
|
9425
|
-
|
|
9425
|
+
init2 = null;
|
|
9426
9426
|
} else if (this.matchContextualKeyword("of")) {
|
|
9427
|
-
if (!this.context.isAssignmentTarget ||
|
|
9427
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
9428
9428
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
9429
9429
|
}
|
|
9430
9430
|
this.nextToken();
|
|
9431
|
-
this.reinterpretExpressionAsPattern(
|
|
9432
|
-
left =
|
|
9431
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
9432
|
+
left = init2;
|
|
9433
9433
|
right = this.parseAssignmentExpression();
|
|
9434
|
-
|
|
9434
|
+
init2 = null;
|
|
9435
9435
|
forIn = false;
|
|
9436
9436
|
} else {
|
|
9437
9437
|
if (this.match(",")) {
|
|
9438
|
-
var initSeq = [
|
|
9438
|
+
var initSeq = [init2];
|
|
9439
9439
|
while (this.match(",")) {
|
|
9440
9440
|
this.nextToken();
|
|
9441
9441
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
9442
9442
|
}
|
|
9443
|
-
|
|
9443
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
9444
9444
|
}
|
|
9445
9445
|
this.expect(";");
|
|
9446
9446
|
}
|
|
@@ -9466,7 +9466,7 @@ var require_esprima7 = __commonJS({
|
|
|
9466
9466
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
9467
9467
|
this.context.inIteration = previousInIteration;
|
|
9468
9468
|
}
|
|
9469
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
9469
|
+
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init2, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body));
|
|
9470
9470
|
};
|
|
9471
9471
|
Parser2.prototype.parseContinueStatement = function() {
|
|
9472
9472
|
var node = this.createNode();
|
|
@@ -14857,10 +14857,10 @@ var require_printer4 = __commonJS({
|
|
|
14857
14857
|
return (0, lines_1.concat)(parts);
|
|
14858
14858
|
}
|
|
14859
14859
|
case "ForStatement": {
|
|
14860
|
-
var
|
|
14861
|
-
var sep6 =
|
|
14860
|
+
var init2 = path7.call(print26, "init");
|
|
14861
|
+
var sep6 = init2.length > 1 ? ";\n" : "; ";
|
|
14862
14862
|
var forParen = "for (";
|
|
14863
|
-
var indented = (0, lines_1.fromString)(sep6).join([
|
|
14863
|
+
var indented = (0, lines_1.fromString)(sep6).join([init2, path7.call(print26, "test"), path7.call(print26, "update")]).indentTail(forParen.length);
|
|
14864
14864
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
14865
14865
|
var clause = adjustClause(path7.call(print26, "body"), options);
|
|
14866
14866
|
parts.push(head);
|
|
@@ -24567,10 +24567,10 @@ var require_ponyfill_es2018 = __commonJS2({
|
|
|
24567
24567
|
}
|
|
24568
24568
|
return size;
|
|
24569
24569
|
}
|
|
24570
|
-
function convertQueuingStrategy(
|
|
24571
|
-
assertDictionary(
|
|
24572
|
-
const highWaterMark =
|
|
24573
|
-
const size =
|
|
24570
|
+
function convertQueuingStrategy(init2, context) {
|
|
24571
|
+
assertDictionary(init2, context);
|
|
24572
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
24573
|
+
const size = init2 === null || init2 === void 0 ? void 0 : init2.size;
|
|
24574
24574
|
return {
|
|
24575
24575
|
highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark),
|
|
24576
24576
|
size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`)
|
|
@@ -26422,9 +26422,9 @@ var require_ponyfill_es2018 = __commonJS2({
|
|
|
26422
26422
|
function streamBrandCheckException$1(name) {
|
|
26423
26423
|
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
26424
26424
|
}
|
|
26425
|
-
function convertQueuingStrategyInit(
|
|
26426
|
-
assertDictionary(
|
|
26427
|
-
const highWaterMark =
|
|
26425
|
+
function convertQueuingStrategyInit(init2, context) {
|
|
26426
|
+
assertDictionary(init2, context);
|
|
26427
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
26428
26428
|
assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit");
|
|
26429
26429
|
return {
|
|
26430
26430
|
highWaterMark: convertUnrestrictedDouble(highWaterMark)
|
|
@@ -35592,10 +35592,10 @@ var require_generated2 = __commonJS2({
|
|
|
35592
35592
|
body
|
|
35593
35593
|
});
|
|
35594
35594
|
}
|
|
35595
|
-
function forStatement(
|
|
35595
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
35596
35596
|
return (0, _validateNode.default)({
|
|
35597
35597
|
type: "ForStatement",
|
|
35598
|
-
init,
|
|
35598
|
+
init: init2,
|
|
35599
35599
|
test,
|
|
35600
35600
|
update,
|
|
35601
35601
|
body
|
|
@@ -35813,11 +35813,11 @@ var require_generated2 = __commonJS2({
|
|
|
35813
35813
|
declarations
|
|
35814
35814
|
});
|
|
35815
35815
|
}
|
|
35816
|
-
function variableDeclarator(id,
|
|
35816
|
+
function variableDeclarator(id, init2 = null) {
|
|
35817
35817
|
return (0, _validateNode.default)({
|
|
35818
35818
|
type: "VariableDeclarator",
|
|
35819
35819
|
id,
|
|
35820
|
-
init
|
|
35820
|
+
init: init2
|
|
35821
35821
|
});
|
|
35822
35822
|
}
|
|
35823
35823
|
function whileStatement(test, body) {
|
|
@@ -36519,18 +36519,18 @@ var require_generated2 = __commonJS2({
|
|
|
36519
36519
|
init: null
|
|
36520
36520
|
});
|
|
36521
36521
|
}
|
|
36522
|
-
function enumNumberMember(id,
|
|
36522
|
+
function enumNumberMember(id, init2) {
|
|
36523
36523
|
return (0, _validateNode.default)({
|
|
36524
36524
|
type: "EnumNumberMember",
|
|
36525
36525
|
id,
|
|
36526
|
-
init
|
|
36526
|
+
init: init2
|
|
36527
36527
|
});
|
|
36528
36528
|
}
|
|
36529
|
-
function enumStringMember(id,
|
|
36529
|
+
function enumStringMember(id, init2) {
|
|
36530
36530
|
return (0, _validateNode.default)({
|
|
36531
36531
|
type: "EnumStringMember",
|
|
36532
36532
|
id,
|
|
36533
|
-
init
|
|
36533
|
+
init: init2
|
|
36534
36534
|
});
|
|
36535
36535
|
}
|
|
36536
36536
|
function enumDefaultedMember(id) {
|
|
@@ -48236,13 +48236,13 @@ var require_lib6 = __commonJS2({
|
|
|
48236
48236
|
flowEnumMemberRaw() {
|
|
48237
48237
|
const loc = this.state.startLoc;
|
|
48238
48238
|
const id = this.parseIdentifier(true);
|
|
48239
|
-
const
|
|
48239
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
48240
48240
|
type: "none",
|
|
48241
48241
|
loc
|
|
48242
48242
|
};
|
|
48243
48243
|
return {
|
|
48244
48244
|
id,
|
|
48245
|
-
init
|
|
48245
|
+
init: init2
|
|
48246
48246
|
};
|
|
48247
48247
|
}
|
|
48248
48248
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -48276,7 +48276,7 @@ var require_lib6 = __commonJS2({
|
|
|
48276
48276
|
const memberNode = this.startNode();
|
|
48277
48277
|
const {
|
|
48278
48278
|
id,
|
|
48279
|
-
init
|
|
48279
|
+
init: init2
|
|
48280
48280
|
} = this.flowEnumMemberRaw();
|
|
48281
48281
|
const memberName = id.name;
|
|
48282
48282
|
if (memberName === "") {
|
|
@@ -48302,35 +48302,35 @@ var require_lib6 = __commonJS2({
|
|
|
48302
48302
|
memberName
|
|
48303
48303
|
};
|
|
48304
48304
|
memberNode.id = id;
|
|
48305
|
-
switch (
|
|
48305
|
+
switch (init2.type) {
|
|
48306
48306
|
case "boolean": {
|
|
48307
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48308
|
-
memberNode.init =
|
|
48307
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
48308
|
+
memberNode.init = init2.value;
|
|
48309
48309
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
48310
48310
|
break;
|
|
48311
48311
|
}
|
|
48312
48312
|
case "number": {
|
|
48313
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48314
|
-
memberNode.init =
|
|
48313
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
48314
|
+
memberNode.init = init2.value;
|
|
48315
48315
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
48316
48316
|
break;
|
|
48317
48317
|
}
|
|
48318
48318
|
case "string": {
|
|
48319
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48320
|
-
memberNode.init =
|
|
48319
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
48320
|
+
memberNode.init = init2.value;
|
|
48321
48321
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
48322
48322
|
break;
|
|
48323
48323
|
}
|
|
48324
48324
|
case "invalid": {
|
|
48325
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
48325
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
48326
48326
|
}
|
|
48327
48327
|
case "none": {
|
|
48328
48328
|
switch (explicitType) {
|
|
48329
48329
|
case "boolean":
|
|
48330
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
48330
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
48331
48331
|
break;
|
|
48332
48332
|
case "number":
|
|
48333
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
48333
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
48334
48334
|
break;
|
|
48335
48335
|
default:
|
|
48336
48336
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -51431,14 +51431,14 @@ var require_lib6 = __commonJS2({
|
|
|
51431
51431
|
return declaration;
|
|
51432
51432
|
for (const {
|
|
51433
51433
|
id,
|
|
51434
|
-
init
|
|
51434
|
+
init: init2
|
|
51435
51435
|
} of declaration.declarations) {
|
|
51436
|
-
if (!
|
|
51436
|
+
if (!init2)
|
|
51437
51437
|
continue;
|
|
51438
51438
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
51439
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
51440
|
-
} else if (!isValidAmbientConstInitializer(
|
|
51441
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
51439
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
51440
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
51441
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
51442
51442
|
}
|
|
51443
51443
|
}
|
|
51444
51444
|
return declaration;
|
|
@@ -54918,49 +54918,49 @@ var require_lib6 = __commonJS2({
|
|
|
54918
54918
|
}
|
|
54919
54919
|
this.next();
|
|
54920
54920
|
this.parseVar(initNode, true, kind);
|
|
54921
|
-
const
|
|
54921
|
+
const init22 = this.finishNode(initNode, "VariableDeclaration");
|
|
54922
54922
|
const isForIn = this.match(58);
|
|
54923
54923
|
if (isForIn && starsWithUsingDeclaration) {
|
|
54924
|
-
this.raise(Errors.ForInUsing,
|
|
54924
|
+
this.raise(Errors.ForInUsing, init22);
|
|
54925
54925
|
}
|
|
54926
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
54927
|
-
return this.parseForIn(node,
|
|
54926
|
+
if ((isForIn || this.isContextual(102)) && init22.declarations.length === 1) {
|
|
54927
|
+
return this.parseForIn(node, init22, awaitAt);
|
|
54928
54928
|
}
|
|
54929
54929
|
if (awaitAt !== null) {
|
|
54930
54930
|
this.unexpected(awaitAt);
|
|
54931
54931
|
}
|
|
54932
|
-
return this.parseFor(node,
|
|
54932
|
+
return this.parseFor(node, init22);
|
|
54933
54933
|
}
|
|
54934
54934
|
}
|
|
54935
54935
|
const startsWithAsync = this.isContextual(95);
|
|
54936
54936
|
const refExpressionErrors = new ExpressionErrors();
|
|
54937
|
-
const
|
|
54937
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
54938
54938
|
const isForOf = this.isContextual(102);
|
|
54939
54939
|
if (isForOf) {
|
|
54940
54940
|
if (startsWithLet) {
|
|
54941
|
-
this.raise(Errors.ForOfLet,
|
|
54941
|
+
this.raise(Errors.ForOfLet, init2);
|
|
54942
54942
|
}
|
|
54943
|
-
if (awaitAt === null && startsWithAsync &&
|
|
54944
|
-
this.raise(Errors.ForOfAsync,
|
|
54943
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
54944
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
54945
54945
|
}
|
|
54946
54946
|
}
|
|
54947
54947
|
if (isForOf || this.match(58)) {
|
|
54948
54948
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
54949
|
-
this.toAssignable(
|
|
54949
|
+
this.toAssignable(init2, true);
|
|
54950
54950
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
54951
|
-
this.checkLVal(
|
|
54951
|
+
this.checkLVal(init2, {
|
|
54952
54952
|
in: {
|
|
54953
54953
|
type
|
|
54954
54954
|
}
|
|
54955
54955
|
});
|
|
54956
|
-
return this.parseForIn(node,
|
|
54956
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
54957
54957
|
} else {
|
|
54958
54958
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
54959
54959
|
}
|
|
54960
54960
|
if (awaitAt !== null) {
|
|
54961
54961
|
this.unexpected(awaitAt);
|
|
54962
54962
|
}
|
|
54963
|
-
return this.parseFor(node,
|
|
54963
|
+
return this.parseFor(node, init2);
|
|
54964
54964
|
}
|
|
54965
54965
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
54966
54966
|
this.next();
|
|
@@ -55182,8 +55182,8 @@ var require_lib6 = __commonJS2({
|
|
|
55182
55182
|
}
|
|
55183
55183
|
this.next();
|
|
55184
55184
|
}
|
|
55185
|
-
parseFor(node,
|
|
55186
|
-
node.init =
|
|
55185
|
+
parseFor(node, init2) {
|
|
55186
|
+
node.init = init2;
|
|
55187
55187
|
this.semicolon(false);
|
|
55188
55188
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
55189
55189
|
this.semicolon(false);
|
|
@@ -55194,7 +55194,7 @@ var require_lib6 = __commonJS2({
|
|
|
55194
55194
|
this.state.labels.pop();
|
|
55195
55195
|
return this.finishNode(node, "ForStatement");
|
|
55196
55196
|
}
|
|
55197
|
-
parseForIn(node,
|
|
55197
|
+
parseForIn(node, init2, awaitAt) {
|
|
55198
55198
|
const isForIn = this.match(58);
|
|
55199
55199
|
this.next();
|
|
55200
55200
|
if (isForIn) {
|
|
@@ -55203,19 +55203,19 @@ var require_lib6 = __commonJS2({
|
|
|
55203
55203
|
} else {
|
|
55204
55204
|
node.await = awaitAt !== null;
|
|
55205
55205
|
}
|
|
55206
|
-
if (
|
|
55207
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
55206
|
+
if (init2.type === "VariableDeclaration" && init2.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init2.kind !== "var" || init2.declarations[0].id.type !== "Identifier")) {
|
|
55207
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
55208
55208
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
55209
55209
|
});
|
|
55210
55210
|
}
|
|
55211
|
-
if (
|
|
55212
|
-
this.raise(Errors.InvalidLhs,
|
|
55211
|
+
if (init2.type === "AssignmentPattern") {
|
|
55212
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
55213
55213
|
ancestor: {
|
|
55214
55214
|
type: "ForStatement"
|
|
55215
55215
|
}
|
|
55216
55216
|
});
|
|
55217
55217
|
}
|
|
55218
|
-
node.left =
|
|
55218
|
+
node.left = init2;
|
|
55219
55219
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
55220
55220
|
this.expect(11);
|
|
55221
55221
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -58014,13 +58014,13 @@ var require_scope = __commonJS2({
|
|
|
58014
58014
|
var name = prefix + index;
|
|
58015
58015
|
return this.bindings[name] = types62.builders.identifier(name);
|
|
58016
58016
|
};
|
|
58017
|
-
Sp.injectTemporary = function(identifier,
|
|
58017
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
58018
58018
|
identifier || (identifier = this.declareTemporary());
|
|
58019
58019
|
var bodyPath = this.path.get("body");
|
|
58020
58020
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
58021
58021
|
bodyPath = bodyPath.get("body");
|
|
58022
58022
|
}
|
|
58023
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
58023
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
58024
58024
|
return identifier;
|
|
58025
58025
|
};
|
|
58026
58026
|
Sp.scan = function(force) {
|
|
@@ -63500,9 +63500,9 @@ var require_esprima2 = __commonJS2({
|
|
|
63500
63500
|
}();
|
|
63501
63501
|
exports2.ForOfStatement = ForOfStatement;
|
|
63502
63502
|
var ForStatement = function() {
|
|
63503
|
-
function ForStatement2(
|
|
63503
|
+
function ForStatement2(init2, test, update, body) {
|
|
63504
63504
|
this.type = syntax_1.Syntax.ForStatement;
|
|
63505
|
-
this.init =
|
|
63505
|
+
this.init = init2;
|
|
63506
63506
|
this.test = test;
|
|
63507
63507
|
this.update = update;
|
|
63508
63508
|
this.body = body;
|
|
@@ -63842,10 +63842,10 @@ var require_esprima2 = __commonJS2({
|
|
|
63842
63842
|
}();
|
|
63843
63843
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
63844
63844
|
var VariableDeclarator = function() {
|
|
63845
|
-
function VariableDeclarator2(id,
|
|
63845
|
+
function VariableDeclarator2(id, init2) {
|
|
63846
63846
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
63847
63847
|
this.id = id;
|
|
63848
|
-
this.init =
|
|
63848
|
+
this.init = init2;
|
|
63849
63849
|
}
|
|
63850
63850
|
return VariableDeclarator2;
|
|
63851
63851
|
}();
|
|
@@ -64550,8 +64550,8 @@ var require_esprima2 = __commonJS2({
|
|
|
64550
64550
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
64551
64551
|
this.nextToken();
|
|
64552
64552
|
shorthand = true;
|
|
64553
|
-
var
|
|
64554
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
64553
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
64554
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
64555
64555
|
} else {
|
|
64556
64556
|
shorthand = true;
|
|
64557
64557
|
value = id;
|
|
@@ -65329,21 +65329,21 @@ var require_esprima2 = __commonJS2({
|
|
|
65329
65329
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
65330
65330
|
}
|
|
65331
65331
|
}
|
|
65332
|
-
var
|
|
65332
|
+
var init2 = null;
|
|
65333
65333
|
if (kind === "const") {
|
|
65334
65334
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
65335
65335
|
if (this.match("=")) {
|
|
65336
65336
|
this.nextToken();
|
|
65337
|
-
|
|
65337
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65338
65338
|
} else {
|
|
65339
65339
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
65340
65340
|
}
|
|
65341
65341
|
}
|
|
65342
65342
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
65343
65343
|
this.expect("=");
|
|
65344
|
-
|
|
65344
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65345
65345
|
}
|
|
65346
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
65346
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
65347
65347
|
};
|
|
65348
65348
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
65349
65349
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -65407,17 +65407,17 @@ var require_esprima2 = __commonJS2({
|
|
|
65407
65407
|
if (this.lookahead.type === 3) {
|
|
65408
65408
|
var keyToken = this.lookahead;
|
|
65409
65409
|
key = this.parseVariableIdentifier();
|
|
65410
|
-
var
|
|
65410
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
65411
65411
|
if (this.match("=")) {
|
|
65412
65412
|
params.push(keyToken);
|
|
65413
65413
|
shorthand = true;
|
|
65414
65414
|
this.nextToken();
|
|
65415
65415
|
var expr = this.parseAssignmentExpression();
|
|
65416
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
65416
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
65417
65417
|
} else if (!this.match(":")) {
|
|
65418
65418
|
params.push(keyToken);
|
|
65419
65419
|
shorthand = true;
|
|
65420
|
-
value =
|
|
65420
|
+
value = init2;
|
|
65421
65421
|
} else {
|
|
65422
65422
|
this.expect(":");
|
|
65423
65423
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -65502,14 +65502,14 @@ var require_esprima2 = __commonJS2({
|
|
|
65502
65502
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
65503
65503
|
}
|
|
65504
65504
|
}
|
|
65505
|
-
var
|
|
65505
|
+
var init2 = null;
|
|
65506
65506
|
if (this.match("=")) {
|
|
65507
65507
|
this.nextToken();
|
|
65508
|
-
|
|
65508
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65509
65509
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
65510
65510
|
this.expect("=");
|
|
65511
65511
|
}
|
|
65512
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
65512
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
65513
65513
|
};
|
|
65514
65514
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
65515
65515
|
var opt = { inFor: options.inFor };
|
|
@@ -65604,7 +65604,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65604
65604
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
65605
65605
|
};
|
|
65606
65606
|
Parser2.prototype.parseForStatement = function() {
|
|
65607
|
-
var
|
|
65607
|
+
var init2 = null;
|
|
65608
65608
|
var test = null;
|
|
65609
65609
|
var update = null;
|
|
65610
65610
|
var forIn = true;
|
|
@@ -65616,7 +65616,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65616
65616
|
this.nextToken();
|
|
65617
65617
|
} else {
|
|
65618
65618
|
if (this.matchKeyword("var")) {
|
|
65619
|
-
|
|
65619
|
+
init2 = this.createNode();
|
|
65620
65620
|
this.nextToken();
|
|
65621
65621
|
var previousAllowIn = this.context.allowIn;
|
|
65622
65622
|
this.context.allowIn = false;
|
|
@@ -65627,87 +65627,87 @@ var require_esprima2 = __commonJS2({
|
|
|
65627
65627
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
65628
65628
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
65629
65629
|
}
|
|
65630
|
-
|
|
65630
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65631
65631
|
this.nextToken();
|
|
65632
|
-
left =
|
|
65632
|
+
left = init2;
|
|
65633
65633
|
right = this.parseExpression();
|
|
65634
|
-
|
|
65634
|
+
init2 = null;
|
|
65635
65635
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
65636
|
-
|
|
65636
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65637
65637
|
this.nextToken();
|
|
65638
|
-
left =
|
|
65638
|
+
left = init2;
|
|
65639
65639
|
right = this.parseAssignmentExpression();
|
|
65640
|
-
|
|
65640
|
+
init2 = null;
|
|
65641
65641
|
forIn = false;
|
|
65642
65642
|
} else {
|
|
65643
|
-
|
|
65643
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65644
65644
|
this.expect(";");
|
|
65645
65645
|
}
|
|
65646
65646
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
65647
|
-
|
|
65647
|
+
init2 = this.createNode();
|
|
65648
65648
|
var kind = this.nextToken().value;
|
|
65649
65649
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
65650
|
-
|
|
65650
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
65651
65651
|
this.nextToken();
|
|
65652
|
-
left =
|
|
65652
|
+
left = init2;
|
|
65653
65653
|
right = this.parseExpression();
|
|
65654
|
-
|
|
65654
|
+
init2 = null;
|
|
65655
65655
|
} else {
|
|
65656
65656
|
var previousAllowIn = this.context.allowIn;
|
|
65657
65657
|
this.context.allowIn = false;
|
|
65658
65658
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
65659
65659
|
this.context.allowIn = previousAllowIn;
|
|
65660
65660
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
65661
|
-
|
|
65661
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65662
65662
|
this.nextToken();
|
|
65663
|
-
left =
|
|
65663
|
+
left = init2;
|
|
65664
65664
|
right = this.parseExpression();
|
|
65665
|
-
|
|
65665
|
+
init2 = null;
|
|
65666
65666
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
65667
|
-
|
|
65667
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65668
65668
|
this.nextToken();
|
|
65669
|
-
left =
|
|
65669
|
+
left = init2;
|
|
65670
65670
|
right = this.parseAssignmentExpression();
|
|
65671
|
-
|
|
65671
|
+
init2 = null;
|
|
65672
65672
|
forIn = false;
|
|
65673
65673
|
} else {
|
|
65674
65674
|
this.consumeSemicolon();
|
|
65675
|
-
|
|
65675
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65676
65676
|
}
|
|
65677
65677
|
}
|
|
65678
65678
|
} else {
|
|
65679
65679
|
var initStartToken = this.lookahead;
|
|
65680
65680
|
var previousAllowIn = this.context.allowIn;
|
|
65681
65681
|
this.context.allowIn = false;
|
|
65682
|
-
|
|
65682
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
65683
65683
|
this.context.allowIn = previousAllowIn;
|
|
65684
65684
|
if (this.matchKeyword("in")) {
|
|
65685
|
-
if (!this.context.isAssignmentTarget ||
|
|
65685
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
65686
65686
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
65687
65687
|
}
|
|
65688
65688
|
this.nextToken();
|
|
65689
|
-
this.reinterpretExpressionAsPattern(
|
|
65690
|
-
left =
|
|
65689
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
65690
|
+
left = init2;
|
|
65691
65691
|
right = this.parseExpression();
|
|
65692
|
-
|
|
65692
|
+
init2 = null;
|
|
65693
65693
|
} else if (this.matchContextualKeyword("of")) {
|
|
65694
|
-
if (!this.context.isAssignmentTarget ||
|
|
65694
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
65695
65695
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
65696
65696
|
}
|
|
65697
65697
|
this.nextToken();
|
|
65698
|
-
this.reinterpretExpressionAsPattern(
|
|
65699
|
-
left =
|
|
65698
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
65699
|
+
left = init2;
|
|
65700
65700
|
right = this.parseAssignmentExpression();
|
|
65701
|
-
|
|
65701
|
+
init2 = null;
|
|
65702
65702
|
forIn = false;
|
|
65703
65703
|
} else {
|
|
65704
65704
|
if (this.match(",")) {
|
|
65705
|
-
var initSeq = [
|
|
65705
|
+
var initSeq = [init2];
|
|
65706
65706
|
while (this.match(",")) {
|
|
65707
65707
|
this.nextToken();
|
|
65708
65708
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
65709
65709
|
}
|
|
65710
|
-
|
|
65710
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
65711
65711
|
}
|
|
65712
65712
|
this.expect(";");
|
|
65713
65713
|
}
|
|
@@ -65733,7 +65733,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65733
65733
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
65734
65734
|
this.context.inIteration = previousInIteration;
|
|
65735
65735
|
}
|
|
65736
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
65736
|
+
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init2, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body));
|
|
65737
65737
|
};
|
|
65738
65738
|
Parser2.prototype.parseContinueStatement = function() {
|
|
65739
65739
|
var node = this.createNode();
|
|
@@ -71106,10 +71106,10 @@ var require_printer = __commonJS2({
|
|
|
71106
71106
|
return (0, lines_1.concat)(parts);
|
|
71107
71107
|
}
|
|
71108
71108
|
case "ForStatement": {
|
|
71109
|
-
var
|
|
71110
|
-
var sep32 =
|
|
71109
|
+
var init2 = path42.call(print62, "init");
|
|
71110
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
71111
71111
|
var forParen = "for (";
|
|
71112
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
71112
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path42.call(print62, "test"), path42.call(print62, "update")]).indentTail(forParen.length);
|
|
71113
71113
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
71114
71114
|
var clause = adjustClause(path42.call(print62, "body"), options);
|
|
71115
71115
|
parts.push(head);
|
|
@@ -79001,23 +79001,23 @@ var validateHeaderValue = typeof http.validateHeaderValue === "function" ? http.
|
|
|
79001
79001
|
}
|
|
79002
79002
|
};
|
|
79003
79003
|
var Headers = class extends URLSearchParams {
|
|
79004
|
-
constructor(
|
|
79004
|
+
constructor(init2) {
|
|
79005
79005
|
let result = [];
|
|
79006
|
-
if (
|
|
79007
|
-
const raw =
|
|
79006
|
+
if (init2 instanceof Headers) {
|
|
79007
|
+
const raw = init2.raw();
|
|
79008
79008
|
for (const [name, values] of Object.entries(raw)) {
|
|
79009
79009
|
result.push(...values.map((value) => [name, value]));
|
|
79010
79010
|
}
|
|
79011
|
-
} else if (
|
|
79012
|
-
} else if (typeof
|
|
79013
|
-
const method =
|
|
79011
|
+
} else if (init2 == null) {
|
|
79012
|
+
} else if (typeof init2 === "object" && !types3.isBoxedPrimitive(init2)) {
|
|
79013
|
+
const method = init2[Symbol.iterator];
|
|
79014
79014
|
if (method == null) {
|
|
79015
|
-
result.push(...Object.entries(
|
|
79015
|
+
result.push(...Object.entries(init2));
|
|
79016
79016
|
} else {
|
|
79017
79017
|
if (typeof method !== "function") {
|
|
79018
79018
|
throw new TypeError("Header pairs must be iterable");
|
|
79019
79019
|
}
|
|
79020
|
-
result = [...
|
|
79020
|
+
result = [...init2].map((pair) => {
|
|
79021
79021
|
if (typeof pair !== "object" || types3.isBoxedPrimitive(pair)) {
|
|
79022
79022
|
throw new TypeError("Each header pair must be an iterable object");
|
|
79023
79023
|
}
|
|
@@ -79212,17 +79212,17 @@ var Response2 = class extends Body {
|
|
|
79212
79212
|
response[INTERNALS2].type = "error";
|
|
79213
79213
|
return response;
|
|
79214
79214
|
}
|
|
79215
|
-
static json(data = void 0,
|
|
79215
|
+
static json(data = void 0, init2 = {}) {
|
|
79216
79216
|
const body = JSON.stringify(data);
|
|
79217
79217
|
if (body === void 0) {
|
|
79218
79218
|
throw new TypeError("data is not JSON serializable");
|
|
79219
79219
|
}
|
|
79220
|
-
const headers = new Headers(
|
|
79220
|
+
const headers = new Headers(init2 && init2.headers);
|
|
79221
79221
|
if (!headers.has("content-type")) {
|
|
79222
79222
|
headers.set("content-type", "application/json");
|
|
79223
79223
|
}
|
|
79224
79224
|
return new Response2(body, {
|
|
79225
|
-
...
|
|
79225
|
+
...init2,
|
|
79226
79226
|
headers
|
|
79227
79227
|
});
|
|
79228
79228
|
}
|
|
@@ -79268,7 +79268,7 @@ var doBadDataWarn = deprecate2(
|
|
|
79268
79268
|
"https://github.com/node-fetch/node-fetch/issues/1000 (request)"
|
|
79269
79269
|
);
|
|
79270
79270
|
var Request2 = class extends Body {
|
|
79271
|
-
constructor(input,
|
|
79271
|
+
constructor(input, init2 = {}) {
|
|
79272
79272
|
let parsedURL;
|
|
79273
79273
|
if (isRequest(input)) {
|
|
79274
79274
|
parsedURL = new URL(input.url);
|
|
@@ -79279,21 +79279,21 @@ var Request2 = class extends Body {
|
|
|
79279
79279
|
if (parsedURL.username !== "" || parsedURL.password !== "") {
|
|
79280
79280
|
throw new TypeError(`${parsedURL} is an url with embedded credentials.`);
|
|
79281
79281
|
}
|
|
79282
|
-
let method =
|
|
79282
|
+
let method = init2.method || input.method || "GET";
|
|
79283
79283
|
if (/^(delete|get|head|options|post|put)$/i.test(method)) {
|
|
79284
79284
|
method = method.toUpperCase();
|
|
79285
79285
|
}
|
|
79286
|
-
if (!isRequest(
|
|
79286
|
+
if (!isRequest(init2) && "data" in init2) {
|
|
79287
79287
|
doBadDataWarn();
|
|
79288
79288
|
}
|
|
79289
|
-
if ((
|
|
79289
|
+
if ((init2.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
|
79290
79290
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
|
79291
79291
|
}
|
|
79292
|
-
const inputBody =
|
|
79292
|
+
const inputBody = init2.body ? init2.body : isRequest(input) && input.body !== null ? clone(input) : null;
|
|
79293
79293
|
super(inputBody, {
|
|
79294
|
-
size:
|
|
79294
|
+
size: init2.size || input.size || 0
|
|
79295
79295
|
});
|
|
79296
|
-
const headers = new Headers(
|
|
79296
|
+
const headers = new Headers(init2.headers || input.headers || {});
|
|
79297
79297
|
if (inputBody !== null && !headers.has("Content-Type")) {
|
|
79298
79298
|
const contentType = extractContentType(inputBody, this);
|
|
79299
79299
|
if (contentType) {
|
|
@@ -79301,13 +79301,13 @@ var Request2 = class extends Body {
|
|
|
79301
79301
|
}
|
|
79302
79302
|
}
|
|
79303
79303
|
let signal = isRequest(input) ? input.signal : null;
|
|
79304
|
-
if ("signal" in
|
|
79305
|
-
signal =
|
|
79304
|
+
if ("signal" in init2) {
|
|
79305
|
+
signal = init2.signal;
|
|
79306
79306
|
}
|
|
79307
79307
|
if (signal != null && !isAbortSignal(signal)) {
|
|
79308
79308
|
throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
|
|
79309
79309
|
}
|
|
79310
|
-
let referrer =
|
|
79310
|
+
let referrer = init2.referrer == null ? input.referrer : init2.referrer;
|
|
79311
79311
|
if (referrer === "") {
|
|
79312
79312
|
referrer = "no-referrer";
|
|
79313
79313
|
} else if (referrer) {
|
|
@@ -79318,19 +79318,19 @@ var Request2 = class extends Body {
|
|
|
79318
79318
|
}
|
|
79319
79319
|
this[INTERNALS3] = {
|
|
79320
79320
|
method,
|
|
79321
|
-
redirect:
|
|
79321
|
+
redirect: init2.redirect || input.redirect || "follow",
|
|
79322
79322
|
headers,
|
|
79323
79323
|
parsedURL,
|
|
79324
79324
|
signal,
|
|
79325
79325
|
referrer
|
|
79326
79326
|
};
|
|
79327
|
-
this.follow =
|
|
79328
|
-
this.compress =
|
|
79329
|
-
this.counter =
|
|
79330
|
-
this.agent =
|
|
79331
|
-
this.highWaterMark =
|
|
79332
|
-
this.insecureHTTPParser =
|
|
79333
|
-
this.referrerPolicy =
|
|
79327
|
+
this.follow = init2.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init2.follow;
|
|
79328
|
+
this.compress = init2.compress === void 0 ? input.compress === void 0 ? true : input.compress : init2.compress;
|
|
79329
|
+
this.counter = init2.counter || input.counter || 0;
|
|
79330
|
+
this.agent = init2.agent || input.agent;
|
|
79331
|
+
this.highWaterMark = init2.highWaterMark || input.highWaterMark || 16384;
|
|
79332
|
+
this.insecureHTTPParser = init2.insecureHTTPParser || input.insecureHTTPParser || false;
|
|
79333
|
+
this.referrerPolicy = init2.referrerPolicy || input.referrerPolicy || "";
|
|
79334
79334
|
}
|
|
79335
79335
|
get method() {
|
|
79336
79336
|
return this[INTERNALS3].method;
|
|
@@ -97216,10 +97216,10 @@ var require_generated22 = __commonJS3({
|
|
|
97216
97216
|
body
|
|
97217
97217
|
});
|
|
97218
97218
|
}
|
|
97219
|
-
function forStatement(
|
|
97219
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
97220
97220
|
return (0, _validateNode.default)({
|
|
97221
97221
|
type: "ForStatement",
|
|
97222
|
-
init,
|
|
97222
|
+
init: init2,
|
|
97223
97223
|
test,
|
|
97224
97224
|
update,
|
|
97225
97225
|
body
|
|
@@ -97437,11 +97437,11 @@ var require_generated22 = __commonJS3({
|
|
|
97437
97437
|
declarations
|
|
97438
97438
|
});
|
|
97439
97439
|
}
|
|
97440
|
-
function variableDeclarator(id,
|
|
97440
|
+
function variableDeclarator(id, init2 = null) {
|
|
97441
97441
|
return (0, _validateNode.default)({
|
|
97442
97442
|
type: "VariableDeclarator",
|
|
97443
97443
|
id,
|
|
97444
|
-
init
|
|
97444
|
+
init: init2
|
|
97445
97445
|
});
|
|
97446
97446
|
}
|
|
97447
97447
|
function whileStatement(test, body) {
|
|
@@ -98143,18 +98143,18 @@ var require_generated22 = __commonJS3({
|
|
|
98143
98143
|
init: null
|
|
98144
98144
|
});
|
|
98145
98145
|
}
|
|
98146
|
-
function enumNumberMember(id,
|
|
98146
|
+
function enumNumberMember(id, init2) {
|
|
98147
98147
|
return (0, _validateNode.default)({
|
|
98148
98148
|
type: "EnumNumberMember",
|
|
98149
98149
|
id,
|
|
98150
|
-
init
|
|
98150
|
+
init: init2
|
|
98151
98151
|
});
|
|
98152
98152
|
}
|
|
98153
|
-
function enumStringMember(id,
|
|
98153
|
+
function enumStringMember(id, init2) {
|
|
98154
98154
|
return (0, _validateNode.default)({
|
|
98155
98155
|
type: "EnumStringMember",
|
|
98156
98156
|
id,
|
|
98157
|
-
init
|
|
98157
|
+
init: init2
|
|
98158
98158
|
});
|
|
98159
98159
|
}
|
|
98160
98160
|
function enumDefaultedMember(id) {
|
|
@@ -109860,13 +109860,13 @@ var require_lib62 = __commonJS3({
|
|
|
109860
109860
|
flowEnumMemberRaw() {
|
|
109861
109861
|
const loc = this.state.startLoc;
|
|
109862
109862
|
const id = this.parseIdentifier(true);
|
|
109863
|
-
const
|
|
109863
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
109864
109864
|
type: "none",
|
|
109865
109865
|
loc
|
|
109866
109866
|
};
|
|
109867
109867
|
return {
|
|
109868
109868
|
id,
|
|
109869
|
-
init
|
|
109869
|
+
init: init2
|
|
109870
109870
|
};
|
|
109871
109871
|
}
|
|
109872
109872
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -109900,7 +109900,7 @@ var require_lib62 = __commonJS3({
|
|
|
109900
109900
|
const memberNode = this.startNode();
|
|
109901
109901
|
const {
|
|
109902
109902
|
id,
|
|
109903
|
-
init
|
|
109903
|
+
init: init2
|
|
109904
109904
|
} = this.flowEnumMemberRaw();
|
|
109905
109905
|
const memberName = id.name;
|
|
109906
109906
|
if (memberName === "") {
|
|
@@ -109926,35 +109926,35 @@ var require_lib62 = __commonJS3({
|
|
|
109926
109926
|
memberName
|
|
109927
109927
|
};
|
|
109928
109928
|
memberNode.id = id;
|
|
109929
|
-
switch (
|
|
109929
|
+
switch (init2.type) {
|
|
109930
109930
|
case "boolean": {
|
|
109931
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
109932
|
-
memberNode.init =
|
|
109931
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
109932
|
+
memberNode.init = init2.value;
|
|
109933
109933
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
109934
109934
|
break;
|
|
109935
109935
|
}
|
|
109936
109936
|
case "number": {
|
|
109937
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
109938
|
-
memberNode.init =
|
|
109937
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
109938
|
+
memberNode.init = init2.value;
|
|
109939
109939
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
109940
109940
|
break;
|
|
109941
109941
|
}
|
|
109942
109942
|
case "string": {
|
|
109943
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
109944
|
-
memberNode.init =
|
|
109943
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
109944
|
+
memberNode.init = init2.value;
|
|
109945
109945
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
109946
109946
|
break;
|
|
109947
109947
|
}
|
|
109948
109948
|
case "invalid": {
|
|
109949
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
109949
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
109950
109950
|
}
|
|
109951
109951
|
case "none": {
|
|
109952
109952
|
switch (explicitType) {
|
|
109953
109953
|
case "boolean":
|
|
109954
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
109954
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
109955
109955
|
break;
|
|
109956
109956
|
case "number":
|
|
109957
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
109957
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
109958
109958
|
break;
|
|
109959
109959
|
default:
|
|
109960
109960
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -113055,14 +113055,14 @@ var require_lib62 = __commonJS3({
|
|
|
113055
113055
|
return declaration;
|
|
113056
113056
|
for (const {
|
|
113057
113057
|
id,
|
|
113058
|
-
init
|
|
113058
|
+
init: init2
|
|
113059
113059
|
} of declaration.declarations) {
|
|
113060
|
-
if (!
|
|
113060
|
+
if (!init2)
|
|
113061
113061
|
continue;
|
|
113062
113062
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
113063
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
113064
|
-
} else if (!isValidAmbientConstInitializer(
|
|
113065
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
113063
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
113064
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
113065
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
113066
113066
|
}
|
|
113067
113067
|
}
|
|
113068
113068
|
return declaration;
|
|
@@ -116542,49 +116542,49 @@ var require_lib62 = __commonJS3({
|
|
|
116542
116542
|
}
|
|
116543
116543
|
this.next();
|
|
116544
116544
|
this.parseVar(initNode, true, kind);
|
|
116545
|
-
const
|
|
116545
|
+
const init22 = this.finishNode(initNode, "VariableDeclaration");
|
|
116546
116546
|
const isForIn = this.match(58);
|
|
116547
116547
|
if (isForIn && starsWithUsingDeclaration) {
|
|
116548
|
-
this.raise(Errors.ForInUsing,
|
|
116548
|
+
this.raise(Errors.ForInUsing, init22);
|
|
116549
116549
|
}
|
|
116550
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
116551
|
-
return this.parseForIn(node,
|
|
116550
|
+
if ((isForIn || this.isContextual(102)) && init22.declarations.length === 1) {
|
|
116551
|
+
return this.parseForIn(node, init22, awaitAt);
|
|
116552
116552
|
}
|
|
116553
116553
|
if (awaitAt !== null) {
|
|
116554
116554
|
this.unexpected(awaitAt);
|
|
116555
116555
|
}
|
|
116556
|
-
return this.parseFor(node,
|
|
116556
|
+
return this.parseFor(node, init22);
|
|
116557
116557
|
}
|
|
116558
116558
|
}
|
|
116559
116559
|
const startsWithAsync = this.isContextual(95);
|
|
116560
116560
|
const refExpressionErrors = new ExpressionErrors();
|
|
116561
|
-
const
|
|
116561
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
116562
116562
|
const isForOf = this.isContextual(102);
|
|
116563
116563
|
if (isForOf) {
|
|
116564
116564
|
if (startsWithLet) {
|
|
116565
|
-
this.raise(Errors.ForOfLet,
|
|
116565
|
+
this.raise(Errors.ForOfLet, init2);
|
|
116566
116566
|
}
|
|
116567
|
-
if (awaitAt === null && startsWithAsync &&
|
|
116568
|
-
this.raise(Errors.ForOfAsync,
|
|
116567
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
116568
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
116569
116569
|
}
|
|
116570
116570
|
}
|
|
116571
116571
|
if (isForOf || this.match(58)) {
|
|
116572
116572
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
116573
|
-
this.toAssignable(
|
|
116573
|
+
this.toAssignable(init2, true);
|
|
116574
116574
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
116575
|
-
this.checkLVal(
|
|
116575
|
+
this.checkLVal(init2, {
|
|
116576
116576
|
in: {
|
|
116577
116577
|
type
|
|
116578
116578
|
}
|
|
116579
116579
|
});
|
|
116580
|
-
return this.parseForIn(node,
|
|
116580
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
116581
116581
|
} else {
|
|
116582
116582
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
116583
116583
|
}
|
|
116584
116584
|
if (awaitAt !== null) {
|
|
116585
116585
|
this.unexpected(awaitAt);
|
|
116586
116586
|
}
|
|
116587
|
-
return this.parseFor(node,
|
|
116587
|
+
return this.parseFor(node, init2);
|
|
116588
116588
|
}
|
|
116589
116589
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
116590
116590
|
this.next();
|
|
@@ -116806,8 +116806,8 @@ var require_lib62 = __commonJS3({
|
|
|
116806
116806
|
}
|
|
116807
116807
|
this.next();
|
|
116808
116808
|
}
|
|
116809
|
-
parseFor(node,
|
|
116810
|
-
node.init =
|
|
116809
|
+
parseFor(node, init2) {
|
|
116810
|
+
node.init = init2;
|
|
116811
116811
|
this.semicolon(false);
|
|
116812
116812
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
116813
116813
|
this.semicolon(false);
|
|
@@ -116818,7 +116818,7 @@ var require_lib62 = __commonJS3({
|
|
|
116818
116818
|
this.state.labels.pop();
|
|
116819
116819
|
return this.finishNode(node, "ForStatement");
|
|
116820
116820
|
}
|
|
116821
|
-
parseForIn(node,
|
|
116821
|
+
parseForIn(node, init2, awaitAt) {
|
|
116822
116822
|
const isForIn = this.match(58);
|
|
116823
116823
|
this.next();
|
|
116824
116824
|
if (isForIn) {
|
|
@@ -116827,19 +116827,19 @@ var require_lib62 = __commonJS3({
|
|
|
116827
116827
|
} else {
|
|
116828
116828
|
node.await = awaitAt !== null;
|
|
116829
116829
|
}
|
|
116830
|
-
if (
|
|
116831
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
116830
|
+
if (init2.type === "VariableDeclaration" && init2.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init2.kind !== "var" || init2.declarations[0].id.type !== "Identifier")) {
|
|
116831
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
116832
116832
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
116833
116833
|
});
|
|
116834
116834
|
}
|
|
116835
|
-
if (
|
|
116836
|
-
this.raise(Errors.InvalidLhs,
|
|
116835
|
+
if (init2.type === "AssignmentPattern") {
|
|
116836
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
116837
116837
|
ancestor: {
|
|
116838
116838
|
type: "ForStatement"
|
|
116839
116839
|
}
|
|
116840
116840
|
});
|
|
116841
116841
|
}
|
|
116842
|
-
node.left =
|
|
116842
|
+
node.left = init2;
|
|
116843
116843
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
116844
116844
|
this.expect(11);
|
|
116845
116845
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -119638,13 +119638,13 @@ var require_scope2 = __commonJS3({
|
|
|
119638
119638
|
var name = prefix + index;
|
|
119639
119639
|
return this.bindings[name] = types15.builders.identifier(name);
|
|
119640
119640
|
};
|
|
119641
|
-
Sp.injectTemporary = function(identifier,
|
|
119641
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
119642
119642
|
identifier || (identifier = this.declareTemporary());
|
|
119643
119643
|
var bodyPath = this.path.get("body");
|
|
119644
119644
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
119645
119645
|
bodyPath = bodyPath.get("body");
|
|
119646
119646
|
}
|
|
119647
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
119647
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
119648
119648
|
return identifier;
|
|
119649
119649
|
};
|
|
119650
119650
|
Sp.scan = function(force) {
|
|
@@ -125124,9 +125124,9 @@ var require_esprima22 = __commonJS3({
|
|
|
125124
125124
|
}();
|
|
125125
125125
|
exports2.ForOfStatement = ForOfStatement;
|
|
125126
125126
|
var ForStatement = function() {
|
|
125127
|
-
function ForStatement2(
|
|
125127
|
+
function ForStatement2(init2, test, update, body) {
|
|
125128
125128
|
this.type = syntax_1.Syntax.ForStatement;
|
|
125129
|
-
this.init =
|
|
125129
|
+
this.init = init2;
|
|
125130
125130
|
this.test = test;
|
|
125131
125131
|
this.update = update;
|
|
125132
125132
|
this.body = body;
|
|
@@ -125466,10 +125466,10 @@ var require_esprima22 = __commonJS3({
|
|
|
125466
125466
|
}();
|
|
125467
125467
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
125468
125468
|
var VariableDeclarator = function() {
|
|
125469
|
-
function VariableDeclarator2(id,
|
|
125469
|
+
function VariableDeclarator2(id, init2) {
|
|
125470
125470
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
125471
125471
|
this.id = id;
|
|
125472
|
-
this.init =
|
|
125472
|
+
this.init = init2;
|
|
125473
125473
|
}
|
|
125474
125474
|
return VariableDeclarator2;
|
|
125475
125475
|
}();
|
|
@@ -126174,8 +126174,8 @@ var require_esprima22 = __commonJS3({
|
|
|
126174
126174
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
126175
126175
|
this.nextToken();
|
|
126176
126176
|
shorthand = true;
|
|
126177
|
-
var
|
|
126178
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
126177
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
126178
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
126179
126179
|
} else {
|
|
126180
126180
|
shorthand = true;
|
|
126181
126181
|
value = id;
|
|
@@ -126953,21 +126953,21 @@ var require_esprima22 = __commonJS3({
|
|
|
126953
126953
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
126954
126954
|
}
|
|
126955
126955
|
}
|
|
126956
|
-
var
|
|
126956
|
+
var init2 = null;
|
|
126957
126957
|
if (kind === "const") {
|
|
126958
126958
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
126959
126959
|
if (this.match("=")) {
|
|
126960
126960
|
this.nextToken();
|
|
126961
|
-
|
|
126961
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
126962
126962
|
} else {
|
|
126963
126963
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
126964
126964
|
}
|
|
126965
126965
|
}
|
|
126966
126966
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
126967
126967
|
this.expect("=");
|
|
126968
|
-
|
|
126968
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
126969
126969
|
}
|
|
126970
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
126970
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
126971
126971
|
};
|
|
126972
126972
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
126973
126973
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -127031,17 +127031,17 @@ var require_esprima22 = __commonJS3({
|
|
|
127031
127031
|
if (this.lookahead.type === 3) {
|
|
127032
127032
|
var keyToken = this.lookahead;
|
|
127033
127033
|
key = this.parseVariableIdentifier();
|
|
127034
|
-
var
|
|
127034
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
127035
127035
|
if (this.match("=")) {
|
|
127036
127036
|
params.push(keyToken);
|
|
127037
127037
|
shorthand = true;
|
|
127038
127038
|
this.nextToken();
|
|
127039
127039
|
var expr = this.parseAssignmentExpression();
|
|
127040
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
127040
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
127041
127041
|
} else if (!this.match(":")) {
|
|
127042
127042
|
params.push(keyToken);
|
|
127043
127043
|
shorthand = true;
|
|
127044
|
-
value =
|
|
127044
|
+
value = init2;
|
|
127045
127045
|
} else {
|
|
127046
127046
|
this.expect(":");
|
|
127047
127047
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -127126,14 +127126,14 @@ var require_esprima22 = __commonJS3({
|
|
|
127126
127126
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
127127
127127
|
}
|
|
127128
127128
|
}
|
|
127129
|
-
var
|
|
127129
|
+
var init2 = null;
|
|
127130
127130
|
if (this.match("=")) {
|
|
127131
127131
|
this.nextToken();
|
|
127132
|
-
|
|
127132
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
127133
127133
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
127134
127134
|
this.expect("=");
|
|
127135
127135
|
}
|
|
127136
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
127136
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
127137
127137
|
};
|
|
127138
127138
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
127139
127139
|
var opt = { inFor: options.inFor };
|
|
@@ -127228,7 +127228,7 @@ var require_esprima22 = __commonJS3({
|
|
|
127228
127228
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
127229
127229
|
};
|
|
127230
127230
|
Parser2.prototype.parseForStatement = function() {
|
|
127231
|
-
var
|
|
127231
|
+
var init2 = null;
|
|
127232
127232
|
var test = null;
|
|
127233
127233
|
var update = null;
|
|
127234
127234
|
var forIn = true;
|
|
@@ -127240,7 +127240,7 @@ var require_esprima22 = __commonJS3({
|
|
|
127240
127240
|
this.nextToken();
|
|
127241
127241
|
} else {
|
|
127242
127242
|
if (this.matchKeyword("var")) {
|
|
127243
|
-
|
|
127243
|
+
init2 = this.createNode();
|
|
127244
127244
|
this.nextToken();
|
|
127245
127245
|
var previousAllowIn = this.context.allowIn;
|
|
127246
127246
|
this.context.allowIn = false;
|
|
@@ -127251,87 +127251,87 @@ var require_esprima22 = __commonJS3({
|
|
|
127251
127251
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
127252
127252
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
127253
127253
|
}
|
|
127254
|
-
|
|
127254
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
127255
127255
|
this.nextToken();
|
|
127256
|
-
left =
|
|
127256
|
+
left = init2;
|
|
127257
127257
|
right = this.parseExpression();
|
|
127258
|
-
|
|
127258
|
+
init2 = null;
|
|
127259
127259
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
127260
|
-
|
|
127260
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
127261
127261
|
this.nextToken();
|
|
127262
|
-
left =
|
|
127262
|
+
left = init2;
|
|
127263
127263
|
right = this.parseAssignmentExpression();
|
|
127264
|
-
|
|
127264
|
+
init2 = null;
|
|
127265
127265
|
forIn = false;
|
|
127266
127266
|
} else {
|
|
127267
|
-
|
|
127267
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
127268
127268
|
this.expect(";");
|
|
127269
127269
|
}
|
|
127270
127270
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
127271
|
-
|
|
127271
|
+
init2 = this.createNode();
|
|
127272
127272
|
var kind = this.nextToken().value;
|
|
127273
127273
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
127274
|
-
|
|
127274
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
127275
127275
|
this.nextToken();
|
|
127276
|
-
left =
|
|
127276
|
+
left = init2;
|
|
127277
127277
|
right = this.parseExpression();
|
|
127278
|
-
|
|
127278
|
+
init2 = null;
|
|
127279
127279
|
} else {
|
|
127280
127280
|
var previousAllowIn = this.context.allowIn;
|
|
127281
127281
|
this.context.allowIn = false;
|
|
127282
127282
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
127283
127283
|
this.context.allowIn = previousAllowIn;
|
|
127284
127284
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
127285
|
-
|
|
127285
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
127286
127286
|
this.nextToken();
|
|
127287
|
-
left =
|
|
127287
|
+
left = init2;
|
|
127288
127288
|
right = this.parseExpression();
|
|
127289
|
-
|
|
127289
|
+
init2 = null;
|
|
127290
127290
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
127291
|
-
|
|
127291
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
127292
127292
|
this.nextToken();
|
|
127293
|
-
left =
|
|
127293
|
+
left = init2;
|
|
127294
127294
|
right = this.parseAssignmentExpression();
|
|
127295
|
-
|
|
127295
|
+
init2 = null;
|
|
127296
127296
|
forIn = false;
|
|
127297
127297
|
} else {
|
|
127298
127298
|
this.consumeSemicolon();
|
|
127299
|
-
|
|
127299
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
127300
127300
|
}
|
|
127301
127301
|
}
|
|
127302
127302
|
} else {
|
|
127303
127303
|
var initStartToken = this.lookahead;
|
|
127304
127304
|
var previousAllowIn = this.context.allowIn;
|
|
127305
127305
|
this.context.allowIn = false;
|
|
127306
|
-
|
|
127306
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
127307
127307
|
this.context.allowIn = previousAllowIn;
|
|
127308
127308
|
if (this.matchKeyword("in")) {
|
|
127309
|
-
if (!this.context.isAssignmentTarget ||
|
|
127309
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
127310
127310
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
127311
127311
|
}
|
|
127312
127312
|
this.nextToken();
|
|
127313
|
-
this.reinterpretExpressionAsPattern(
|
|
127314
|
-
left =
|
|
127313
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
127314
|
+
left = init2;
|
|
127315
127315
|
right = this.parseExpression();
|
|
127316
|
-
|
|
127316
|
+
init2 = null;
|
|
127317
127317
|
} else if (this.matchContextualKeyword("of")) {
|
|
127318
|
-
if (!this.context.isAssignmentTarget ||
|
|
127318
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
127319
127319
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
127320
127320
|
}
|
|
127321
127321
|
this.nextToken();
|
|
127322
|
-
this.reinterpretExpressionAsPattern(
|
|
127323
|
-
left =
|
|
127322
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
127323
|
+
left = init2;
|
|
127324
127324
|
right = this.parseAssignmentExpression();
|
|
127325
|
-
|
|
127325
|
+
init2 = null;
|
|
127326
127326
|
forIn = false;
|
|
127327
127327
|
} else {
|
|
127328
127328
|
if (this.match(",")) {
|
|
127329
|
-
var initSeq = [
|
|
127329
|
+
var initSeq = [init2];
|
|
127330
127330
|
while (this.match(",")) {
|
|
127331
127331
|
this.nextToken();
|
|
127332
127332
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
127333
127333
|
}
|
|
127334
|
-
|
|
127334
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
127335
127335
|
}
|
|
127336
127336
|
this.expect(";");
|
|
127337
127337
|
}
|
|
@@ -127357,7 +127357,7 @@ var require_esprima22 = __commonJS3({
|
|
|
127357
127357
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
127358
127358
|
this.context.inIteration = previousInIteration;
|
|
127359
127359
|
}
|
|
127360
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
127360
|
+
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init2, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body));
|
|
127361
127361
|
};
|
|
127362
127362
|
Parser2.prototype.parseContinueStatement = function() {
|
|
127363
127363
|
var node = this.createNode();
|
|
@@ -132730,10 +132730,10 @@ var require_printer2 = __commonJS3({
|
|
|
132730
132730
|
return (0, lines_1.concat)(parts);
|
|
132731
132731
|
}
|
|
132732
132732
|
case "ForStatement": {
|
|
132733
|
-
var
|
|
132734
|
-
var sep32 =
|
|
132733
|
+
var init2 = path32.call(print113, "init");
|
|
132734
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
132735
132735
|
var forParen = "for (";
|
|
132736
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
132736
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path32.call(print113, "test"), path32.call(print113, "update")]).indentTail(forParen.length);
|
|
132737
132737
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
132738
132738
|
var clause = adjustClause(path32.call(print113, "body"), options);
|
|
132739
132739
|
parts.push(head);
|
|
@@ -143211,14 +143211,14 @@ var SET = 6;
|
|
|
143211
143211
|
var ERROR22 = 7;
|
|
143212
143212
|
var BIGINT = 8;
|
|
143213
143213
|
var env = typeof self === "object" ? self : globalThis;
|
|
143214
|
-
var deserializer = (
|
|
143214
|
+
var deserializer = ($2, _) => {
|
|
143215
143215
|
const as = (out, index) => {
|
|
143216
|
-
|
|
143216
|
+
$2.set(index, out);
|
|
143217
143217
|
return out;
|
|
143218
143218
|
};
|
|
143219
143219
|
const unpair = (index) => {
|
|
143220
|
-
if (
|
|
143221
|
-
return
|
|
143220
|
+
if ($2.has(index))
|
|
143221
|
+
return $2.get(index);
|
|
143222
143222
|
const [type, value] = _[index];
|
|
143223
143223
|
switch (type) {
|
|
143224
143224
|
case PRIMITIVE:
|
|
@@ -143297,15 +143297,15 @@ var typeOf = (value) => {
|
|
|
143297
143297
|
return [OBJECT, asString];
|
|
143298
143298
|
};
|
|
143299
143299
|
var shouldSkip = ([TYPE22, type]) => TYPE22 === PRIMITIVE && (type === "function" || type === "symbol");
|
|
143300
|
-
var serializer = (strict, json,
|
|
143300
|
+
var serializer = (strict, json, $2, _) => {
|
|
143301
143301
|
const as = (out, value) => {
|
|
143302
143302
|
const index = _.push(out) - 1;
|
|
143303
|
-
|
|
143303
|
+
$2.set(value, index);
|
|
143304
143304
|
return index;
|
|
143305
143305
|
};
|
|
143306
143306
|
const pair = (value) => {
|
|
143307
|
-
if (
|
|
143308
|
-
return
|
|
143307
|
+
if ($2.has(value))
|
|
143308
|
+
return $2.get(value);
|
|
143309
143309
|
let [TYPE22, type] = typeOf(value);
|
|
143310
143310
|
switch (TYPE22) {
|
|
143311
143311
|
case PRIMITIVE: {
|
|
@@ -146089,6 +146089,11 @@ export * from "${module}"
|
|
|
146089
146089
|
module: "./" + path_exports2.relative(config.rootDir, config.pluginRuntimeDirectory(plugin2.name))
|
|
146090
146090
|
});
|
|
146091
146091
|
}
|
|
146092
|
+
if (plugin2.staticRuntime) {
|
|
146093
|
+
indexContent += exportStarFrom2({
|
|
146094
|
+
module: "./" + path_exports2.relative(config.rootDir, config.pluginStaticRuntimeDirectory(plugin2.name))
|
|
146095
|
+
});
|
|
146096
|
+
}
|
|
146092
146097
|
}
|
|
146093
146098
|
await fs_exports2.writeFile(config.typeIndexPath, indexContent);
|
|
146094
146099
|
const missingScalarNames = [...missingScalars].filter(
|
|
@@ -165585,10 +165590,10 @@ var require_generated23 = __commonJS4({
|
|
|
165585
165590
|
body
|
|
165586
165591
|
});
|
|
165587
165592
|
}
|
|
165588
|
-
function forStatement(
|
|
165593
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
165589
165594
|
return (0, _validateNode.default)({
|
|
165590
165595
|
type: "ForStatement",
|
|
165591
|
-
init,
|
|
165596
|
+
init: init2,
|
|
165592
165597
|
test,
|
|
165593
165598
|
update,
|
|
165594
165599
|
body
|
|
@@ -165806,11 +165811,11 @@ var require_generated23 = __commonJS4({
|
|
|
165806
165811
|
declarations
|
|
165807
165812
|
});
|
|
165808
165813
|
}
|
|
165809
|
-
function variableDeclarator(id,
|
|
165814
|
+
function variableDeclarator(id, init2 = null) {
|
|
165810
165815
|
return (0, _validateNode.default)({
|
|
165811
165816
|
type: "VariableDeclarator",
|
|
165812
165817
|
id,
|
|
165813
|
-
init
|
|
165818
|
+
init: init2
|
|
165814
165819
|
});
|
|
165815
165820
|
}
|
|
165816
165821
|
function whileStatement(test, body) {
|
|
@@ -166512,18 +166517,18 @@ var require_generated23 = __commonJS4({
|
|
|
166512
166517
|
init: null
|
|
166513
166518
|
});
|
|
166514
166519
|
}
|
|
166515
|
-
function enumNumberMember(id,
|
|
166520
|
+
function enumNumberMember(id, init2) {
|
|
166516
166521
|
return (0, _validateNode.default)({
|
|
166517
166522
|
type: "EnumNumberMember",
|
|
166518
166523
|
id,
|
|
166519
|
-
init
|
|
166524
|
+
init: init2
|
|
166520
166525
|
});
|
|
166521
166526
|
}
|
|
166522
|
-
function enumStringMember(id,
|
|
166527
|
+
function enumStringMember(id, init2) {
|
|
166523
166528
|
return (0, _validateNode.default)({
|
|
166524
166529
|
type: "EnumStringMember",
|
|
166525
166530
|
id,
|
|
166526
|
-
init
|
|
166531
|
+
init: init2
|
|
166527
166532
|
});
|
|
166528
166533
|
}
|
|
166529
166534
|
function enumDefaultedMember(id) {
|
|
@@ -178229,13 +178234,13 @@ var require_lib63 = __commonJS4({
|
|
|
178229
178234
|
flowEnumMemberRaw() {
|
|
178230
178235
|
const loc = this.state.startLoc;
|
|
178231
178236
|
const id = this.parseIdentifier(true);
|
|
178232
|
-
const
|
|
178237
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
178233
178238
|
type: "none",
|
|
178234
178239
|
loc
|
|
178235
178240
|
};
|
|
178236
178241
|
return {
|
|
178237
178242
|
id,
|
|
178238
|
-
init
|
|
178243
|
+
init: init2
|
|
178239
178244
|
};
|
|
178240
178245
|
}
|
|
178241
178246
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -178269,7 +178274,7 @@ var require_lib63 = __commonJS4({
|
|
|
178269
178274
|
const memberNode = this.startNode();
|
|
178270
178275
|
const {
|
|
178271
178276
|
id,
|
|
178272
|
-
init
|
|
178277
|
+
init: init2
|
|
178273
178278
|
} = this.flowEnumMemberRaw();
|
|
178274
178279
|
const memberName = id.name;
|
|
178275
178280
|
if (memberName === "") {
|
|
@@ -178295,35 +178300,35 @@ var require_lib63 = __commonJS4({
|
|
|
178295
178300
|
memberName
|
|
178296
178301
|
};
|
|
178297
178302
|
memberNode.id = id;
|
|
178298
|
-
switch (
|
|
178303
|
+
switch (init2.type) {
|
|
178299
178304
|
case "boolean": {
|
|
178300
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
178301
|
-
memberNode.init =
|
|
178305
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
178306
|
+
memberNode.init = init2.value;
|
|
178302
178307
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
178303
178308
|
break;
|
|
178304
178309
|
}
|
|
178305
178310
|
case "number": {
|
|
178306
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
178307
|
-
memberNode.init =
|
|
178311
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
178312
|
+
memberNode.init = init2.value;
|
|
178308
178313
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
178309
178314
|
break;
|
|
178310
178315
|
}
|
|
178311
178316
|
case "string": {
|
|
178312
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
178313
|
-
memberNode.init =
|
|
178317
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
178318
|
+
memberNode.init = init2.value;
|
|
178314
178319
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
178315
178320
|
break;
|
|
178316
178321
|
}
|
|
178317
178322
|
case "invalid": {
|
|
178318
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
178323
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
178319
178324
|
}
|
|
178320
178325
|
case "none": {
|
|
178321
178326
|
switch (explicitType) {
|
|
178322
178327
|
case "boolean":
|
|
178323
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
178328
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
178324
178329
|
break;
|
|
178325
178330
|
case "number":
|
|
178326
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
178331
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
178327
178332
|
break;
|
|
178328
178333
|
default:
|
|
178329
178334
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -181424,14 +181429,14 @@ var require_lib63 = __commonJS4({
|
|
|
181424
181429
|
return declaration;
|
|
181425
181430
|
for (const {
|
|
181426
181431
|
id,
|
|
181427
|
-
init
|
|
181432
|
+
init: init2
|
|
181428
181433
|
} of declaration.declarations) {
|
|
181429
|
-
if (!
|
|
181434
|
+
if (!init2)
|
|
181430
181435
|
continue;
|
|
181431
181436
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
181432
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
181433
|
-
} else if (!isValidAmbientConstInitializer(
|
|
181434
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
181437
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
181438
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
181439
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
181435
181440
|
}
|
|
181436
181441
|
}
|
|
181437
181442
|
return declaration;
|
|
@@ -184911,49 +184916,49 @@ var require_lib63 = __commonJS4({
|
|
|
184911
184916
|
}
|
|
184912
184917
|
this.next();
|
|
184913
184918
|
this.parseVar(initNode, true, kind);
|
|
184914
|
-
const
|
|
184919
|
+
const init22 = this.finishNode(initNode, "VariableDeclaration");
|
|
184915
184920
|
const isForIn = this.match(58);
|
|
184916
184921
|
if (isForIn && starsWithUsingDeclaration) {
|
|
184917
|
-
this.raise(Errors.ForInUsing,
|
|
184922
|
+
this.raise(Errors.ForInUsing, init22);
|
|
184918
184923
|
}
|
|
184919
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
184920
|
-
return this.parseForIn(node,
|
|
184924
|
+
if ((isForIn || this.isContextual(102)) && init22.declarations.length === 1) {
|
|
184925
|
+
return this.parseForIn(node, init22, awaitAt);
|
|
184921
184926
|
}
|
|
184922
184927
|
if (awaitAt !== null) {
|
|
184923
184928
|
this.unexpected(awaitAt);
|
|
184924
184929
|
}
|
|
184925
|
-
return this.parseFor(node,
|
|
184930
|
+
return this.parseFor(node, init22);
|
|
184926
184931
|
}
|
|
184927
184932
|
}
|
|
184928
184933
|
const startsWithAsync = this.isContextual(95);
|
|
184929
184934
|
const refExpressionErrors = new ExpressionErrors();
|
|
184930
|
-
const
|
|
184935
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
184931
184936
|
const isForOf = this.isContextual(102);
|
|
184932
184937
|
if (isForOf) {
|
|
184933
184938
|
if (startsWithLet) {
|
|
184934
|
-
this.raise(Errors.ForOfLet,
|
|
184939
|
+
this.raise(Errors.ForOfLet, init2);
|
|
184935
184940
|
}
|
|
184936
|
-
if (awaitAt === null && startsWithAsync &&
|
|
184937
|
-
this.raise(Errors.ForOfAsync,
|
|
184941
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
184942
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
184938
184943
|
}
|
|
184939
184944
|
}
|
|
184940
184945
|
if (isForOf || this.match(58)) {
|
|
184941
184946
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
184942
|
-
this.toAssignable(
|
|
184947
|
+
this.toAssignable(init2, true);
|
|
184943
184948
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
184944
|
-
this.checkLVal(
|
|
184949
|
+
this.checkLVal(init2, {
|
|
184945
184950
|
in: {
|
|
184946
184951
|
type
|
|
184947
184952
|
}
|
|
184948
184953
|
});
|
|
184949
|
-
return this.parseForIn(node,
|
|
184954
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
184950
184955
|
} else {
|
|
184951
184956
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
184952
184957
|
}
|
|
184953
184958
|
if (awaitAt !== null) {
|
|
184954
184959
|
this.unexpected(awaitAt);
|
|
184955
184960
|
}
|
|
184956
|
-
return this.parseFor(node,
|
|
184961
|
+
return this.parseFor(node, init2);
|
|
184957
184962
|
}
|
|
184958
184963
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
184959
184964
|
this.next();
|
|
@@ -185175,8 +185180,8 @@ var require_lib63 = __commonJS4({
|
|
|
185175
185180
|
}
|
|
185176
185181
|
this.next();
|
|
185177
185182
|
}
|
|
185178
|
-
parseFor(node,
|
|
185179
|
-
node.init =
|
|
185183
|
+
parseFor(node, init2) {
|
|
185184
|
+
node.init = init2;
|
|
185180
185185
|
this.semicolon(false);
|
|
185181
185186
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
185182
185187
|
this.semicolon(false);
|
|
@@ -185187,7 +185192,7 @@ var require_lib63 = __commonJS4({
|
|
|
185187
185192
|
this.state.labels.pop();
|
|
185188
185193
|
return this.finishNode(node, "ForStatement");
|
|
185189
185194
|
}
|
|
185190
|
-
parseForIn(node,
|
|
185195
|
+
parseForIn(node, init2, awaitAt) {
|
|
185191
185196
|
const isForIn = this.match(58);
|
|
185192
185197
|
this.next();
|
|
185193
185198
|
if (isForIn) {
|
|
@@ -185196,19 +185201,19 @@ var require_lib63 = __commonJS4({
|
|
|
185196
185201
|
} else {
|
|
185197
185202
|
node.await = awaitAt !== null;
|
|
185198
185203
|
}
|
|
185199
|
-
if (
|
|
185200
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
185204
|
+
if (init2.type === "VariableDeclaration" && init2.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init2.kind !== "var" || init2.declarations[0].id.type !== "Identifier")) {
|
|
185205
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
185201
185206
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
185202
185207
|
});
|
|
185203
185208
|
}
|
|
185204
|
-
if (
|
|
185205
|
-
this.raise(Errors.InvalidLhs,
|
|
185209
|
+
if (init2.type === "AssignmentPattern") {
|
|
185210
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
185206
185211
|
ancestor: {
|
|
185207
185212
|
type: "ForStatement"
|
|
185208
185213
|
}
|
|
185209
185214
|
});
|
|
185210
185215
|
}
|
|
185211
|
-
node.left =
|
|
185216
|
+
node.left = init2;
|
|
185212
185217
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
185213
185218
|
this.expect(11);
|
|
185214
185219
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -188007,13 +188012,13 @@ var require_scope3 = __commonJS4({
|
|
|
188007
188012
|
var name = prefix + index;
|
|
188008
188013
|
return this.bindings[name] = types15.builders.identifier(name);
|
|
188009
188014
|
};
|
|
188010
|
-
Sp.injectTemporary = function(identifier,
|
|
188015
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
188011
188016
|
identifier || (identifier = this.declareTemporary());
|
|
188012
188017
|
var bodyPath = this.path.get("body");
|
|
188013
188018
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
188014
188019
|
bodyPath = bodyPath.get("body");
|
|
188015
188020
|
}
|
|
188016
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
188021
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
188017
188022
|
return identifier;
|
|
188018
188023
|
};
|
|
188019
188024
|
Sp.scan = function(force) {
|
|
@@ -193493,9 +193498,9 @@ var require_esprima23 = __commonJS4({
|
|
|
193493
193498
|
}();
|
|
193494
193499
|
exports2.ForOfStatement = ForOfStatement;
|
|
193495
193500
|
var ForStatement = function() {
|
|
193496
|
-
function ForStatement2(
|
|
193501
|
+
function ForStatement2(init2, test, update, body) {
|
|
193497
193502
|
this.type = syntax_1.Syntax.ForStatement;
|
|
193498
|
-
this.init =
|
|
193503
|
+
this.init = init2;
|
|
193499
193504
|
this.test = test;
|
|
193500
193505
|
this.update = update;
|
|
193501
193506
|
this.body = body;
|
|
@@ -193835,10 +193840,10 @@ var require_esprima23 = __commonJS4({
|
|
|
193835
193840
|
}();
|
|
193836
193841
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
193837
193842
|
var VariableDeclarator = function() {
|
|
193838
|
-
function VariableDeclarator2(id,
|
|
193843
|
+
function VariableDeclarator2(id, init2) {
|
|
193839
193844
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
193840
193845
|
this.id = id;
|
|
193841
|
-
this.init =
|
|
193846
|
+
this.init = init2;
|
|
193842
193847
|
}
|
|
193843
193848
|
return VariableDeclarator2;
|
|
193844
193849
|
}();
|
|
@@ -194543,8 +194548,8 @@ var require_esprima23 = __commonJS4({
|
|
|
194543
194548
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
194544
194549
|
this.nextToken();
|
|
194545
194550
|
shorthand = true;
|
|
194546
|
-
var
|
|
194547
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
194551
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
194552
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
194548
194553
|
} else {
|
|
194549
194554
|
shorthand = true;
|
|
194550
194555
|
value = id;
|
|
@@ -195322,21 +195327,21 @@ var require_esprima23 = __commonJS4({
|
|
|
195322
195327
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
195323
195328
|
}
|
|
195324
195329
|
}
|
|
195325
|
-
var
|
|
195330
|
+
var init2 = null;
|
|
195326
195331
|
if (kind === "const") {
|
|
195327
195332
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
195328
195333
|
if (this.match("=")) {
|
|
195329
195334
|
this.nextToken();
|
|
195330
|
-
|
|
195335
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
195331
195336
|
} else {
|
|
195332
195337
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
195333
195338
|
}
|
|
195334
195339
|
}
|
|
195335
195340
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
195336
195341
|
this.expect("=");
|
|
195337
|
-
|
|
195342
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
195338
195343
|
}
|
|
195339
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
195344
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
195340
195345
|
};
|
|
195341
195346
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
195342
195347
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -195400,17 +195405,17 @@ var require_esprima23 = __commonJS4({
|
|
|
195400
195405
|
if (this.lookahead.type === 3) {
|
|
195401
195406
|
var keyToken = this.lookahead;
|
|
195402
195407
|
key = this.parseVariableIdentifier();
|
|
195403
|
-
var
|
|
195408
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
195404
195409
|
if (this.match("=")) {
|
|
195405
195410
|
params.push(keyToken);
|
|
195406
195411
|
shorthand = true;
|
|
195407
195412
|
this.nextToken();
|
|
195408
195413
|
var expr = this.parseAssignmentExpression();
|
|
195409
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
195414
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
195410
195415
|
} else if (!this.match(":")) {
|
|
195411
195416
|
params.push(keyToken);
|
|
195412
195417
|
shorthand = true;
|
|
195413
|
-
value =
|
|
195418
|
+
value = init2;
|
|
195414
195419
|
} else {
|
|
195415
195420
|
this.expect(":");
|
|
195416
195421
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -195495,14 +195500,14 @@ var require_esprima23 = __commonJS4({
|
|
|
195495
195500
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
195496
195501
|
}
|
|
195497
195502
|
}
|
|
195498
|
-
var
|
|
195503
|
+
var init2 = null;
|
|
195499
195504
|
if (this.match("=")) {
|
|
195500
195505
|
this.nextToken();
|
|
195501
|
-
|
|
195506
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
195502
195507
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
195503
195508
|
this.expect("=");
|
|
195504
195509
|
}
|
|
195505
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
195510
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
195506
195511
|
};
|
|
195507
195512
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
195508
195513
|
var opt = { inFor: options.inFor };
|
|
@@ -195597,7 +195602,7 @@ var require_esprima23 = __commonJS4({
|
|
|
195597
195602
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
195598
195603
|
};
|
|
195599
195604
|
Parser2.prototype.parseForStatement = function() {
|
|
195600
|
-
var
|
|
195605
|
+
var init2 = null;
|
|
195601
195606
|
var test = null;
|
|
195602
195607
|
var update = null;
|
|
195603
195608
|
var forIn = true;
|
|
@@ -195609,7 +195614,7 @@ var require_esprima23 = __commonJS4({
|
|
|
195609
195614
|
this.nextToken();
|
|
195610
195615
|
} else {
|
|
195611
195616
|
if (this.matchKeyword("var")) {
|
|
195612
|
-
|
|
195617
|
+
init2 = this.createNode();
|
|
195613
195618
|
this.nextToken();
|
|
195614
195619
|
var previousAllowIn = this.context.allowIn;
|
|
195615
195620
|
this.context.allowIn = false;
|
|
@@ -195620,87 +195625,87 @@ var require_esprima23 = __commonJS4({
|
|
|
195620
195625
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
195621
195626
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
195622
195627
|
}
|
|
195623
|
-
|
|
195628
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
195624
195629
|
this.nextToken();
|
|
195625
|
-
left =
|
|
195630
|
+
left = init2;
|
|
195626
195631
|
right = this.parseExpression();
|
|
195627
|
-
|
|
195632
|
+
init2 = null;
|
|
195628
195633
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
195629
|
-
|
|
195634
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
195630
195635
|
this.nextToken();
|
|
195631
|
-
left =
|
|
195636
|
+
left = init2;
|
|
195632
195637
|
right = this.parseAssignmentExpression();
|
|
195633
|
-
|
|
195638
|
+
init2 = null;
|
|
195634
195639
|
forIn = false;
|
|
195635
195640
|
} else {
|
|
195636
|
-
|
|
195641
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
195637
195642
|
this.expect(";");
|
|
195638
195643
|
}
|
|
195639
195644
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
195640
|
-
|
|
195645
|
+
init2 = this.createNode();
|
|
195641
195646
|
var kind = this.nextToken().value;
|
|
195642
195647
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
195643
|
-
|
|
195648
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
195644
195649
|
this.nextToken();
|
|
195645
|
-
left =
|
|
195650
|
+
left = init2;
|
|
195646
195651
|
right = this.parseExpression();
|
|
195647
|
-
|
|
195652
|
+
init2 = null;
|
|
195648
195653
|
} else {
|
|
195649
195654
|
var previousAllowIn = this.context.allowIn;
|
|
195650
195655
|
this.context.allowIn = false;
|
|
195651
195656
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
195652
195657
|
this.context.allowIn = previousAllowIn;
|
|
195653
195658
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
195654
|
-
|
|
195659
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
195655
195660
|
this.nextToken();
|
|
195656
|
-
left =
|
|
195661
|
+
left = init2;
|
|
195657
195662
|
right = this.parseExpression();
|
|
195658
|
-
|
|
195663
|
+
init2 = null;
|
|
195659
195664
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
195660
|
-
|
|
195665
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
195661
195666
|
this.nextToken();
|
|
195662
|
-
left =
|
|
195667
|
+
left = init2;
|
|
195663
195668
|
right = this.parseAssignmentExpression();
|
|
195664
|
-
|
|
195669
|
+
init2 = null;
|
|
195665
195670
|
forIn = false;
|
|
195666
195671
|
} else {
|
|
195667
195672
|
this.consumeSemicolon();
|
|
195668
|
-
|
|
195673
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
195669
195674
|
}
|
|
195670
195675
|
}
|
|
195671
195676
|
} else {
|
|
195672
195677
|
var initStartToken = this.lookahead;
|
|
195673
195678
|
var previousAllowIn = this.context.allowIn;
|
|
195674
195679
|
this.context.allowIn = false;
|
|
195675
|
-
|
|
195680
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
195676
195681
|
this.context.allowIn = previousAllowIn;
|
|
195677
195682
|
if (this.matchKeyword("in")) {
|
|
195678
|
-
if (!this.context.isAssignmentTarget ||
|
|
195683
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
195679
195684
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
195680
195685
|
}
|
|
195681
195686
|
this.nextToken();
|
|
195682
|
-
this.reinterpretExpressionAsPattern(
|
|
195683
|
-
left =
|
|
195687
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
195688
|
+
left = init2;
|
|
195684
195689
|
right = this.parseExpression();
|
|
195685
|
-
|
|
195690
|
+
init2 = null;
|
|
195686
195691
|
} else if (this.matchContextualKeyword("of")) {
|
|
195687
|
-
if (!this.context.isAssignmentTarget ||
|
|
195692
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
195688
195693
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
195689
195694
|
}
|
|
195690
195695
|
this.nextToken();
|
|
195691
|
-
this.reinterpretExpressionAsPattern(
|
|
195692
|
-
left =
|
|
195696
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
195697
|
+
left = init2;
|
|
195693
195698
|
right = this.parseAssignmentExpression();
|
|
195694
|
-
|
|
195699
|
+
init2 = null;
|
|
195695
195700
|
forIn = false;
|
|
195696
195701
|
} else {
|
|
195697
195702
|
if (this.match(",")) {
|
|
195698
|
-
var initSeq = [
|
|
195703
|
+
var initSeq = [init2];
|
|
195699
195704
|
while (this.match(",")) {
|
|
195700
195705
|
this.nextToken();
|
|
195701
195706
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
195702
195707
|
}
|
|
195703
|
-
|
|
195708
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
195704
195709
|
}
|
|
195705
195710
|
this.expect(";");
|
|
195706
195711
|
}
|
|
@@ -195726,7 +195731,7 @@ var require_esprima23 = __commonJS4({
|
|
|
195726
195731
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
195727
195732
|
this.context.inIteration = previousInIteration;
|
|
195728
195733
|
}
|
|
195729
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
195734
|
+
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init2, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body));
|
|
195730
195735
|
};
|
|
195731
195736
|
Parser2.prototype.parseContinueStatement = function() {
|
|
195732
195737
|
var node = this.createNode();
|
|
@@ -201099,10 +201104,10 @@ var require_printer3 = __commonJS4({
|
|
|
201099
201104
|
return (0, lines_1.concat)(parts);
|
|
201100
201105
|
}
|
|
201101
201106
|
case "ForStatement": {
|
|
201102
|
-
var
|
|
201103
|
-
var sep32 =
|
|
201107
|
+
var init2 = path32.call(print113, "init");
|
|
201108
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
201104
201109
|
var forParen = "for (";
|
|
201105
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
201110
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path32.call(print113, "test"), path32.call(print113, "update")]).indentTail(forParen.length);
|
|
201106
201111
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
201107
201112
|
var clause = adjustClause(path32.call(print113, "body"), options);
|
|
201108
201113
|
parts.push(head);
|
|
@@ -223436,10 +223441,10 @@ var require_ponyfill_es20182 = __commonJS5({
|
|
|
223436
223441
|
}
|
|
223437
223442
|
return size;
|
|
223438
223443
|
}
|
|
223439
|
-
function convertQueuingStrategy(
|
|
223440
|
-
assertDictionary(
|
|
223441
|
-
const highWaterMark =
|
|
223442
|
-
const size =
|
|
223444
|
+
function convertQueuingStrategy(init2, context) {
|
|
223445
|
+
assertDictionary(init2, context);
|
|
223446
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
223447
|
+
const size = init2 === null || init2 === void 0 ? void 0 : init2.size;
|
|
223443
223448
|
return {
|
|
223444
223449
|
highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark),
|
|
223445
223450
|
size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`)
|
|
@@ -225291,9 +225296,9 @@ var require_ponyfill_es20182 = __commonJS5({
|
|
|
225291
225296
|
function streamBrandCheckException$1(name) {
|
|
225292
225297
|
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
225293
225298
|
}
|
|
225294
|
-
function convertQueuingStrategyInit(
|
|
225295
|
-
assertDictionary(
|
|
225296
|
-
const highWaterMark =
|
|
225299
|
+
function convertQueuingStrategyInit(init2, context) {
|
|
225300
|
+
assertDictionary(init2, context);
|
|
225301
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
225297
225302
|
assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit");
|
|
225298
225303
|
return {
|
|
225299
225304
|
highWaterMark: convertUnrestrictedDouble(highWaterMark)
|
|
@@ -234461,10 +234466,10 @@ var require_generated24 = __commonJS5({
|
|
|
234461
234466
|
body
|
|
234462
234467
|
});
|
|
234463
234468
|
}
|
|
234464
|
-
function forStatement(
|
|
234469
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
234465
234470
|
return (0, _validateNode.default)({
|
|
234466
234471
|
type: "ForStatement",
|
|
234467
|
-
init,
|
|
234472
|
+
init: init2,
|
|
234468
234473
|
test,
|
|
234469
234474
|
update,
|
|
234470
234475
|
body
|
|
@@ -234682,11 +234687,11 @@ var require_generated24 = __commonJS5({
|
|
|
234682
234687
|
declarations
|
|
234683
234688
|
});
|
|
234684
234689
|
}
|
|
234685
|
-
function variableDeclarator(id,
|
|
234690
|
+
function variableDeclarator(id, init2 = null) {
|
|
234686
234691
|
return (0, _validateNode.default)({
|
|
234687
234692
|
type: "VariableDeclarator",
|
|
234688
234693
|
id,
|
|
234689
|
-
init
|
|
234694
|
+
init: init2
|
|
234690
234695
|
});
|
|
234691
234696
|
}
|
|
234692
234697
|
function whileStatement(test, body) {
|
|
@@ -235388,18 +235393,18 @@ var require_generated24 = __commonJS5({
|
|
|
235388
235393
|
init: null
|
|
235389
235394
|
});
|
|
235390
235395
|
}
|
|
235391
|
-
function enumNumberMember(id,
|
|
235396
|
+
function enumNumberMember(id, init2) {
|
|
235392
235397
|
return (0, _validateNode.default)({
|
|
235393
235398
|
type: "EnumNumberMember",
|
|
235394
235399
|
id,
|
|
235395
|
-
init
|
|
235400
|
+
init: init2
|
|
235396
235401
|
});
|
|
235397
235402
|
}
|
|
235398
|
-
function enumStringMember(id,
|
|
235403
|
+
function enumStringMember(id, init2) {
|
|
235399
235404
|
return (0, _validateNode.default)({
|
|
235400
235405
|
type: "EnumStringMember",
|
|
235401
235406
|
id,
|
|
235402
|
-
init
|
|
235407
|
+
init: init2
|
|
235403
235408
|
});
|
|
235404
235409
|
}
|
|
235405
235410
|
function enumDefaultedMember(id) {
|
|
@@ -247105,13 +247110,13 @@ var require_lib64 = __commonJS5({
|
|
|
247105
247110
|
flowEnumMemberRaw() {
|
|
247106
247111
|
const loc = this.state.startLoc;
|
|
247107
247112
|
const id = this.parseIdentifier(true);
|
|
247108
|
-
const
|
|
247113
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
247109
247114
|
type: "none",
|
|
247110
247115
|
loc
|
|
247111
247116
|
};
|
|
247112
247117
|
return {
|
|
247113
247118
|
id,
|
|
247114
|
-
init
|
|
247119
|
+
init: init2
|
|
247115
247120
|
};
|
|
247116
247121
|
}
|
|
247117
247122
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -247145,7 +247150,7 @@ var require_lib64 = __commonJS5({
|
|
|
247145
247150
|
const memberNode = this.startNode();
|
|
247146
247151
|
const {
|
|
247147
247152
|
id,
|
|
247148
|
-
init
|
|
247153
|
+
init: init2
|
|
247149
247154
|
} = this.flowEnumMemberRaw();
|
|
247150
247155
|
const memberName = id.name;
|
|
247151
247156
|
if (memberName === "") {
|
|
@@ -247171,35 +247176,35 @@ var require_lib64 = __commonJS5({
|
|
|
247171
247176
|
memberName
|
|
247172
247177
|
};
|
|
247173
247178
|
memberNode.id = id;
|
|
247174
|
-
switch (
|
|
247179
|
+
switch (init2.type) {
|
|
247175
247180
|
case "boolean": {
|
|
247176
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
247177
|
-
memberNode.init =
|
|
247181
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
247182
|
+
memberNode.init = init2.value;
|
|
247178
247183
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
247179
247184
|
break;
|
|
247180
247185
|
}
|
|
247181
247186
|
case "number": {
|
|
247182
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
247183
|
-
memberNode.init =
|
|
247187
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
247188
|
+
memberNode.init = init2.value;
|
|
247184
247189
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
247185
247190
|
break;
|
|
247186
247191
|
}
|
|
247187
247192
|
case "string": {
|
|
247188
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
247189
|
-
memberNode.init =
|
|
247193
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
247194
|
+
memberNode.init = init2.value;
|
|
247190
247195
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
247191
247196
|
break;
|
|
247192
247197
|
}
|
|
247193
247198
|
case "invalid": {
|
|
247194
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
247199
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
247195
247200
|
}
|
|
247196
247201
|
case "none": {
|
|
247197
247202
|
switch (explicitType) {
|
|
247198
247203
|
case "boolean":
|
|
247199
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
247204
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
247200
247205
|
break;
|
|
247201
247206
|
case "number":
|
|
247202
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
247207
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
247203
247208
|
break;
|
|
247204
247209
|
default:
|
|
247205
247210
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -250300,14 +250305,14 @@ var require_lib64 = __commonJS5({
|
|
|
250300
250305
|
return declaration;
|
|
250301
250306
|
for (const {
|
|
250302
250307
|
id,
|
|
250303
|
-
init
|
|
250308
|
+
init: init2
|
|
250304
250309
|
} of declaration.declarations) {
|
|
250305
|
-
if (!
|
|
250310
|
+
if (!init2)
|
|
250306
250311
|
continue;
|
|
250307
250312
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
250308
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
250309
|
-
} else if (!isValidAmbientConstInitializer(
|
|
250310
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
250313
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
250314
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
250315
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
250311
250316
|
}
|
|
250312
250317
|
}
|
|
250313
250318
|
return declaration;
|
|
@@ -253787,49 +253792,49 @@ var require_lib64 = __commonJS5({
|
|
|
253787
253792
|
}
|
|
253788
253793
|
this.next();
|
|
253789
253794
|
this.parseVar(initNode, true, kind);
|
|
253790
|
-
const
|
|
253795
|
+
const init3 = this.finishNode(initNode, "VariableDeclaration");
|
|
253791
253796
|
const isForIn = this.match(58);
|
|
253792
253797
|
if (isForIn && starsWithUsingDeclaration) {
|
|
253793
|
-
this.raise(Errors.ForInUsing,
|
|
253798
|
+
this.raise(Errors.ForInUsing, init3);
|
|
253794
253799
|
}
|
|
253795
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
253796
|
-
return this.parseForIn(node,
|
|
253800
|
+
if ((isForIn || this.isContextual(102)) && init3.declarations.length === 1) {
|
|
253801
|
+
return this.parseForIn(node, init3, awaitAt);
|
|
253797
253802
|
}
|
|
253798
253803
|
if (awaitAt !== null) {
|
|
253799
253804
|
this.unexpected(awaitAt);
|
|
253800
253805
|
}
|
|
253801
|
-
return this.parseFor(node,
|
|
253806
|
+
return this.parseFor(node, init3);
|
|
253802
253807
|
}
|
|
253803
253808
|
}
|
|
253804
253809
|
const startsWithAsync = this.isContextual(95);
|
|
253805
253810
|
const refExpressionErrors = new ExpressionErrors();
|
|
253806
|
-
const
|
|
253811
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
253807
253812
|
const isForOf = this.isContextual(102);
|
|
253808
253813
|
if (isForOf) {
|
|
253809
253814
|
if (startsWithLet) {
|
|
253810
|
-
this.raise(Errors.ForOfLet,
|
|
253815
|
+
this.raise(Errors.ForOfLet, init2);
|
|
253811
253816
|
}
|
|
253812
|
-
if (awaitAt === null && startsWithAsync &&
|
|
253813
|
-
this.raise(Errors.ForOfAsync,
|
|
253817
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
253818
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
253814
253819
|
}
|
|
253815
253820
|
}
|
|
253816
253821
|
if (isForOf || this.match(58)) {
|
|
253817
253822
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
253818
|
-
this.toAssignable(
|
|
253823
|
+
this.toAssignable(init2, true);
|
|
253819
253824
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
253820
|
-
this.checkLVal(
|
|
253825
|
+
this.checkLVal(init2, {
|
|
253821
253826
|
in: {
|
|
253822
253827
|
type
|
|
253823
253828
|
}
|
|
253824
253829
|
});
|
|
253825
|
-
return this.parseForIn(node,
|
|
253830
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
253826
253831
|
} else {
|
|
253827
253832
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
253828
253833
|
}
|
|
253829
253834
|
if (awaitAt !== null) {
|
|
253830
253835
|
this.unexpected(awaitAt);
|
|
253831
253836
|
}
|
|
253832
|
-
return this.parseFor(node,
|
|
253837
|
+
return this.parseFor(node, init2);
|
|
253833
253838
|
}
|
|
253834
253839
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
253835
253840
|
this.next();
|
|
@@ -254051,8 +254056,8 @@ var require_lib64 = __commonJS5({
|
|
|
254051
254056
|
}
|
|
254052
254057
|
this.next();
|
|
254053
254058
|
}
|
|
254054
|
-
parseFor(node,
|
|
254055
|
-
node.init =
|
|
254059
|
+
parseFor(node, init2) {
|
|
254060
|
+
node.init = init2;
|
|
254056
254061
|
this.semicolon(false);
|
|
254057
254062
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
254058
254063
|
this.semicolon(false);
|
|
@@ -254063,7 +254068,7 @@ var require_lib64 = __commonJS5({
|
|
|
254063
254068
|
this.state.labels.pop();
|
|
254064
254069
|
return this.finishNode(node, "ForStatement");
|
|
254065
254070
|
}
|
|
254066
|
-
parseForIn(node,
|
|
254071
|
+
parseForIn(node, init2, awaitAt) {
|
|
254067
254072
|
const isForIn = this.match(58);
|
|
254068
254073
|
this.next();
|
|
254069
254074
|
if (isForIn) {
|
|
@@ -254072,19 +254077,19 @@ var require_lib64 = __commonJS5({
|
|
|
254072
254077
|
} else {
|
|
254073
254078
|
node.await = awaitAt !== null;
|
|
254074
254079
|
}
|
|
254075
|
-
if (
|
|
254076
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
254080
|
+
if (init2.type === "VariableDeclaration" && init2.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init2.kind !== "var" || init2.declarations[0].id.type !== "Identifier")) {
|
|
254081
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
254077
254082
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
254078
254083
|
});
|
|
254079
254084
|
}
|
|
254080
|
-
if (
|
|
254081
|
-
this.raise(Errors.InvalidLhs,
|
|
254085
|
+
if (init2.type === "AssignmentPattern") {
|
|
254086
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
254082
254087
|
ancestor: {
|
|
254083
254088
|
type: "ForStatement"
|
|
254084
254089
|
}
|
|
254085
254090
|
});
|
|
254086
254091
|
}
|
|
254087
|
-
node.left =
|
|
254092
|
+
node.left = init2;
|
|
254088
254093
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
254089
254094
|
this.expect(11);
|
|
254090
254095
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -256028,11 +256033,11 @@ var require_types5 = __commonJS5({
|
|
|
256028
256033
|
}();
|
|
256029
256034
|
exports.Def = Def;
|
|
256030
256035
|
var Field = function() {
|
|
256031
|
-
function Field2(name, type, defaultFn,
|
|
256036
|
+
function Field2(name, type, defaultFn, hidden72) {
|
|
256032
256037
|
this.name = name;
|
|
256033
256038
|
this.type = type;
|
|
256034
256039
|
this.defaultFn = defaultFn;
|
|
256035
|
-
this.hidden = !!
|
|
256040
|
+
this.hidden = !!hidden72;
|
|
256036
256041
|
}
|
|
256037
256042
|
Field2.prototype.toString = function() {
|
|
256038
256043
|
return JSON.stringify(this.name) + ": " + this.type;
|
|
@@ -256281,12 +256286,12 @@ var require_types5 = __commonJS5({
|
|
|
256281
256286
|
});
|
|
256282
256287
|
return this;
|
|
256283
256288
|
};
|
|
256284
|
-
DefImpl2.prototype.field = function(name, type, defaultFn,
|
|
256289
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden72) {
|
|
256285
256290
|
if (this.finalized) {
|
|
256286
256291
|
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
256287
256292
|
return this;
|
|
256288
256293
|
}
|
|
256289
|
-
this.ownFields[name] = new Field(name, Type.from(type), defaultFn,
|
|
256294
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden72);
|
|
256290
256295
|
return this;
|
|
256291
256296
|
};
|
|
256292
256297
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -256883,13 +256888,13 @@ var require_scope5 = __commonJS5({
|
|
|
256883
256888
|
var name = prefix + index;
|
|
256884
256889
|
return this.bindings[name] = types19.builders.identifier(name);
|
|
256885
256890
|
};
|
|
256886
|
-
Sp.injectTemporary = function(identifier,
|
|
256891
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
256887
256892
|
identifier || (identifier = this.declareTemporary());
|
|
256888
256893
|
var bodyPath = this.path.get("body");
|
|
256889
256894
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
256890
256895
|
bodyPath = bodyPath.get("body");
|
|
256891
256896
|
}
|
|
256892
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
256897
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
256893
256898
|
return identifier;
|
|
256894
256899
|
};
|
|
256895
256900
|
Sp.scan = function(force) {
|
|
@@ -257658,7 +257663,7 @@ var require_path_visitor5 = __commonJS5({
|
|
|
257658
257663
|
return Context;
|
|
257659
257664
|
}
|
|
257660
257665
|
var sharedContextProtoMethods = /* @__PURE__ */ Object.create(null);
|
|
257661
|
-
sharedContextProtoMethods.reset = function
|
|
257666
|
+
sharedContextProtoMethods.reset = function reset72(path42) {
|
|
257662
257667
|
if (!(this instanceof this.Context)) {
|
|
257663
257668
|
throw new Error("");
|
|
257664
257669
|
}
|
|
@@ -262369,9 +262374,9 @@ var require_esprima24 = __commonJS5({
|
|
|
262369
262374
|
}();
|
|
262370
262375
|
exports2.ForOfStatement = ForOfStatement;
|
|
262371
262376
|
var ForStatement = function() {
|
|
262372
|
-
function ForStatement2(
|
|
262377
|
+
function ForStatement2(init2, test, update, body) {
|
|
262373
262378
|
this.type = syntax_1.Syntax.ForStatement;
|
|
262374
|
-
this.init =
|
|
262379
|
+
this.init = init2;
|
|
262375
262380
|
this.test = test;
|
|
262376
262381
|
this.update = update;
|
|
262377
262382
|
this.body = body;
|
|
@@ -262711,10 +262716,10 @@ var require_esprima24 = __commonJS5({
|
|
|
262711
262716
|
}();
|
|
262712
262717
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
262713
262718
|
var VariableDeclarator = function() {
|
|
262714
|
-
function VariableDeclarator2(id,
|
|
262719
|
+
function VariableDeclarator2(id, init2) {
|
|
262715
262720
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
262716
262721
|
this.id = id;
|
|
262717
|
-
this.init =
|
|
262722
|
+
this.init = init2;
|
|
262718
262723
|
}
|
|
262719
262724
|
return VariableDeclarator2;
|
|
262720
262725
|
}();
|
|
@@ -263419,8 +263424,8 @@ var require_esprima24 = __commonJS5({
|
|
|
263419
263424
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
263420
263425
|
this.nextToken();
|
|
263421
263426
|
shorthand = true;
|
|
263422
|
-
var
|
|
263423
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
263427
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
263428
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
263424
263429
|
} else {
|
|
263425
263430
|
shorthand = true;
|
|
263426
263431
|
value = id;
|
|
@@ -264198,21 +264203,21 @@ var require_esprima24 = __commonJS5({
|
|
|
264198
264203
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
264199
264204
|
}
|
|
264200
264205
|
}
|
|
264201
|
-
var
|
|
264206
|
+
var init2 = null;
|
|
264202
264207
|
if (kind === "const") {
|
|
264203
264208
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
264204
264209
|
if (this.match("=")) {
|
|
264205
264210
|
this.nextToken();
|
|
264206
|
-
|
|
264211
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
264207
264212
|
} else {
|
|
264208
264213
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
264209
264214
|
}
|
|
264210
264215
|
}
|
|
264211
264216
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
264212
264217
|
this.expect("=");
|
|
264213
|
-
|
|
264218
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
264214
264219
|
}
|
|
264215
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
264220
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
264216
264221
|
};
|
|
264217
264222
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
264218
264223
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -264276,17 +264281,17 @@ var require_esprima24 = __commonJS5({
|
|
|
264276
264281
|
if (this.lookahead.type === 3) {
|
|
264277
264282
|
var keyToken = this.lookahead;
|
|
264278
264283
|
key = this.parseVariableIdentifier();
|
|
264279
|
-
var
|
|
264284
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
264280
264285
|
if (this.match("=")) {
|
|
264281
264286
|
params.push(keyToken);
|
|
264282
264287
|
shorthand = true;
|
|
264283
264288
|
this.nextToken();
|
|
264284
264289
|
var expr = this.parseAssignmentExpression();
|
|
264285
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
264290
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
264286
264291
|
} else if (!this.match(":")) {
|
|
264287
264292
|
params.push(keyToken);
|
|
264288
264293
|
shorthand = true;
|
|
264289
|
-
value =
|
|
264294
|
+
value = init2;
|
|
264290
264295
|
} else {
|
|
264291
264296
|
this.expect(":");
|
|
264292
264297
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -264371,14 +264376,14 @@ var require_esprima24 = __commonJS5({
|
|
|
264371
264376
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
264372
264377
|
}
|
|
264373
264378
|
}
|
|
264374
|
-
var
|
|
264379
|
+
var init2 = null;
|
|
264375
264380
|
if (this.match("=")) {
|
|
264376
264381
|
this.nextToken();
|
|
264377
|
-
|
|
264382
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
264378
264383
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
264379
264384
|
this.expect("=");
|
|
264380
264385
|
}
|
|
264381
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
264386
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
264382
264387
|
};
|
|
264383
264388
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
264384
264389
|
var opt = { inFor: options.inFor };
|
|
@@ -264473,7 +264478,7 @@ var require_esprima24 = __commonJS5({
|
|
|
264473
264478
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
264474
264479
|
};
|
|
264475
264480
|
Parser2.prototype.parseForStatement = function() {
|
|
264476
|
-
var
|
|
264481
|
+
var init2 = null;
|
|
264477
264482
|
var test = null;
|
|
264478
264483
|
var update = null;
|
|
264479
264484
|
var forIn = true;
|
|
@@ -264485,7 +264490,7 @@ var require_esprima24 = __commonJS5({
|
|
|
264485
264490
|
this.nextToken();
|
|
264486
264491
|
} else {
|
|
264487
264492
|
if (this.matchKeyword("var")) {
|
|
264488
|
-
|
|
264493
|
+
init2 = this.createNode();
|
|
264489
264494
|
this.nextToken();
|
|
264490
264495
|
var previousAllowIn = this.context.allowIn;
|
|
264491
264496
|
this.context.allowIn = false;
|
|
@@ -264496,87 +264501,87 @@ var require_esprima24 = __commonJS5({
|
|
|
264496
264501
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
264497
264502
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
264498
264503
|
}
|
|
264499
|
-
|
|
264504
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
264500
264505
|
this.nextToken();
|
|
264501
|
-
left =
|
|
264506
|
+
left = init2;
|
|
264502
264507
|
right = this.parseExpression();
|
|
264503
|
-
|
|
264508
|
+
init2 = null;
|
|
264504
264509
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
264505
|
-
|
|
264510
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
264506
264511
|
this.nextToken();
|
|
264507
|
-
left =
|
|
264512
|
+
left = init2;
|
|
264508
264513
|
right = this.parseAssignmentExpression();
|
|
264509
|
-
|
|
264514
|
+
init2 = null;
|
|
264510
264515
|
forIn = false;
|
|
264511
264516
|
} else {
|
|
264512
|
-
|
|
264517
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
264513
264518
|
this.expect(";");
|
|
264514
264519
|
}
|
|
264515
264520
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
264516
|
-
|
|
264521
|
+
init2 = this.createNode();
|
|
264517
264522
|
var kind = this.nextToken().value;
|
|
264518
264523
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
264519
|
-
|
|
264524
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
264520
264525
|
this.nextToken();
|
|
264521
|
-
left =
|
|
264526
|
+
left = init2;
|
|
264522
264527
|
right = this.parseExpression();
|
|
264523
|
-
|
|
264528
|
+
init2 = null;
|
|
264524
264529
|
} else {
|
|
264525
264530
|
var previousAllowIn = this.context.allowIn;
|
|
264526
264531
|
this.context.allowIn = false;
|
|
264527
264532
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
264528
264533
|
this.context.allowIn = previousAllowIn;
|
|
264529
264534
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
264530
|
-
|
|
264535
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
264531
264536
|
this.nextToken();
|
|
264532
|
-
left =
|
|
264537
|
+
left = init2;
|
|
264533
264538
|
right = this.parseExpression();
|
|
264534
|
-
|
|
264539
|
+
init2 = null;
|
|
264535
264540
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
264536
|
-
|
|
264541
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
264537
264542
|
this.nextToken();
|
|
264538
|
-
left =
|
|
264543
|
+
left = init2;
|
|
264539
264544
|
right = this.parseAssignmentExpression();
|
|
264540
|
-
|
|
264545
|
+
init2 = null;
|
|
264541
264546
|
forIn = false;
|
|
264542
264547
|
} else {
|
|
264543
264548
|
this.consumeSemicolon();
|
|
264544
|
-
|
|
264549
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
264545
264550
|
}
|
|
264546
264551
|
}
|
|
264547
264552
|
} else {
|
|
264548
264553
|
var initStartToken = this.lookahead;
|
|
264549
264554
|
var previousAllowIn = this.context.allowIn;
|
|
264550
264555
|
this.context.allowIn = false;
|
|
264551
|
-
|
|
264556
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
264552
264557
|
this.context.allowIn = previousAllowIn;
|
|
264553
264558
|
if (this.matchKeyword("in")) {
|
|
264554
|
-
if (!this.context.isAssignmentTarget ||
|
|
264559
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
264555
264560
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
264556
264561
|
}
|
|
264557
264562
|
this.nextToken();
|
|
264558
|
-
this.reinterpretExpressionAsPattern(
|
|
264559
|
-
left =
|
|
264563
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
264564
|
+
left = init2;
|
|
264560
264565
|
right = this.parseExpression();
|
|
264561
|
-
|
|
264566
|
+
init2 = null;
|
|
264562
264567
|
} else if (this.matchContextualKeyword("of")) {
|
|
264563
|
-
if (!this.context.isAssignmentTarget ||
|
|
264568
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
264564
264569
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
264565
264570
|
}
|
|
264566
264571
|
this.nextToken();
|
|
264567
|
-
this.reinterpretExpressionAsPattern(
|
|
264568
|
-
left =
|
|
264572
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
264573
|
+
left = init2;
|
|
264569
264574
|
right = this.parseAssignmentExpression();
|
|
264570
|
-
|
|
264575
|
+
init2 = null;
|
|
264571
264576
|
forIn = false;
|
|
264572
264577
|
} else {
|
|
264573
264578
|
if (this.match(",")) {
|
|
264574
|
-
var initSeq = [
|
|
264579
|
+
var initSeq = [init2];
|
|
264575
264580
|
while (this.match(",")) {
|
|
264576
264581
|
this.nextToken();
|
|
264577
264582
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
264578
264583
|
}
|
|
264579
|
-
|
|
264584
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
264580
264585
|
}
|
|
264581
264586
|
this.expect(";");
|
|
264582
264587
|
}
|
|
@@ -264602,7 +264607,7 @@ var require_esprima24 = __commonJS5({
|
|
|
264602
264607
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
264603
264608
|
this.context.inIteration = previousInIteration;
|
|
264604
264609
|
}
|
|
264605
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
264610
|
+
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(init2, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body));
|
|
264606
264611
|
};
|
|
264607
264612
|
Parser2.prototype.parseContinueStatement = function() {
|
|
264608
264613
|
var node = this.createNode();
|
|
@@ -269975,10 +269980,10 @@ var require_printer5 = __commonJS5({
|
|
|
269975
269980
|
return (0, lines_1.concat)(parts);
|
|
269976
269981
|
}
|
|
269977
269982
|
case "ForStatement": {
|
|
269978
|
-
var
|
|
269979
|
-
var sep32 =
|
|
269983
|
+
var init2 = path42.call(print132, "init");
|
|
269984
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
269980
269985
|
var forParen = "for (";
|
|
269981
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
269986
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path42.call(print132, "test"), path42.call(print132, "update")]).indentTail(forParen.length);
|
|
269982
269987
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
269983
269988
|
var clause = adjustClause(path42.call(print132, "body"), options);
|
|
269984
269989
|
parts.push(head);
|
|
@@ -278186,23 +278191,23 @@ var validateHeaderValue2 = typeof http2.validateHeaderValue === "function" ? htt
|
|
|
278186
278191
|
}
|
|
278187
278192
|
};
|
|
278188
278193
|
var Headers2 = class extends URLSearchParams {
|
|
278189
|
-
constructor(
|
|
278194
|
+
constructor(init2) {
|
|
278190
278195
|
let result = [];
|
|
278191
|
-
if (
|
|
278192
|
-
const raw =
|
|
278196
|
+
if (init2 instanceof Headers2) {
|
|
278197
|
+
const raw = init2.raw();
|
|
278193
278198
|
for (const [name, values] of Object.entries(raw)) {
|
|
278194
278199
|
result.push(...values.map((value) => [name, value]));
|
|
278195
278200
|
}
|
|
278196
|
-
} else if (
|
|
278197
|
-
} else if (typeof
|
|
278198
|
-
const method =
|
|
278201
|
+
} else if (init2 == null) {
|
|
278202
|
+
} else if (typeof init2 === "object" && !types32.isBoxedPrimitive(init2)) {
|
|
278203
|
+
const method = init2[Symbol.iterator];
|
|
278199
278204
|
if (method == null) {
|
|
278200
|
-
result.push(...Object.entries(
|
|
278205
|
+
result.push(...Object.entries(init2));
|
|
278201
278206
|
} else {
|
|
278202
278207
|
if (typeof method !== "function") {
|
|
278203
278208
|
throw new TypeError("Header pairs must be iterable");
|
|
278204
278209
|
}
|
|
278205
|
-
result = [...
|
|
278210
|
+
result = [...init2].map((pair) => {
|
|
278206
278211
|
if (typeof pair !== "object" || types32.isBoxedPrimitive(pair)) {
|
|
278207
278212
|
throw new TypeError("Each header pair must be an iterable object");
|
|
278208
278213
|
}
|
|
@@ -278397,17 +278402,17 @@ var Response22 = class extends Body2 {
|
|
|
278397
278402
|
response[INTERNALS22].type = "error";
|
|
278398
278403
|
return response;
|
|
278399
278404
|
}
|
|
278400
|
-
static json(data = void 0,
|
|
278405
|
+
static json(data = void 0, init2 = {}) {
|
|
278401
278406
|
const body = JSON.stringify(data);
|
|
278402
278407
|
if (body === void 0) {
|
|
278403
278408
|
throw new TypeError("data is not JSON serializable");
|
|
278404
278409
|
}
|
|
278405
|
-
const headers = new Headers2(
|
|
278410
|
+
const headers = new Headers2(init2 && init2.headers);
|
|
278406
278411
|
if (!headers.has("content-type")) {
|
|
278407
278412
|
headers.set("content-type", "application/json");
|
|
278408
278413
|
}
|
|
278409
278414
|
return new Response22(body, {
|
|
278410
|
-
...
|
|
278415
|
+
...init2,
|
|
278411
278416
|
headers
|
|
278412
278417
|
});
|
|
278413
278418
|
}
|
|
@@ -278453,7 +278458,7 @@ var doBadDataWarn2 = deprecate22(
|
|
|
278453
278458
|
"https://github.com/node-fetch/node-fetch/issues/1000 (request)"
|
|
278454
278459
|
);
|
|
278455
278460
|
var Request22 = class extends Body2 {
|
|
278456
|
-
constructor(input,
|
|
278461
|
+
constructor(input, init2 = {}) {
|
|
278457
278462
|
let parsedURL;
|
|
278458
278463
|
if (isRequest2(input)) {
|
|
278459
278464
|
parsedURL = new URL(input.url);
|
|
@@ -278464,21 +278469,21 @@ var Request22 = class extends Body2 {
|
|
|
278464
278469
|
if (parsedURL.username !== "" || parsedURL.password !== "") {
|
|
278465
278470
|
throw new TypeError(`${parsedURL} is an url with embedded credentials.`);
|
|
278466
278471
|
}
|
|
278467
|
-
let method =
|
|
278472
|
+
let method = init2.method || input.method || "GET";
|
|
278468
278473
|
if (/^(delete|get|head|options|post|put)$/i.test(method)) {
|
|
278469
278474
|
method = method.toUpperCase();
|
|
278470
278475
|
}
|
|
278471
|
-
if (!isRequest2(
|
|
278476
|
+
if (!isRequest2(init2) && "data" in init2) {
|
|
278472
278477
|
doBadDataWarn2();
|
|
278473
278478
|
}
|
|
278474
|
-
if ((
|
|
278479
|
+
if ((init2.body != null || isRequest2(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
|
278475
278480
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
|
278476
278481
|
}
|
|
278477
|
-
const inputBody =
|
|
278482
|
+
const inputBody = init2.body ? init2.body : isRequest2(input) && input.body !== null ? clone2(input) : null;
|
|
278478
278483
|
super(inputBody, {
|
|
278479
|
-
size:
|
|
278484
|
+
size: init2.size || input.size || 0
|
|
278480
278485
|
});
|
|
278481
|
-
const headers = new Headers2(
|
|
278486
|
+
const headers = new Headers2(init2.headers || input.headers || {});
|
|
278482
278487
|
if (inputBody !== null && !headers.has("Content-Type")) {
|
|
278483
278488
|
const contentType = extractContentType2(inputBody, this);
|
|
278484
278489
|
if (contentType) {
|
|
@@ -278486,13 +278491,13 @@ var Request22 = class extends Body2 {
|
|
|
278486
278491
|
}
|
|
278487
278492
|
}
|
|
278488
278493
|
let signal = isRequest2(input) ? input.signal : null;
|
|
278489
|
-
if ("signal" in
|
|
278490
|
-
signal =
|
|
278494
|
+
if ("signal" in init2) {
|
|
278495
|
+
signal = init2.signal;
|
|
278491
278496
|
}
|
|
278492
278497
|
if (signal != null && !isAbortSignal2(signal)) {
|
|
278493
278498
|
throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
|
|
278494
278499
|
}
|
|
278495
|
-
let referrer =
|
|
278500
|
+
let referrer = init2.referrer == null ? input.referrer : init2.referrer;
|
|
278496
278501
|
if (referrer === "") {
|
|
278497
278502
|
referrer = "no-referrer";
|
|
278498
278503
|
} else if (referrer) {
|
|
@@ -278503,19 +278508,19 @@ var Request22 = class extends Body2 {
|
|
|
278503
278508
|
}
|
|
278504
278509
|
this[INTERNALS32] = {
|
|
278505
278510
|
method,
|
|
278506
|
-
redirect:
|
|
278511
|
+
redirect: init2.redirect || input.redirect || "follow",
|
|
278507
278512
|
headers,
|
|
278508
278513
|
parsedURL,
|
|
278509
278514
|
signal,
|
|
278510
278515
|
referrer
|
|
278511
278516
|
};
|
|
278512
|
-
this.follow =
|
|
278513
|
-
this.compress =
|
|
278514
|
-
this.counter =
|
|
278515
|
-
this.agent =
|
|
278516
|
-
this.highWaterMark =
|
|
278517
|
-
this.insecureHTTPParser =
|
|
278518
|
-
this.referrerPolicy =
|
|
278517
|
+
this.follow = init2.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init2.follow;
|
|
278518
|
+
this.compress = init2.compress === void 0 ? input.compress === void 0 ? true : input.compress : init2.compress;
|
|
278519
|
+
this.counter = init2.counter || input.counter || 0;
|
|
278520
|
+
this.agent = init2.agent || input.agent;
|
|
278521
|
+
this.highWaterMark = init2.highWaterMark || input.highWaterMark || 16384;
|
|
278522
|
+
this.insecureHTTPParser = init2.insecureHTTPParser || input.insecureHTTPParser || false;
|
|
278523
|
+
this.referrerPolicy = init2.referrerPolicy || input.referrerPolicy || "";
|
|
278519
278524
|
}
|
|
278520
278525
|
get method() {
|
|
278521
278526
|
return this[INTERNALS32].method;
|
|
@@ -281382,6 +281387,53 @@ For more information, please visit these links:
|
|
|
281382
281387
|
- https://graphql.org/learn/global-object-identification/
|
|
281383
281388
|
- ${siteURL3}/guides/caching-data#custom-ids
|
|
281384
281389
|
`;
|
|
281390
|
+
var FORCE_COLOR;
|
|
281391
|
+
var NODE_DISABLE_COLORS;
|
|
281392
|
+
var NO_COLOR;
|
|
281393
|
+
var TERM;
|
|
281394
|
+
var isTTY = true;
|
|
281395
|
+
if (typeof process !== "undefined") {
|
|
281396
|
+
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
|
|
281397
|
+
isTTY = process.stdout && process.stdout.isTTY;
|
|
281398
|
+
}
|
|
281399
|
+
var $ = {
|
|
281400
|
+
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
|
|
281401
|
+
};
|
|
281402
|
+
function init(x22, y) {
|
|
281403
|
+
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
|
|
281404
|
+
let open = `\x1B[${x22}m`, close = `\x1B[${y}m`;
|
|
281405
|
+
return function(txt) {
|
|
281406
|
+
if (!$.enabled || txt == null)
|
|
281407
|
+
return txt;
|
|
281408
|
+
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
|
|
281409
|
+
};
|
|
281410
|
+
}
|
|
281411
|
+
var reset6 = init(0, 0);
|
|
281412
|
+
var bold6 = init(1, 22);
|
|
281413
|
+
var dim6 = init(2, 22);
|
|
281414
|
+
var italic6 = init(3, 23);
|
|
281415
|
+
var underline6 = init(4, 24);
|
|
281416
|
+
var inverse6 = init(7, 27);
|
|
281417
|
+
var hidden6 = init(8, 28);
|
|
281418
|
+
var strikethrough6 = init(9, 29);
|
|
281419
|
+
var black6 = init(30, 39);
|
|
281420
|
+
var red6 = init(31, 39);
|
|
281421
|
+
var green6 = init(32, 39);
|
|
281422
|
+
var yellow6 = init(33, 39);
|
|
281423
|
+
var blue6 = init(34, 39);
|
|
281424
|
+
var magenta6 = init(35, 39);
|
|
281425
|
+
var cyan6 = init(36, 39);
|
|
281426
|
+
var white6 = init(37, 39);
|
|
281427
|
+
var gray6 = init(90, 39);
|
|
281428
|
+
var grey = init(90, 39);
|
|
281429
|
+
var bgBlack6 = init(40, 49);
|
|
281430
|
+
var bgRed6 = init(41, 49);
|
|
281431
|
+
var bgGreen6 = init(42, 49);
|
|
281432
|
+
var bgYellow6 = init(43, 49);
|
|
281433
|
+
var bgBlue6 = init(44, 49);
|
|
281434
|
+
var bgMagenta6 = init(45, 49);
|
|
281435
|
+
var bgCyan6 = init(46, 49);
|
|
281436
|
+
var bgWhite6 = init(47, 49);
|
|
281385
281437
|
var recast142 = __toESM5(require_main24(), 1);
|
|
281386
281438
|
var AST152 = recast142.types.builders;
|
|
281387
281439
|
function find_insert_index(script) {
|
|
@@ -281410,21 +281462,21 @@ function find_exported_fn(body, name) {
|
|
|
281410
281462
|
continue;
|
|
281411
281463
|
}
|
|
281412
281464
|
const declaration = value.declarations[0];
|
|
281413
|
-
let { init } = declaration;
|
|
281414
|
-
if (!
|
|
281465
|
+
let { init: init2 } = declaration;
|
|
281466
|
+
if (!init2) {
|
|
281415
281467
|
continue;
|
|
281416
281468
|
}
|
|
281417
|
-
if (
|
|
281418
|
-
|
|
281469
|
+
if (init2.type === "TSSatisfiesExpression") {
|
|
281470
|
+
init2 = init2.expression;
|
|
281419
281471
|
}
|
|
281420
|
-
if (
|
|
281421
|
-
|
|
281472
|
+
if (init2.type === "CallExpression" && init2.arguments[0] && (init2.arguments[0].type === "FunctionExpression" || init2.arguments[0].type === "ArrowFunctionExpression")) {
|
|
281473
|
+
init2 = init2.arguments[0];
|
|
281422
281474
|
}
|
|
281423
|
-
if (
|
|
281424
|
-
return { declaration:
|
|
281475
|
+
if (init2.type === "FunctionExpression" || init2.type === "ArrowFunctionExpression") {
|
|
281476
|
+
return { declaration: init2, export: exportDeclaration };
|
|
281425
281477
|
}
|
|
281426
|
-
if (
|
|
281427
|
-
return { declaration:
|
|
281478
|
+
if (init2.type === "Identifier" || init2.type === "CallExpression") {
|
|
281479
|
+
return { declaration: init2, export: exportDeclaration };
|
|
281428
281480
|
}
|
|
281429
281481
|
} else {
|
|
281430
281482
|
continue;
|
|
@@ -281852,7 +281904,7 @@ var END3 = `$$KitQLEND$$`;
|
|
|
281852
281904
|
var colorBrowser3 = (style, str) => {
|
|
281853
281905
|
return `${START13}${style}${START23}${str}${END3}`;
|
|
281854
281906
|
};
|
|
281855
|
-
var
|
|
281907
|
+
var yellow7 = (str) => {
|
|
281856
281908
|
return color3("yellow", str);
|
|
281857
281909
|
};
|
|
281858
281910
|
|
|
@@ -281958,7 +282010,7 @@ async function processScript(config, filepath, program, mockArtifacts) {
|
|
|
281958
282010
|
load.push(result);
|
|
281959
282011
|
if (!result) {
|
|
281960
282012
|
throw new Error(
|
|
281961
|
-
`Could not find ${
|
|
282013
|
+
`Could not find ${yellow7(element.name)} for computing ${yellow7(houdini_load_fn)}. (if it was a global store, you need to instantiate the store manually.)
|
|
281962
282014
|
filepath: ${filepath}`
|
|
281963
282015
|
);
|
|
281964
282016
|
}
|
|
@@ -283227,7 +283279,7 @@ async function QueryProcessor(config, page) {
|
|
|
283227
283279
|
if (query.variableDefinitions && query.variableDefinitions?.length > 0 && has_variables === null) {
|
|
283228
283280
|
formatErrors({
|
|
283229
283281
|
filepath: page.filepath,
|
|
283230
|
-
message: `Could not find required variable function: ${
|
|
283282
|
+
message: `Could not find required variable function: ${yellow7(
|
|
283231
283283
|
variable_fn
|
|
283232
283284
|
)}. maybe its not exported? `
|
|
283233
283285
|
});
|
|
@@ -283784,7 +283836,7 @@ function variable_function_for_query(page, query, has_local) {
|
|
|
283784
283836
|
if (missing_args.length > 0 && !has_local) {
|
|
283785
283837
|
throw {
|
|
283786
283838
|
filepath: page.filepath,
|
|
283787
|
-
message: `Could not find required variable function: ${
|
|
283839
|
+
message: `Could not find required variable function: ${yellow7(
|
|
283788
283840
|
query_variable_fn(query.name.value)
|
|
283789
283841
|
)}. maybe its not exported?`
|
|
283790
283842
|
};
|