houdini-svelte 2.1.18 → 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
|
@@ -1662,13 +1662,13 @@ var require_scope2 = __commonJS({
|
|
|
1662
1662
|
var name = prefix + index;
|
|
1663
1663
|
return this.bindings[name] = types11.builders.identifier(name);
|
|
1664
1664
|
};
|
|
1665
|
-
Sp.injectTemporary = function(identifier,
|
|
1665
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
1666
1666
|
identifier || (identifier = this.declareTemporary());
|
|
1667
1667
|
var bodyPath = this.path.get("body");
|
|
1668
1668
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
1669
1669
|
bodyPath = bodyPath.get("body");
|
|
1670
1670
|
}
|
|
1671
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
1671
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
1672
1672
|
return identifier;
|
|
1673
1673
|
};
|
|
1674
1674
|
Sp.scan = function(force) {
|
|
@@ -7228,9 +7228,9 @@ var require_esprima5 = __commonJS({
|
|
|
7228
7228
|
}();
|
|
7229
7229
|
exports2.ForOfStatement = ForOfStatement;
|
|
7230
7230
|
var ForStatement = function() {
|
|
7231
|
-
function ForStatement2(
|
|
7231
|
+
function ForStatement2(init2, test, update, body) {
|
|
7232
7232
|
this.type = syntax_1.Syntax.ForStatement;
|
|
7233
|
-
this.init =
|
|
7233
|
+
this.init = init2;
|
|
7234
7234
|
this.test = test;
|
|
7235
7235
|
this.update = update;
|
|
7236
7236
|
this.body = body;
|
|
@@ -7570,10 +7570,10 @@ var require_esprima5 = __commonJS({
|
|
|
7570
7570
|
}();
|
|
7571
7571
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
7572
7572
|
var VariableDeclarator = function() {
|
|
7573
|
-
function VariableDeclarator2(id,
|
|
7573
|
+
function VariableDeclarator2(id, init2) {
|
|
7574
7574
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
7575
7575
|
this.id = id;
|
|
7576
|
-
this.init =
|
|
7576
|
+
this.init = init2;
|
|
7577
7577
|
}
|
|
7578
7578
|
return VariableDeclarator2;
|
|
7579
7579
|
}();
|
|
@@ -8278,8 +8278,8 @@ var require_esprima5 = __commonJS({
|
|
|
8278
8278
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
8279
8279
|
this.nextToken();
|
|
8280
8280
|
shorthand = true;
|
|
8281
|
-
var
|
|
8282
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
8281
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
8282
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
8283
8283
|
} else {
|
|
8284
8284
|
shorthand = true;
|
|
8285
8285
|
value = id;
|
|
@@ -9057,21 +9057,21 @@ var require_esprima5 = __commonJS({
|
|
|
9057
9057
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
9058
9058
|
}
|
|
9059
9059
|
}
|
|
9060
|
-
var
|
|
9060
|
+
var init2 = null;
|
|
9061
9061
|
if (kind === "const") {
|
|
9062
9062
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
9063
9063
|
if (this.match("=")) {
|
|
9064
9064
|
this.nextToken();
|
|
9065
|
-
|
|
9065
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
9066
9066
|
} else {
|
|
9067
9067
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
9068
9068
|
}
|
|
9069
9069
|
}
|
|
9070
9070
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
9071
9071
|
this.expect("=");
|
|
9072
|
-
|
|
9072
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
9073
9073
|
}
|
|
9074
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
9074
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
9075
9075
|
};
|
|
9076
9076
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
9077
9077
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -9135,17 +9135,17 @@ var require_esprima5 = __commonJS({
|
|
|
9135
9135
|
if (this.lookahead.type === 3) {
|
|
9136
9136
|
var keyToken = this.lookahead;
|
|
9137
9137
|
key = this.parseVariableIdentifier();
|
|
9138
|
-
var
|
|
9138
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
9139
9139
|
if (this.match("=")) {
|
|
9140
9140
|
params.push(keyToken);
|
|
9141
9141
|
shorthand = true;
|
|
9142
9142
|
this.nextToken();
|
|
9143
9143
|
var expr = this.parseAssignmentExpression();
|
|
9144
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
9144
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
9145
9145
|
} else if (!this.match(":")) {
|
|
9146
9146
|
params.push(keyToken);
|
|
9147
9147
|
shorthand = true;
|
|
9148
|
-
value =
|
|
9148
|
+
value = init2;
|
|
9149
9149
|
} else {
|
|
9150
9150
|
this.expect(":");
|
|
9151
9151
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -9230,14 +9230,14 @@ var require_esprima5 = __commonJS({
|
|
|
9230
9230
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
9231
9231
|
}
|
|
9232
9232
|
}
|
|
9233
|
-
var
|
|
9233
|
+
var init2 = null;
|
|
9234
9234
|
if (this.match("=")) {
|
|
9235
9235
|
this.nextToken();
|
|
9236
|
-
|
|
9236
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
9237
9237
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
9238
9238
|
this.expect("=");
|
|
9239
9239
|
}
|
|
9240
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
9240
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
9241
9241
|
};
|
|
9242
9242
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
9243
9243
|
var opt = { inFor: options.inFor };
|
|
@@ -9332,7 +9332,7 @@ var require_esprima5 = __commonJS({
|
|
|
9332
9332
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
9333
9333
|
};
|
|
9334
9334
|
Parser2.prototype.parseForStatement = function() {
|
|
9335
|
-
var
|
|
9335
|
+
var init2 = null;
|
|
9336
9336
|
var test = null;
|
|
9337
9337
|
var update = null;
|
|
9338
9338
|
var forIn = true;
|
|
@@ -9344,7 +9344,7 @@ var require_esprima5 = __commonJS({
|
|
|
9344
9344
|
this.nextToken();
|
|
9345
9345
|
} else {
|
|
9346
9346
|
if (this.matchKeyword("var")) {
|
|
9347
|
-
|
|
9347
|
+
init2 = this.createNode();
|
|
9348
9348
|
this.nextToken();
|
|
9349
9349
|
var previousAllowIn = this.context.allowIn;
|
|
9350
9350
|
this.context.allowIn = false;
|
|
@@ -9355,87 +9355,87 @@ var require_esprima5 = __commonJS({
|
|
|
9355
9355
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
9356
9356
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
9357
9357
|
}
|
|
9358
|
-
|
|
9358
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
9359
9359
|
this.nextToken();
|
|
9360
|
-
left =
|
|
9360
|
+
left = init2;
|
|
9361
9361
|
right = this.parseExpression();
|
|
9362
|
-
|
|
9362
|
+
init2 = null;
|
|
9363
9363
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
9364
|
-
|
|
9364
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
9365
9365
|
this.nextToken();
|
|
9366
|
-
left =
|
|
9366
|
+
left = init2;
|
|
9367
9367
|
right = this.parseAssignmentExpression();
|
|
9368
|
-
|
|
9368
|
+
init2 = null;
|
|
9369
9369
|
forIn = false;
|
|
9370
9370
|
} else {
|
|
9371
|
-
|
|
9371
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
9372
9372
|
this.expect(";");
|
|
9373
9373
|
}
|
|
9374
9374
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
9375
|
-
|
|
9375
|
+
init2 = this.createNode();
|
|
9376
9376
|
var kind = this.nextToken().value;
|
|
9377
9377
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
9378
|
-
|
|
9378
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
9379
9379
|
this.nextToken();
|
|
9380
|
-
left =
|
|
9380
|
+
left = init2;
|
|
9381
9381
|
right = this.parseExpression();
|
|
9382
|
-
|
|
9382
|
+
init2 = null;
|
|
9383
9383
|
} else {
|
|
9384
9384
|
var previousAllowIn = this.context.allowIn;
|
|
9385
9385
|
this.context.allowIn = false;
|
|
9386
9386
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
9387
9387
|
this.context.allowIn = previousAllowIn;
|
|
9388
9388
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
9389
|
-
|
|
9389
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
9390
9390
|
this.nextToken();
|
|
9391
|
-
left =
|
|
9391
|
+
left = init2;
|
|
9392
9392
|
right = this.parseExpression();
|
|
9393
|
-
|
|
9393
|
+
init2 = null;
|
|
9394
9394
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
9395
|
-
|
|
9395
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
9396
9396
|
this.nextToken();
|
|
9397
|
-
left =
|
|
9397
|
+
left = init2;
|
|
9398
9398
|
right = this.parseAssignmentExpression();
|
|
9399
|
-
|
|
9399
|
+
init2 = null;
|
|
9400
9400
|
forIn = false;
|
|
9401
9401
|
} else {
|
|
9402
9402
|
this.consumeSemicolon();
|
|
9403
|
-
|
|
9403
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
9404
9404
|
}
|
|
9405
9405
|
}
|
|
9406
9406
|
} else {
|
|
9407
9407
|
var initStartToken = this.lookahead;
|
|
9408
9408
|
var previousAllowIn = this.context.allowIn;
|
|
9409
9409
|
this.context.allowIn = false;
|
|
9410
|
-
|
|
9410
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
9411
9411
|
this.context.allowIn = previousAllowIn;
|
|
9412
9412
|
if (this.matchKeyword("in")) {
|
|
9413
|
-
if (!this.context.isAssignmentTarget ||
|
|
9413
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
9414
9414
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
9415
9415
|
}
|
|
9416
9416
|
this.nextToken();
|
|
9417
|
-
this.reinterpretExpressionAsPattern(
|
|
9418
|
-
left =
|
|
9417
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
9418
|
+
left = init2;
|
|
9419
9419
|
right = this.parseExpression();
|
|
9420
|
-
|
|
9420
|
+
init2 = null;
|
|
9421
9421
|
} else if (this.matchContextualKeyword("of")) {
|
|
9422
|
-
if (!this.context.isAssignmentTarget ||
|
|
9422
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
9423
9423
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
9424
9424
|
}
|
|
9425
9425
|
this.nextToken();
|
|
9426
|
-
this.reinterpretExpressionAsPattern(
|
|
9427
|
-
left =
|
|
9426
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
9427
|
+
left = init2;
|
|
9428
9428
|
right = this.parseAssignmentExpression();
|
|
9429
|
-
|
|
9429
|
+
init2 = null;
|
|
9430
9430
|
forIn = false;
|
|
9431
9431
|
} else {
|
|
9432
9432
|
if (this.match(",")) {
|
|
9433
|
-
var initSeq = [
|
|
9433
|
+
var initSeq = [init2];
|
|
9434
9434
|
while (this.match(",")) {
|
|
9435
9435
|
this.nextToken();
|
|
9436
9436
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
9437
9437
|
}
|
|
9438
|
-
|
|
9438
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
9439
9439
|
}
|
|
9440
9440
|
this.expect(";");
|
|
9441
9441
|
}
|
|
@@ -9461,7 +9461,7 @@ var require_esprima5 = __commonJS({
|
|
|
9461
9461
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
9462
9462
|
this.context.inIteration = previousInIteration;
|
|
9463
9463
|
}
|
|
9464
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
9464
|
+
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));
|
|
9465
9465
|
};
|
|
9466
9466
|
Parser2.prototype.parseContinueStatement = function() {
|
|
9467
9467
|
var node = this.createNode();
|
|
@@ -14852,10 +14852,10 @@ var require_printer2 = __commonJS({
|
|
|
14852
14852
|
return (0, lines_1.concat)(parts);
|
|
14853
14853
|
}
|
|
14854
14854
|
case "ForStatement": {
|
|
14855
|
-
var
|
|
14856
|
-
var sep4 =
|
|
14855
|
+
var init2 = path5.call(print13, "init");
|
|
14856
|
+
var sep4 = init2.length > 1 ? ";\n" : "; ";
|
|
14857
14857
|
var forParen = "for (";
|
|
14858
|
-
var indented = (0, lines_1.fromString)(sep4).join([
|
|
14858
|
+
var indented = (0, lines_1.fromString)(sep4).join([init2, path5.call(print13, "test"), path5.call(print13, "update")]).indentTail(forParen.length);
|
|
14859
14859
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
14860
14860
|
var clause = adjustClause(path5.call(print13, "body"), options);
|
|
14861
14861
|
parts.push(head);
|
|
@@ -24577,10 +24577,10 @@ var require_ponyfill_es2018 = __commonJS2({
|
|
|
24577
24577
|
}
|
|
24578
24578
|
return size;
|
|
24579
24579
|
}
|
|
24580
|
-
function convertQueuingStrategy(
|
|
24581
|
-
assertDictionary(
|
|
24582
|
-
const highWaterMark =
|
|
24583
|
-
const size =
|
|
24580
|
+
function convertQueuingStrategy(init2, context) {
|
|
24581
|
+
assertDictionary(init2, context);
|
|
24582
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
24583
|
+
const size = init2 === null || init2 === void 0 ? void 0 : init2.size;
|
|
24584
24584
|
return {
|
|
24585
24585
|
highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark),
|
|
24586
24586
|
size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`)
|
|
@@ -26432,9 +26432,9 @@ var require_ponyfill_es2018 = __commonJS2({
|
|
|
26432
26432
|
function streamBrandCheckException$1(name) {
|
|
26433
26433
|
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
26434
26434
|
}
|
|
26435
|
-
function convertQueuingStrategyInit(
|
|
26436
|
-
assertDictionary(
|
|
26437
|
-
const highWaterMark =
|
|
26435
|
+
function convertQueuingStrategyInit(init2, context) {
|
|
26436
|
+
assertDictionary(init2, context);
|
|
26437
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
26438
26438
|
assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit");
|
|
26439
26439
|
return {
|
|
26440
26440
|
highWaterMark: convertUnrestrictedDouble(highWaterMark)
|
|
@@ -35602,10 +35602,10 @@ var require_generated2 = __commonJS2({
|
|
|
35602
35602
|
body
|
|
35603
35603
|
});
|
|
35604
35604
|
}
|
|
35605
|
-
function forStatement(
|
|
35605
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
35606
35606
|
return (0, _validateNode.default)({
|
|
35607
35607
|
type: "ForStatement",
|
|
35608
|
-
init,
|
|
35608
|
+
init: init2,
|
|
35609
35609
|
test,
|
|
35610
35610
|
update,
|
|
35611
35611
|
body
|
|
@@ -35823,11 +35823,11 @@ var require_generated2 = __commonJS2({
|
|
|
35823
35823
|
declarations
|
|
35824
35824
|
});
|
|
35825
35825
|
}
|
|
35826
|
-
function variableDeclarator(id,
|
|
35826
|
+
function variableDeclarator(id, init2 = null) {
|
|
35827
35827
|
return (0, _validateNode.default)({
|
|
35828
35828
|
type: "VariableDeclarator",
|
|
35829
35829
|
id,
|
|
35830
|
-
init
|
|
35830
|
+
init: init2
|
|
35831
35831
|
});
|
|
35832
35832
|
}
|
|
35833
35833
|
function whileStatement(test, body) {
|
|
@@ -36529,18 +36529,18 @@ var require_generated2 = __commonJS2({
|
|
|
36529
36529
|
init: null
|
|
36530
36530
|
});
|
|
36531
36531
|
}
|
|
36532
|
-
function enumNumberMember(id,
|
|
36532
|
+
function enumNumberMember(id, init2) {
|
|
36533
36533
|
return (0, _validateNode.default)({
|
|
36534
36534
|
type: "EnumNumberMember",
|
|
36535
36535
|
id,
|
|
36536
|
-
init
|
|
36536
|
+
init: init2
|
|
36537
36537
|
});
|
|
36538
36538
|
}
|
|
36539
|
-
function enumStringMember(id,
|
|
36539
|
+
function enumStringMember(id, init2) {
|
|
36540
36540
|
return (0, _validateNode.default)({
|
|
36541
36541
|
type: "EnumStringMember",
|
|
36542
36542
|
id,
|
|
36543
|
-
init
|
|
36543
|
+
init: init2
|
|
36544
36544
|
});
|
|
36545
36545
|
}
|
|
36546
36546
|
function enumDefaultedMember(id) {
|
|
@@ -48246,13 +48246,13 @@ var require_lib6 = __commonJS2({
|
|
|
48246
48246
|
flowEnumMemberRaw() {
|
|
48247
48247
|
const loc = this.state.startLoc;
|
|
48248
48248
|
const id = this.parseIdentifier(true);
|
|
48249
|
-
const
|
|
48249
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
48250
48250
|
type: "none",
|
|
48251
48251
|
loc
|
|
48252
48252
|
};
|
|
48253
48253
|
return {
|
|
48254
48254
|
id,
|
|
48255
|
-
init
|
|
48255
|
+
init: init2
|
|
48256
48256
|
};
|
|
48257
48257
|
}
|
|
48258
48258
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -48286,7 +48286,7 @@ var require_lib6 = __commonJS2({
|
|
|
48286
48286
|
const memberNode = this.startNode();
|
|
48287
48287
|
const {
|
|
48288
48288
|
id,
|
|
48289
|
-
init
|
|
48289
|
+
init: init2
|
|
48290
48290
|
} = this.flowEnumMemberRaw();
|
|
48291
48291
|
const memberName = id.name;
|
|
48292
48292
|
if (memberName === "") {
|
|
@@ -48312,35 +48312,35 @@ var require_lib6 = __commonJS2({
|
|
|
48312
48312
|
memberName
|
|
48313
48313
|
};
|
|
48314
48314
|
memberNode.id = id;
|
|
48315
|
-
switch (
|
|
48315
|
+
switch (init2.type) {
|
|
48316
48316
|
case "boolean": {
|
|
48317
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48318
|
-
memberNode.init =
|
|
48317
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
48318
|
+
memberNode.init = init2.value;
|
|
48319
48319
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
48320
48320
|
break;
|
|
48321
48321
|
}
|
|
48322
48322
|
case "number": {
|
|
48323
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48324
|
-
memberNode.init =
|
|
48323
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
48324
|
+
memberNode.init = init2.value;
|
|
48325
48325
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
48326
48326
|
break;
|
|
48327
48327
|
}
|
|
48328
48328
|
case "string": {
|
|
48329
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48330
|
-
memberNode.init =
|
|
48329
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
48330
|
+
memberNode.init = init2.value;
|
|
48331
48331
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
48332
48332
|
break;
|
|
48333
48333
|
}
|
|
48334
48334
|
case "invalid": {
|
|
48335
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
48335
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
48336
48336
|
}
|
|
48337
48337
|
case "none": {
|
|
48338
48338
|
switch (explicitType) {
|
|
48339
48339
|
case "boolean":
|
|
48340
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
48340
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
48341
48341
|
break;
|
|
48342
48342
|
case "number":
|
|
48343
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
48343
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
48344
48344
|
break;
|
|
48345
48345
|
default:
|
|
48346
48346
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -51441,14 +51441,14 @@ var require_lib6 = __commonJS2({
|
|
|
51441
51441
|
return declaration;
|
|
51442
51442
|
for (const {
|
|
51443
51443
|
id,
|
|
51444
|
-
init
|
|
51444
|
+
init: init2
|
|
51445
51445
|
} of declaration.declarations) {
|
|
51446
|
-
if (!
|
|
51446
|
+
if (!init2)
|
|
51447
51447
|
continue;
|
|
51448
51448
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
51449
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
51450
|
-
} else if (!isValidAmbientConstInitializer(
|
|
51451
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
51449
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
51450
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
51451
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
51452
51452
|
}
|
|
51453
51453
|
}
|
|
51454
51454
|
return declaration;
|
|
@@ -54928,49 +54928,49 @@ var require_lib6 = __commonJS2({
|
|
|
54928
54928
|
}
|
|
54929
54929
|
this.next();
|
|
54930
54930
|
this.parseVar(initNode, true, kind);
|
|
54931
|
-
const
|
|
54931
|
+
const init22 = this.finishNode(initNode, "VariableDeclaration");
|
|
54932
54932
|
const isForIn = this.match(58);
|
|
54933
54933
|
if (isForIn && starsWithUsingDeclaration) {
|
|
54934
|
-
this.raise(Errors.ForInUsing,
|
|
54934
|
+
this.raise(Errors.ForInUsing, init22);
|
|
54935
54935
|
}
|
|
54936
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
54937
|
-
return this.parseForIn(node,
|
|
54936
|
+
if ((isForIn || this.isContextual(102)) && init22.declarations.length === 1) {
|
|
54937
|
+
return this.parseForIn(node, init22, awaitAt);
|
|
54938
54938
|
}
|
|
54939
54939
|
if (awaitAt !== null) {
|
|
54940
54940
|
this.unexpected(awaitAt);
|
|
54941
54941
|
}
|
|
54942
|
-
return this.parseFor(node,
|
|
54942
|
+
return this.parseFor(node, init22);
|
|
54943
54943
|
}
|
|
54944
54944
|
}
|
|
54945
54945
|
const startsWithAsync = this.isContextual(95);
|
|
54946
54946
|
const refExpressionErrors = new ExpressionErrors();
|
|
54947
|
-
const
|
|
54947
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
54948
54948
|
const isForOf = this.isContextual(102);
|
|
54949
54949
|
if (isForOf) {
|
|
54950
54950
|
if (startsWithLet) {
|
|
54951
|
-
this.raise(Errors.ForOfLet,
|
|
54951
|
+
this.raise(Errors.ForOfLet, init2);
|
|
54952
54952
|
}
|
|
54953
|
-
if (awaitAt === null && startsWithAsync &&
|
|
54954
|
-
this.raise(Errors.ForOfAsync,
|
|
54953
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
54954
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
54955
54955
|
}
|
|
54956
54956
|
}
|
|
54957
54957
|
if (isForOf || this.match(58)) {
|
|
54958
54958
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
54959
|
-
this.toAssignable(
|
|
54959
|
+
this.toAssignable(init2, true);
|
|
54960
54960
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
54961
|
-
this.checkLVal(
|
|
54961
|
+
this.checkLVal(init2, {
|
|
54962
54962
|
in: {
|
|
54963
54963
|
type
|
|
54964
54964
|
}
|
|
54965
54965
|
});
|
|
54966
|
-
return this.parseForIn(node,
|
|
54966
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
54967
54967
|
} else {
|
|
54968
54968
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
54969
54969
|
}
|
|
54970
54970
|
if (awaitAt !== null) {
|
|
54971
54971
|
this.unexpected(awaitAt);
|
|
54972
54972
|
}
|
|
54973
|
-
return this.parseFor(node,
|
|
54973
|
+
return this.parseFor(node, init2);
|
|
54974
54974
|
}
|
|
54975
54975
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
54976
54976
|
this.next();
|
|
@@ -55192,8 +55192,8 @@ var require_lib6 = __commonJS2({
|
|
|
55192
55192
|
}
|
|
55193
55193
|
this.next();
|
|
55194
55194
|
}
|
|
55195
|
-
parseFor(node,
|
|
55196
|
-
node.init =
|
|
55195
|
+
parseFor(node, init2) {
|
|
55196
|
+
node.init = init2;
|
|
55197
55197
|
this.semicolon(false);
|
|
55198
55198
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
55199
55199
|
this.semicolon(false);
|
|
@@ -55204,7 +55204,7 @@ var require_lib6 = __commonJS2({
|
|
|
55204
55204
|
this.state.labels.pop();
|
|
55205
55205
|
return this.finishNode(node, "ForStatement");
|
|
55206
55206
|
}
|
|
55207
|
-
parseForIn(node,
|
|
55207
|
+
parseForIn(node, init2, awaitAt) {
|
|
55208
55208
|
const isForIn = this.match(58);
|
|
55209
55209
|
this.next();
|
|
55210
55210
|
if (isForIn) {
|
|
@@ -55213,19 +55213,19 @@ var require_lib6 = __commonJS2({
|
|
|
55213
55213
|
} else {
|
|
55214
55214
|
node.await = awaitAt !== null;
|
|
55215
55215
|
}
|
|
55216
|
-
if (
|
|
55217
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
55216
|
+
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")) {
|
|
55217
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
55218
55218
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
55219
55219
|
});
|
|
55220
55220
|
}
|
|
55221
|
-
if (
|
|
55222
|
-
this.raise(Errors.InvalidLhs,
|
|
55221
|
+
if (init2.type === "AssignmentPattern") {
|
|
55222
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
55223
55223
|
ancestor: {
|
|
55224
55224
|
type: "ForStatement"
|
|
55225
55225
|
}
|
|
55226
55226
|
});
|
|
55227
55227
|
}
|
|
55228
|
-
node.left =
|
|
55228
|
+
node.left = init2;
|
|
55229
55229
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
55230
55230
|
this.expect(11);
|
|
55231
55231
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -58024,13 +58024,13 @@ var require_scope = __commonJS2({
|
|
|
58024
58024
|
var name = prefix + index;
|
|
58025
58025
|
return this.bindings[name] = types62.builders.identifier(name);
|
|
58026
58026
|
};
|
|
58027
|
-
Sp.injectTemporary = function(identifier,
|
|
58027
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
58028
58028
|
identifier || (identifier = this.declareTemporary());
|
|
58029
58029
|
var bodyPath = this.path.get("body");
|
|
58030
58030
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
58031
58031
|
bodyPath = bodyPath.get("body");
|
|
58032
58032
|
}
|
|
58033
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
58033
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
58034
58034
|
return identifier;
|
|
58035
58035
|
};
|
|
58036
58036
|
Sp.scan = function(force) {
|
|
@@ -63510,9 +63510,9 @@ var require_esprima2 = __commonJS2({
|
|
|
63510
63510
|
}();
|
|
63511
63511
|
exports2.ForOfStatement = ForOfStatement;
|
|
63512
63512
|
var ForStatement = function() {
|
|
63513
|
-
function ForStatement2(
|
|
63513
|
+
function ForStatement2(init2, test, update, body) {
|
|
63514
63514
|
this.type = syntax_1.Syntax.ForStatement;
|
|
63515
|
-
this.init =
|
|
63515
|
+
this.init = init2;
|
|
63516
63516
|
this.test = test;
|
|
63517
63517
|
this.update = update;
|
|
63518
63518
|
this.body = body;
|
|
@@ -63852,10 +63852,10 @@ var require_esprima2 = __commonJS2({
|
|
|
63852
63852
|
}();
|
|
63853
63853
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
63854
63854
|
var VariableDeclarator = function() {
|
|
63855
|
-
function VariableDeclarator2(id,
|
|
63855
|
+
function VariableDeclarator2(id, init2) {
|
|
63856
63856
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
63857
63857
|
this.id = id;
|
|
63858
|
-
this.init =
|
|
63858
|
+
this.init = init2;
|
|
63859
63859
|
}
|
|
63860
63860
|
return VariableDeclarator2;
|
|
63861
63861
|
}();
|
|
@@ -64560,8 +64560,8 @@ var require_esprima2 = __commonJS2({
|
|
|
64560
64560
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
64561
64561
|
this.nextToken();
|
|
64562
64562
|
shorthand = true;
|
|
64563
|
-
var
|
|
64564
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
64563
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
64564
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
64565
64565
|
} else {
|
|
64566
64566
|
shorthand = true;
|
|
64567
64567
|
value = id;
|
|
@@ -65339,21 +65339,21 @@ var require_esprima2 = __commonJS2({
|
|
|
65339
65339
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
65340
65340
|
}
|
|
65341
65341
|
}
|
|
65342
|
-
var
|
|
65342
|
+
var init2 = null;
|
|
65343
65343
|
if (kind === "const") {
|
|
65344
65344
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
65345
65345
|
if (this.match("=")) {
|
|
65346
65346
|
this.nextToken();
|
|
65347
|
-
|
|
65347
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65348
65348
|
} else {
|
|
65349
65349
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
65350
65350
|
}
|
|
65351
65351
|
}
|
|
65352
65352
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
65353
65353
|
this.expect("=");
|
|
65354
|
-
|
|
65354
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65355
65355
|
}
|
|
65356
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
65356
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
65357
65357
|
};
|
|
65358
65358
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
65359
65359
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -65417,17 +65417,17 @@ var require_esprima2 = __commonJS2({
|
|
|
65417
65417
|
if (this.lookahead.type === 3) {
|
|
65418
65418
|
var keyToken = this.lookahead;
|
|
65419
65419
|
key = this.parseVariableIdentifier();
|
|
65420
|
-
var
|
|
65420
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
65421
65421
|
if (this.match("=")) {
|
|
65422
65422
|
params.push(keyToken);
|
|
65423
65423
|
shorthand = true;
|
|
65424
65424
|
this.nextToken();
|
|
65425
65425
|
var expr = this.parseAssignmentExpression();
|
|
65426
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
65426
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
65427
65427
|
} else if (!this.match(":")) {
|
|
65428
65428
|
params.push(keyToken);
|
|
65429
65429
|
shorthand = true;
|
|
65430
|
-
value =
|
|
65430
|
+
value = init2;
|
|
65431
65431
|
} else {
|
|
65432
65432
|
this.expect(":");
|
|
65433
65433
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -65512,14 +65512,14 @@ var require_esprima2 = __commonJS2({
|
|
|
65512
65512
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
65513
65513
|
}
|
|
65514
65514
|
}
|
|
65515
|
-
var
|
|
65515
|
+
var init2 = null;
|
|
65516
65516
|
if (this.match("=")) {
|
|
65517
65517
|
this.nextToken();
|
|
65518
|
-
|
|
65518
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65519
65519
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
65520
65520
|
this.expect("=");
|
|
65521
65521
|
}
|
|
65522
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
65522
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
65523
65523
|
};
|
|
65524
65524
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
65525
65525
|
var opt = { inFor: options.inFor };
|
|
@@ -65614,7 +65614,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65614
65614
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
65615
65615
|
};
|
|
65616
65616
|
Parser2.prototype.parseForStatement = function() {
|
|
65617
|
-
var
|
|
65617
|
+
var init2 = null;
|
|
65618
65618
|
var test = null;
|
|
65619
65619
|
var update = null;
|
|
65620
65620
|
var forIn = true;
|
|
@@ -65626,7 +65626,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65626
65626
|
this.nextToken();
|
|
65627
65627
|
} else {
|
|
65628
65628
|
if (this.matchKeyword("var")) {
|
|
65629
|
-
|
|
65629
|
+
init2 = this.createNode();
|
|
65630
65630
|
this.nextToken();
|
|
65631
65631
|
var previousAllowIn = this.context.allowIn;
|
|
65632
65632
|
this.context.allowIn = false;
|
|
@@ -65637,87 +65637,87 @@ var require_esprima2 = __commonJS2({
|
|
|
65637
65637
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
65638
65638
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
65639
65639
|
}
|
|
65640
|
-
|
|
65640
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65641
65641
|
this.nextToken();
|
|
65642
|
-
left =
|
|
65642
|
+
left = init2;
|
|
65643
65643
|
right = this.parseExpression();
|
|
65644
|
-
|
|
65644
|
+
init2 = null;
|
|
65645
65645
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
65646
|
-
|
|
65646
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65647
65647
|
this.nextToken();
|
|
65648
|
-
left =
|
|
65648
|
+
left = init2;
|
|
65649
65649
|
right = this.parseAssignmentExpression();
|
|
65650
|
-
|
|
65650
|
+
init2 = null;
|
|
65651
65651
|
forIn = false;
|
|
65652
65652
|
} else {
|
|
65653
|
-
|
|
65653
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65654
65654
|
this.expect(";");
|
|
65655
65655
|
}
|
|
65656
65656
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
65657
|
-
|
|
65657
|
+
init2 = this.createNode();
|
|
65658
65658
|
var kind = this.nextToken().value;
|
|
65659
65659
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
65660
|
-
|
|
65660
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
65661
65661
|
this.nextToken();
|
|
65662
|
-
left =
|
|
65662
|
+
left = init2;
|
|
65663
65663
|
right = this.parseExpression();
|
|
65664
|
-
|
|
65664
|
+
init2 = null;
|
|
65665
65665
|
} else {
|
|
65666
65666
|
var previousAllowIn = this.context.allowIn;
|
|
65667
65667
|
this.context.allowIn = false;
|
|
65668
65668
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
65669
65669
|
this.context.allowIn = previousAllowIn;
|
|
65670
65670
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
65671
|
-
|
|
65671
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65672
65672
|
this.nextToken();
|
|
65673
|
-
left =
|
|
65673
|
+
left = init2;
|
|
65674
65674
|
right = this.parseExpression();
|
|
65675
|
-
|
|
65675
|
+
init2 = null;
|
|
65676
65676
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
65677
|
-
|
|
65677
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65678
65678
|
this.nextToken();
|
|
65679
|
-
left =
|
|
65679
|
+
left = init2;
|
|
65680
65680
|
right = this.parseAssignmentExpression();
|
|
65681
|
-
|
|
65681
|
+
init2 = null;
|
|
65682
65682
|
forIn = false;
|
|
65683
65683
|
} else {
|
|
65684
65684
|
this.consumeSemicolon();
|
|
65685
|
-
|
|
65685
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65686
65686
|
}
|
|
65687
65687
|
}
|
|
65688
65688
|
} else {
|
|
65689
65689
|
var initStartToken = this.lookahead;
|
|
65690
65690
|
var previousAllowIn = this.context.allowIn;
|
|
65691
65691
|
this.context.allowIn = false;
|
|
65692
|
-
|
|
65692
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
65693
65693
|
this.context.allowIn = previousAllowIn;
|
|
65694
65694
|
if (this.matchKeyword("in")) {
|
|
65695
|
-
if (!this.context.isAssignmentTarget ||
|
|
65695
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
65696
65696
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
65697
65697
|
}
|
|
65698
65698
|
this.nextToken();
|
|
65699
|
-
this.reinterpretExpressionAsPattern(
|
|
65700
|
-
left =
|
|
65699
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
65700
|
+
left = init2;
|
|
65701
65701
|
right = this.parseExpression();
|
|
65702
|
-
|
|
65702
|
+
init2 = null;
|
|
65703
65703
|
} else if (this.matchContextualKeyword("of")) {
|
|
65704
|
-
if (!this.context.isAssignmentTarget ||
|
|
65704
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
65705
65705
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
65706
65706
|
}
|
|
65707
65707
|
this.nextToken();
|
|
65708
|
-
this.reinterpretExpressionAsPattern(
|
|
65709
|
-
left =
|
|
65708
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
65709
|
+
left = init2;
|
|
65710
65710
|
right = this.parseAssignmentExpression();
|
|
65711
|
-
|
|
65711
|
+
init2 = null;
|
|
65712
65712
|
forIn = false;
|
|
65713
65713
|
} else {
|
|
65714
65714
|
if (this.match(",")) {
|
|
65715
|
-
var initSeq = [
|
|
65715
|
+
var initSeq = [init2];
|
|
65716
65716
|
while (this.match(",")) {
|
|
65717
65717
|
this.nextToken();
|
|
65718
65718
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
65719
65719
|
}
|
|
65720
|
-
|
|
65720
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
65721
65721
|
}
|
|
65722
65722
|
this.expect(";");
|
|
65723
65723
|
}
|
|
@@ -65743,7 +65743,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65743
65743
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
65744
65744
|
this.context.inIteration = previousInIteration;
|
|
65745
65745
|
}
|
|
65746
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
65746
|
+
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));
|
|
65747
65747
|
};
|
|
65748
65748
|
Parser2.prototype.parseContinueStatement = function() {
|
|
65749
65749
|
var node = this.createNode();
|
|
@@ -71116,10 +71116,10 @@ var require_printer = __commonJS2({
|
|
|
71116
71116
|
return (0, lines_1.concat)(parts);
|
|
71117
71117
|
}
|
|
71118
71118
|
case "ForStatement": {
|
|
71119
|
-
var
|
|
71120
|
-
var sep32 =
|
|
71119
|
+
var init2 = path42.call(print62, "init");
|
|
71120
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
71121
71121
|
var forParen = "for (";
|
|
71122
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
71122
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path42.call(print62, "test"), path42.call(print62, "update")]).indentTail(forParen.length);
|
|
71123
71123
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
71124
71124
|
var clause = adjustClause(path42.call(print62, "body"), options);
|
|
71125
71125
|
parts.push(head);
|
|
@@ -81837,23 +81837,23 @@ var validateHeaderValue = typeof import_node_http2.default.validateHeaderValue =
|
|
|
81837
81837
|
}
|
|
81838
81838
|
};
|
|
81839
81839
|
var Headers = class extends URLSearchParams {
|
|
81840
|
-
constructor(
|
|
81840
|
+
constructor(init2) {
|
|
81841
81841
|
let result = [];
|
|
81842
|
-
if (
|
|
81843
|
-
const raw =
|
|
81842
|
+
if (init2 instanceof Headers) {
|
|
81843
|
+
const raw = init2.raw();
|
|
81844
81844
|
for (const [name, values] of Object.entries(raw)) {
|
|
81845
81845
|
result.push(...values.map((value) => [name, value]));
|
|
81846
81846
|
}
|
|
81847
|
-
} else if (
|
|
81848
|
-
} else if (typeof
|
|
81849
|
-
const method =
|
|
81847
|
+
} else if (init2 == null) {
|
|
81848
|
+
} else if (typeof init2 === "object" && !import_node_util3.types.isBoxedPrimitive(init2)) {
|
|
81849
|
+
const method = init2[Symbol.iterator];
|
|
81850
81850
|
if (method == null) {
|
|
81851
|
-
result.push(...Object.entries(
|
|
81851
|
+
result.push(...Object.entries(init2));
|
|
81852
81852
|
} else {
|
|
81853
81853
|
if (typeof method !== "function") {
|
|
81854
81854
|
throw new TypeError("Header pairs must be iterable");
|
|
81855
81855
|
}
|
|
81856
|
-
result = [...
|
|
81856
|
+
result = [...init2].map((pair) => {
|
|
81857
81857
|
if (typeof pair !== "object" || import_node_util3.types.isBoxedPrimitive(pair)) {
|
|
81858
81858
|
throw new TypeError("Each header pair must be an iterable object");
|
|
81859
81859
|
}
|
|
@@ -82066,17 +82066,17 @@ var Response2 = class extends Body {
|
|
|
82066
82066
|
response[INTERNALS2].type = "error";
|
|
82067
82067
|
return response;
|
|
82068
82068
|
}
|
|
82069
|
-
static json(data = void 0,
|
|
82069
|
+
static json(data = void 0, init2 = {}) {
|
|
82070
82070
|
const body = JSON.stringify(data);
|
|
82071
82071
|
if (body === void 0) {
|
|
82072
82072
|
throw new TypeError("data is not JSON serializable");
|
|
82073
82073
|
}
|
|
82074
|
-
const headers = new Headers(
|
|
82074
|
+
const headers = new Headers(init2 && init2.headers);
|
|
82075
82075
|
if (!headers.has("content-type")) {
|
|
82076
82076
|
headers.set("content-type", "application/json");
|
|
82077
82077
|
}
|
|
82078
82078
|
return new Response2(body, {
|
|
82079
|
-
...
|
|
82079
|
+
...init2,
|
|
82080
82080
|
headers
|
|
82081
82081
|
});
|
|
82082
82082
|
}
|
|
@@ -82250,7 +82250,7 @@ var doBadDataWarn = (0, import_node_util4.deprecate)(
|
|
|
82250
82250
|
"https://github.com/node-fetch/node-fetch/issues/1000 (request)"
|
|
82251
82251
|
);
|
|
82252
82252
|
var Request2 = class extends Body {
|
|
82253
|
-
constructor(input,
|
|
82253
|
+
constructor(input, init2 = {}) {
|
|
82254
82254
|
let parsedURL;
|
|
82255
82255
|
if (isRequest(input)) {
|
|
82256
82256
|
parsedURL = new URL(input.url);
|
|
@@ -82261,21 +82261,21 @@ var Request2 = class extends Body {
|
|
|
82261
82261
|
if (parsedURL.username !== "" || parsedURL.password !== "") {
|
|
82262
82262
|
throw new TypeError(`${parsedURL} is an url with embedded credentials.`);
|
|
82263
82263
|
}
|
|
82264
|
-
let method =
|
|
82264
|
+
let method = init2.method || input.method || "GET";
|
|
82265
82265
|
if (/^(delete|get|head|options|post|put)$/i.test(method)) {
|
|
82266
82266
|
method = method.toUpperCase();
|
|
82267
82267
|
}
|
|
82268
|
-
if (!isRequest(
|
|
82268
|
+
if (!isRequest(init2) && "data" in init2) {
|
|
82269
82269
|
doBadDataWarn();
|
|
82270
82270
|
}
|
|
82271
|
-
if ((
|
|
82271
|
+
if ((init2.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
|
82272
82272
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
|
82273
82273
|
}
|
|
82274
|
-
const inputBody =
|
|
82274
|
+
const inputBody = init2.body ? init2.body : isRequest(input) && input.body !== null ? clone(input) : null;
|
|
82275
82275
|
super(inputBody, {
|
|
82276
|
-
size:
|
|
82276
|
+
size: init2.size || input.size || 0
|
|
82277
82277
|
});
|
|
82278
|
-
const headers = new Headers(
|
|
82278
|
+
const headers = new Headers(init2.headers || input.headers || {});
|
|
82279
82279
|
if (inputBody !== null && !headers.has("Content-Type")) {
|
|
82280
82280
|
const contentType = extractContentType(inputBody, this);
|
|
82281
82281
|
if (contentType) {
|
|
@@ -82283,13 +82283,13 @@ var Request2 = class extends Body {
|
|
|
82283
82283
|
}
|
|
82284
82284
|
}
|
|
82285
82285
|
let signal = isRequest(input) ? input.signal : null;
|
|
82286
|
-
if ("signal" in
|
|
82287
|
-
signal =
|
|
82286
|
+
if ("signal" in init2) {
|
|
82287
|
+
signal = init2.signal;
|
|
82288
82288
|
}
|
|
82289
82289
|
if (signal != null && !isAbortSignal(signal)) {
|
|
82290
82290
|
throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
|
|
82291
82291
|
}
|
|
82292
|
-
let referrer =
|
|
82292
|
+
let referrer = init2.referrer == null ? input.referrer : init2.referrer;
|
|
82293
82293
|
if (referrer === "") {
|
|
82294
82294
|
referrer = "no-referrer";
|
|
82295
82295
|
} else if (referrer) {
|
|
@@ -82300,19 +82300,19 @@ var Request2 = class extends Body {
|
|
|
82300
82300
|
}
|
|
82301
82301
|
this[INTERNALS3] = {
|
|
82302
82302
|
method,
|
|
82303
|
-
redirect:
|
|
82303
|
+
redirect: init2.redirect || input.redirect || "follow",
|
|
82304
82304
|
headers,
|
|
82305
82305
|
parsedURL,
|
|
82306
82306
|
signal,
|
|
82307
82307
|
referrer
|
|
82308
82308
|
};
|
|
82309
|
-
this.follow =
|
|
82310
|
-
this.compress =
|
|
82311
|
-
this.counter =
|
|
82312
|
-
this.agent =
|
|
82313
|
-
this.highWaterMark =
|
|
82314
|
-
this.insecureHTTPParser =
|
|
82315
|
-
this.referrerPolicy =
|
|
82309
|
+
this.follow = init2.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init2.follow;
|
|
82310
|
+
this.compress = init2.compress === void 0 ? input.compress === void 0 ? true : input.compress : init2.compress;
|
|
82311
|
+
this.counter = init2.counter || input.counter || 0;
|
|
82312
|
+
this.agent = init2.agent || input.agent;
|
|
82313
|
+
this.highWaterMark = init2.highWaterMark || input.highWaterMark || 16384;
|
|
82314
|
+
this.insecureHTTPParser = init2.insecureHTTPParser || input.insecureHTTPParser || false;
|
|
82315
|
+
this.referrerPolicy = init2.referrerPolicy || input.referrerPolicy || "";
|
|
82316
82316
|
}
|
|
82317
82317
|
get method() {
|
|
82318
82318
|
return this[INTERNALS3].method;
|
|
@@ -97836,10 +97836,10 @@ var require_ponyfill_es20182 = __commonJS3({
|
|
|
97836
97836
|
}
|
|
97837
97837
|
return size;
|
|
97838
97838
|
}
|
|
97839
|
-
function convertQueuingStrategy(
|
|
97840
|
-
assertDictionary(
|
|
97841
|
-
const highWaterMark =
|
|
97842
|
-
const size =
|
|
97839
|
+
function convertQueuingStrategy(init2, context) {
|
|
97840
|
+
assertDictionary(init2, context);
|
|
97841
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
97842
|
+
const size = init2 === null || init2 === void 0 ? void 0 : init2.size;
|
|
97843
97843
|
return {
|
|
97844
97844
|
highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark),
|
|
97845
97845
|
size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`)
|
|
@@ -99691,9 +99691,9 @@ var require_ponyfill_es20182 = __commonJS3({
|
|
|
99691
99691
|
function streamBrandCheckException$1(name) {
|
|
99692
99692
|
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
99693
99693
|
}
|
|
99694
|
-
function convertQueuingStrategyInit(
|
|
99695
|
-
assertDictionary(
|
|
99696
|
-
const highWaterMark =
|
|
99694
|
+
function convertQueuingStrategyInit(init2, context) {
|
|
99695
|
+
assertDictionary(init2, context);
|
|
99696
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
99697
99697
|
assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit");
|
|
99698
99698
|
return {
|
|
99699
99699
|
highWaterMark: convertUnrestrictedDouble(highWaterMark)
|
|
@@ -108861,10 +108861,10 @@ var require_generated22 = __commonJS3({
|
|
|
108861
108861
|
body
|
|
108862
108862
|
});
|
|
108863
108863
|
}
|
|
108864
|
-
function forStatement(
|
|
108864
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
108865
108865
|
return (0, _validateNode.default)({
|
|
108866
108866
|
type: "ForStatement",
|
|
108867
|
-
init,
|
|
108867
|
+
init: init2,
|
|
108868
108868
|
test,
|
|
108869
108869
|
update,
|
|
108870
108870
|
body
|
|
@@ -109082,11 +109082,11 @@ var require_generated22 = __commonJS3({
|
|
|
109082
109082
|
declarations
|
|
109083
109083
|
});
|
|
109084
109084
|
}
|
|
109085
|
-
function variableDeclarator(id,
|
|
109085
|
+
function variableDeclarator(id, init2 = null) {
|
|
109086
109086
|
return (0, _validateNode.default)({
|
|
109087
109087
|
type: "VariableDeclarator",
|
|
109088
109088
|
id,
|
|
109089
|
-
init
|
|
109089
|
+
init: init2
|
|
109090
109090
|
});
|
|
109091
109091
|
}
|
|
109092
109092
|
function whileStatement(test, body) {
|
|
@@ -109788,18 +109788,18 @@ var require_generated22 = __commonJS3({
|
|
|
109788
109788
|
init: null
|
|
109789
109789
|
});
|
|
109790
109790
|
}
|
|
109791
|
-
function enumNumberMember(id,
|
|
109791
|
+
function enumNumberMember(id, init2) {
|
|
109792
109792
|
return (0, _validateNode.default)({
|
|
109793
109793
|
type: "EnumNumberMember",
|
|
109794
109794
|
id,
|
|
109795
|
-
init
|
|
109795
|
+
init: init2
|
|
109796
109796
|
});
|
|
109797
109797
|
}
|
|
109798
|
-
function enumStringMember(id,
|
|
109798
|
+
function enumStringMember(id, init2) {
|
|
109799
109799
|
return (0, _validateNode.default)({
|
|
109800
109800
|
type: "EnumStringMember",
|
|
109801
109801
|
id,
|
|
109802
|
-
init
|
|
109802
|
+
init: init2
|
|
109803
109803
|
});
|
|
109804
109804
|
}
|
|
109805
109805
|
function enumDefaultedMember(id) {
|
|
@@ -121505,13 +121505,13 @@ var require_lib62 = __commonJS3({
|
|
|
121505
121505
|
flowEnumMemberRaw() {
|
|
121506
121506
|
const loc = this.state.startLoc;
|
|
121507
121507
|
const id = this.parseIdentifier(true);
|
|
121508
|
-
const
|
|
121508
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
121509
121509
|
type: "none",
|
|
121510
121510
|
loc
|
|
121511
121511
|
};
|
|
121512
121512
|
return {
|
|
121513
121513
|
id,
|
|
121514
|
-
init
|
|
121514
|
+
init: init2
|
|
121515
121515
|
};
|
|
121516
121516
|
}
|
|
121517
121517
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -121545,7 +121545,7 @@ var require_lib62 = __commonJS3({
|
|
|
121545
121545
|
const memberNode = this.startNode();
|
|
121546
121546
|
const {
|
|
121547
121547
|
id,
|
|
121548
|
-
init
|
|
121548
|
+
init: init2
|
|
121549
121549
|
} = this.flowEnumMemberRaw();
|
|
121550
121550
|
const memberName = id.name;
|
|
121551
121551
|
if (memberName === "") {
|
|
@@ -121571,35 +121571,35 @@ var require_lib62 = __commonJS3({
|
|
|
121571
121571
|
memberName
|
|
121572
121572
|
};
|
|
121573
121573
|
memberNode.id = id;
|
|
121574
|
-
switch (
|
|
121574
|
+
switch (init2.type) {
|
|
121575
121575
|
case "boolean": {
|
|
121576
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
121577
|
-
memberNode.init =
|
|
121576
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
121577
|
+
memberNode.init = init2.value;
|
|
121578
121578
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
121579
121579
|
break;
|
|
121580
121580
|
}
|
|
121581
121581
|
case "number": {
|
|
121582
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
121583
|
-
memberNode.init =
|
|
121582
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
121583
|
+
memberNode.init = init2.value;
|
|
121584
121584
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
121585
121585
|
break;
|
|
121586
121586
|
}
|
|
121587
121587
|
case "string": {
|
|
121588
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
121589
|
-
memberNode.init =
|
|
121588
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
121589
|
+
memberNode.init = init2.value;
|
|
121590
121590
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
121591
121591
|
break;
|
|
121592
121592
|
}
|
|
121593
121593
|
case "invalid": {
|
|
121594
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
121594
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
121595
121595
|
}
|
|
121596
121596
|
case "none": {
|
|
121597
121597
|
switch (explicitType) {
|
|
121598
121598
|
case "boolean":
|
|
121599
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
121599
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
121600
121600
|
break;
|
|
121601
121601
|
case "number":
|
|
121602
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
121602
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
121603
121603
|
break;
|
|
121604
121604
|
default:
|
|
121605
121605
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -124700,14 +124700,14 @@ var require_lib62 = __commonJS3({
|
|
|
124700
124700
|
return declaration;
|
|
124701
124701
|
for (const {
|
|
124702
124702
|
id,
|
|
124703
|
-
init
|
|
124703
|
+
init: init2
|
|
124704
124704
|
} of declaration.declarations) {
|
|
124705
|
-
if (!
|
|
124705
|
+
if (!init2)
|
|
124706
124706
|
continue;
|
|
124707
124707
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
124708
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
124709
|
-
} else if (!isValidAmbientConstInitializer(
|
|
124710
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
124708
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
124709
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
124710
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
124711
124711
|
}
|
|
124712
124712
|
}
|
|
124713
124713
|
return declaration;
|
|
@@ -128187,49 +128187,49 @@ var require_lib62 = __commonJS3({
|
|
|
128187
128187
|
}
|
|
128188
128188
|
this.next();
|
|
128189
128189
|
this.parseVar(initNode, true, kind);
|
|
128190
|
-
const
|
|
128190
|
+
const init3 = this.finishNode(initNode, "VariableDeclaration");
|
|
128191
128191
|
const isForIn = this.match(58);
|
|
128192
128192
|
if (isForIn && starsWithUsingDeclaration) {
|
|
128193
|
-
this.raise(Errors.ForInUsing,
|
|
128193
|
+
this.raise(Errors.ForInUsing, init3);
|
|
128194
128194
|
}
|
|
128195
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
128196
|
-
return this.parseForIn(node,
|
|
128195
|
+
if ((isForIn || this.isContextual(102)) && init3.declarations.length === 1) {
|
|
128196
|
+
return this.parseForIn(node, init3, awaitAt);
|
|
128197
128197
|
}
|
|
128198
128198
|
if (awaitAt !== null) {
|
|
128199
128199
|
this.unexpected(awaitAt);
|
|
128200
128200
|
}
|
|
128201
|
-
return this.parseFor(node,
|
|
128201
|
+
return this.parseFor(node, init3);
|
|
128202
128202
|
}
|
|
128203
128203
|
}
|
|
128204
128204
|
const startsWithAsync = this.isContextual(95);
|
|
128205
128205
|
const refExpressionErrors = new ExpressionErrors();
|
|
128206
|
-
const
|
|
128206
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
128207
128207
|
const isForOf = this.isContextual(102);
|
|
128208
128208
|
if (isForOf) {
|
|
128209
128209
|
if (startsWithLet) {
|
|
128210
|
-
this.raise(Errors.ForOfLet,
|
|
128210
|
+
this.raise(Errors.ForOfLet, init2);
|
|
128211
128211
|
}
|
|
128212
|
-
if (awaitAt === null && startsWithAsync &&
|
|
128213
|
-
this.raise(Errors.ForOfAsync,
|
|
128212
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
128213
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
128214
128214
|
}
|
|
128215
128215
|
}
|
|
128216
128216
|
if (isForOf || this.match(58)) {
|
|
128217
128217
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
128218
|
-
this.toAssignable(
|
|
128218
|
+
this.toAssignable(init2, true);
|
|
128219
128219
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
128220
|
-
this.checkLVal(
|
|
128220
|
+
this.checkLVal(init2, {
|
|
128221
128221
|
in: {
|
|
128222
128222
|
type
|
|
128223
128223
|
}
|
|
128224
128224
|
});
|
|
128225
|
-
return this.parseForIn(node,
|
|
128225
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
128226
128226
|
} else {
|
|
128227
128227
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
128228
128228
|
}
|
|
128229
128229
|
if (awaitAt !== null) {
|
|
128230
128230
|
this.unexpected(awaitAt);
|
|
128231
128231
|
}
|
|
128232
|
-
return this.parseFor(node,
|
|
128232
|
+
return this.parseFor(node, init2);
|
|
128233
128233
|
}
|
|
128234
128234
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
128235
128235
|
this.next();
|
|
@@ -128451,8 +128451,8 @@ var require_lib62 = __commonJS3({
|
|
|
128451
128451
|
}
|
|
128452
128452
|
this.next();
|
|
128453
128453
|
}
|
|
128454
|
-
parseFor(node,
|
|
128455
|
-
node.init =
|
|
128454
|
+
parseFor(node, init2) {
|
|
128455
|
+
node.init = init2;
|
|
128456
128456
|
this.semicolon(false);
|
|
128457
128457
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
128458
128458
|
this.semicolon(false);
|
|
@@ -128463,7 +128463,7 @@ var require_lib62 = __commonJS3({
|
|
|
128463
128463
|
this.state.labels.pop();
|
|
128464
128464
|
return this.finishNode(node, "ForStatement");
|
|
128465
128465
|
}
|
|
128466
|
-
parseForIn(node,
|
|
128466
|
+
parseForIn(node, init2, awaitAt) {
|
|
128467
128467
|
const isForIn = this.match(58);
|
|
128468
128468
|
this.next();
|
|
128469
128469
|
if (isForIn) {
|
|
@@ -128472,19 +128472,19 @@ var require_lib62 = __commonJS3({
|
|
|
128472
128472
|
} else {
|
|
128473
128473
|
node.await = awaitAt !== null;
|
|
128474
128474
|
}
|
|
128475
|
-
if (
|
|
128476
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
128475
|
+
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")) {
|
|
128476
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
128477
128477
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
128478
128478
|
});
|
|
128479
128479
|
}
|
|
128480
|
-
if (
|
|
128481
|
-
this.raise(Errors.InvalidLhs,
|
|
128480
|
+
if (init2.type === "AssignmentPattern") {
|
|
128481
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
128482
128482
|
ancestor: {
|
|
128483
128483
|
type: "ForStatement"
|
|
128484
128484
|
}
|
|
128485
128485
|
});
|
|
128486
128486
|
}
|
|
128487
|
-
node.left =
|
|
128487
|
+
node.left = init2;
|
|
128488
128488
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
128489
128489
|
this.expect(11);
|
|
128490
128490
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -130428,11 +130428,11 @@ var require_types3 = __commonJS3({
|
|
|
130428
130428
|
}();
|
|
130429
130429
|
exports.Def = Def;
|
|
130430
130430
|
var Field = function() {
|
|
130431
|
-
function Field2(name, type, defaultFn,
|
|
130431
|
+
function Field2(name, type, defaultFn, hidden7) {
|
|
130432
130432
|
this.name = name;
|
|
130433
130433
|
this.type = type;
|
|
130434
130434
|
this.defaultFn = defaultFn;
|
|
130435
|
-
this.hidden = !!
|
|
130435
|
+
this.hidden = !!hidden7;
|
|
130436
130436
|
}
|
|
130437
130437
|
Field2.prototype.toString = function() {
|
|
130438
130438
|
return JSON.stringify(this.name) + ": " + this.type;
|
|
@@ -130681,12 +130681,12 @@ var require_types3 = __commonJS3({
|
|
|
130681
130681
|
});
|
|
130682
130682
|
return this;
|
|
130683
130683
|
};
|
|
130684
|
-
DefImpl2.prototype.field = function(name, type, defaultFn,
|
|
130684
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden7) {
|
|
130685
130685
|
if (this.finalized) {
|
|
130686
130686
|
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
130687
130687
|
return this;
|
|
130688
130688
|
}
|
|
130689
|
-
this.ownFields[name] = new Field(name, Type.from(type), defaultFn,
|
|
130689
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden7);
|
|
130690
130690
|
return this;
|
|
130691
130691
|
};
|
|
130692
130692
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -131283,13 +131283,13 @@ var require_scope3 = __commonJS3({
|
|
|
131283
131283
|
var name = prefix + index;
|
|
131284
131284
|
return this.bindings[name] = types19.builders.identifier(name);
|
|
131285
131285
|
};
|
|
131286
|
-
Sp.injectTemporary = function(identifier,
|
|
131286
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
131287
131287
|
identifier || (identifier = this.declareTemporary());
|
|
131288
131288
|
var bodyPath = this.path.get("body");
|
|
131289
131289
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
131290
131290
|
bodyPath = bodyPath.get("body");
|
|
131291
131291
|
}
|
|
131292
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
131292
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
131293
131293
|
return identifier;
|
|
131294
131294
|
};
|
|
131295
131295
|
Sp.scan = function(force) {
|
|
@@ -132058,7 +132058,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
132058
132058
|
return Context;
|
|
132059
132059
|
}
|
|
132060
132060
|
var sharedContextProtoMethods = /* @__PURE__ */ Object.create(null);
|
|
132061
|
-
sharedContextProtoMethods.reset = function
|
|
132061
|
+
sharedContextProtoMethods.reset = function reset7(path42) {
|
|
132062
132062
|
if (!(this instanceof this.Context)) {
|
|
132063
132063
|
throw new Error("");
|
|
132064
132064
|
}
|
|
@@ -136769,9 +136769,9 @@ var require_esprima22 = __commonJS3({
|
|
|
136769
136769
|
}();
|
|
136770
136770
|
exports2.ForOfStatement = ForOfStatement;
|
|
136771
136771
|
var ForStatement = function() {
|
|
136772
|
-
function ForStatement2(
|
|
136772
|
+
function ForStatement2(init2, test, update, body) {
|
|
136773
136773
|
this.type = syntax_1.Syntax.ForStatement;
|
|
136774
|
-
this.init =
|
|
136774
|
+
this.init = init2;
|
|
136775
136775
|
this.test = test;
|
|
136776
136776
|
this.update = update;
|
|
136777
136777
|
this.body = body;
|
|
@@ -137111,10 +137111,10 @@ var require_esprima22 = __commonJS3({
|
|
|
137111
137111
|
}();
|
|
137112
137112
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
137113
137113
|
var VariableDeclarator = function() {
|
|
137114
|
-
function VariableDeclarator2(id,
|
|
137114
|
+
function VariableDeclarator2(id, init2) {
|
|
137115
137115
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
137116
137116
|
this.id = id;
|
|
137117
|
-
this.init =
|
|
137117
|
+
this.init = init2;
|
|
137118
137118
|
}
|
|
137119
137119
|
return VariableDeclarator2;
|
|
137120
137120
|
}();
|
|
@@ -137819,8 +137819,8 @@ var require_esprima22 = __commonJS3({
|
|
|
137819
137819
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
137820
137820
|
this.nextToken();
|
|
137821
137821
|
shorthand = true;
|
|
137822
|
-
var
|
|
137823
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
137822
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
137823
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
137824
137824
|
} else {
|
|
137825
137825
|
shorthand = true;
|
|
137826
137826
|
value = id;
|
|
@@ -138598,21 +138598,21 @@ var require_esprima22 = __commonJS3({
|
|
|
138598
138598
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
138599
138599
|
}
|
|
138600
138600
|
}
|
|
138601
|
-
var
|
|
138601
|
+
var init2 = null;
|
|
138602
138602
|
if (kind === "const") {
|
|
138603
138603
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
138604
138604
|
if (this.match("=")) {
|
|
138605
138605
|
this.nextToken();
|
|
138606
|
-
|
|
138606
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
138607
138607
|
} else {
|
|
138608
138608
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
138609
138609
|
}
|
|
138610
138610
|
}
|
|
138611
138611
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
138612
138612
|
this.expect("=");
|
|
138613
|
-
|
|
138613
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
138614
138614
|
}
|
|
138615
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
138615
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
138616
138616
|
};
|
|
138617
138617
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
138618
138618
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -138676,17 +138676,17 @@ var require_esprima22 = __commonJS3({
|
|
|
138676
138676
|
if (this.lookahead.type === 3) {
|
|
138677
138677
|
var keyToken = this.lookahead;
|
|
138678
138678
|
key = this.parseVariableIdentifier();
|
|
138679
|
-
var
|
|
138679
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
138680
138680
|
if (this.match("=")) {
|
|
138681
138681
|
params.push(keyToken);
|
|
138682
138682
|
shorthand = true;
|
|
138683
138683
|
this.nextToken();
|
|
138684
138684
|
var expr = this.parseAssignmentExpression();
|
|
138685
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
138685
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
138686
138686
|
} else if (!this.match(":")) {
|
|
138687
138687
|
params.push(keyToken);
|
|
138688
138688
|
shorthand = true;
|
|
138689
|
-
value =
|
|
138689
|
+
value = init2;
|
|
138690
138690
|
} else {
|
|
138691
138691
|
this.expect(":");
|
|
138692
138692
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -138771,14 +138771,14 @@ var require_esprima22 = __commonJS3({
|
|
|
138771
138771
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
138772
138772
|
}
|
|
138773
138773
|
}
|
|
138774
|
-
var
|
|
138774
|
+
var init2 = null;
|
|
138775
138775
|
if (this.match("=")) {
|
|
138776
138776
|
this.nextToken();
|
|
138777
|
-
|
|
138777
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
138778
138778
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
138779
138779
|
this.expect("=");
|
|
138780
138780
|
}
|
|
138781
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
138781
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
138782
138782
|
};
|
|
138783
138783
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
138784
138784
|
var opt = { inFor: options.inFor };
|
|
@@ -138873,7 +138873,7 @@ var require_esprima22 = __commonJS3({
|
|
|
138873
138873
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
138874
138874
|
};
|
|
138875
138875
|
Parser2.prototype.parseForStatement = function() {
|
|
138876
|
-
var
|
|
138876
|
+
var init2 = null;
|
|
138877
138877
|
var test = null;
|
|
138878
138878
|
var update = null;
|
|
138879
138879
|
var forIn = true;
|
|
@@ -138885,7 +138885,7 @@ var require_esprima22 = __commonJS3({
|
|
|
138885
138885
|
this.nextToken();
|
|
138886
138886
|
} else {
|
|
138887
138887
|
if (this.matchKeyword("var")) {
|
|
138888
|
-
|
|
138888
|
+
init2 = this.createNode();
|
|
138889
138889
|
this.nextToken();
|
|
138890
138890
|
var previousAllowIn = this.context.allowIn;
|
|
138891
138891
|
this.context.allowIn = false;
|
|
@@ -138896,87 +138896,87 @@ var require_esprima22 = __commonJS3({
|
|
|
138896
138896
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
138897
138897
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
138898
138898
|
}
|
|
138899
|
-
|
|
138899
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
138900
138900
|
this.nextToken();
|
|
138901
|
-
left =
|
|
138901
|
+
left = init2;
|
|
138902
138902
|
right = this.parseExpression();
|
|
138903
|
-
|
|
138903
|
+
init2 = null;
|
|
138904
138904
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
138905
|
-
|
|
138905
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
138906
138906
|
this.nextToken();
|
|
138907
|
-
left =
|
|
138907
|
+
left = init2;
|
|
138908
138908
|
right = this.parseAssignmentExpression();
|
|
138909
|
-
|
|
138909
|
+
init2 = null;
|
|
138910
138910
|
forIn = false;
|
|
138911
138911
|
} else {
|
|
138912
|
-
|
|
138912
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
138913
138913
|
this.expect(";");
|
|
138914
138914
|
}
|
|
138915
138915
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
138916
|
-
|
|
138916
|
+
init2 = this.createNode();
|
|
138917
138917
|
var kind = this.nextToken().value;
|
|
138918
138918
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
138919
|
-
|
|
138919
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
138920
138920
|
this.nextToken();
|
|
138921
|
-
left =
|
|
138921
|
+
left = init2;
|
|
138922
138922
|
right = this.parseExpression();
|
|
138923
|
-
|
|
138923
|
+
init2 = null;
|
|
138924
138924
|
} else {
|
|
138925
138925
|
var previousAllowIn = this.context.allowIn;
|
|
138926
138926
|
this.context.allowIn = false;
|
|
138927
138927
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
138928
138928
|
this.context.allowIn = previousAllowIn;
|
|
138929
138929
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
138930
|
-
|
|
138930
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
138931
138931
|
this.nextToken();
|
|
138932
|
-
left =
|
|
138932
|
+
left = init2;
|
|
138933
138933
|
right = this.parseExpression();
|
|
138934
|
-
|
|
138934
|
+
init2 = null;
|
|
138935
138935
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
138936
|
-
|
|
138936
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
138937
138937
|
this.nextToken();
|
|
138938
|
-
left =
|
|
138938
|
+
left = init2;
|
|
138939
138939
|
right = this.parseAssignmentExpression();
|
|
138940
|
-
|
|
138940
|
+
init2 = null;
|
|
138941
138941
|
forIn = false;
|
|
138942
138942
|
} else {
|
|
138943
138943
|
this.consumeSemicolon();
|
|
138944
|
-
|
|
138944
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
138945
138945
|
}
|
|
138946
138946
|
}
|
|
138947
138947
|
} else {
|
|
138948
138948
|
var initStartToken = this.lookahead;
|
|
138949
138949
|
var previousAllowIn = this.context.allowIn;
|
|
138950
138950
|
this.context.allowIn = false;
|
|
138951
|
-
|
|
138951
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
138952
138952
|
this.context.allowIn = previousAllowIn;
|
|
138953
138953
|
if (this.matchKeyword("in")) {
|
|
138954
|
-
if (!this.context.isAssignmentTarget ||
|
|
138954
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
138955
138955
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
138956
138956
|
}
|
|
138957
138957
|
this.nextToken();
|
|
138958
|
-
this.reinterpretExpressionAsPattern(
|
|
138959
|
-
left =
|
|
138958
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
138959
|
+
left = init2;
|
|
138960
138960
|
right = this.parseExpression();
|
|
138961
|
-
|
|
138961
|
+
init2 = null;
|
|
138962
138962
|
} else if (this.matchContextualKeyword("of")) {
|
|
138963
|
-
if (!this.context.isAssignmentTarget ||
|
|
138963
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
138964
138964
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
138965
138965
|
}
|
|
138966
138966
|
this.nextToken();
|
|
138967
|
-
this.reinterpretExpressionAsPattern(
|
|
138968
|
-
left =
|
|
138967
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
138968
|
+
left = init2;
|
|
138969
138969
|
right = this.parseAssignmentExpression();
|
|
138970
|
-
|
|
138970
|
+
init2 = null;
|
|
138971
138971
|
forIn = false;
|
|
138972
138972
|
} else {
|
|
138973
138973
|
if (this.match(",")) {
|
|
138974
|
-
var initSeq = [
|
|
138974
|
+
var initSeq = [init2];
|
|
138975
138975
|
while (this.match(",")) {
|
|
138976
138976
|
this.nextToken();
|
|
138977
138977
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
138978
138978
|
}
|
|
138979
|
-
|
|
138979
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
138980
138980
|
}
|
|
138981
138981
|
this.expect(";");
|
|
138982
138982
|
}
|
|
@@ -139002,7 +139002,7 @@ var require_esprima22 = __commonJS3({
|
|
|
139002
139002
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
139003
139003
|
this.context.inIteration = previousInIteration;
|
|
139004
139004
|
}
|
|
139005
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
139005
|
+
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));
|
|
139006
139006
|
};
|
|
139007
139007
|
Parser2.prototype.parseContinueStatement = function() {
|
|
139008
139008
|
var node = this.createNode();
|
|
@@ -144375,10 +144375,10 @@ var require_printer3 = __commonJS3({
|
|
|
144375
144375
|
return (0, lines_1.concat)(parts);
|
|
144376
144376
|
}
|
|
144377
144377
|
case "ForStatement": {
|
|
144378
|
-
var
|
|
144379
|
-
var sep32 =
|
|
144378
|
+
var init2 = path42.call(print13, "init");
|
|
144379
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
144380
144380
|
var forParen = "for (";
|
|
144381
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
144381
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path42.call(print13, "test"), path42.call(print13, "update")]).indentTail(forParen.length);
|
|
144382
144382
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
144383
144383
|
var clause = adjustClause(path42.call(print13, "body"), options);
|
|
144384
144384
|
parts.push(head);
|
|
@@ -152586,23 +152586,23 @@ var validateHeaderValue2 = typeof import_node_http3.default.validateHeaderValue
|
|
|
152586
152586
|
}
|
|
152587
152587
|
};
|
|
152588
152588
|
var Headers2 = class extends URLSearchParams {
|
|
152589
|
-
constructor(
|
|
152589
|
+
constructor(init2) {
|
|
152590
152590
|
let result = [];
|
|
152591
|
-
if (
|
|
152592
|
-
const raw =
|
|
152591
|
+
if (init2 instanceof Headers2) {
|
|
152592
|
+
const raw = init2.raw();
|
|
152593
152593
|
for (const [name, values] of Object.entries(raw)) {
|
|
152594
152594
|
result.push(...values.map((value) => [name, value]));
|
|
152595
152595
|
}
|
|
152596
|
-
} else if (
|
|
152597
|
-
} else if (typeof
|
|
152598
|
-
const method =
|
|
152596
|
+
} else if (init2 == null) {
|
|
152597
|
+
} else if (typeof init2 === "object" && !import_node_util7.types.isBoxedPrimitive(init2)) {
|
|
152598
|
+
const method = init2[Symbol.iterator];
|
|
152599
152599
|
if (method == null) {
|
|
152600
|
-
result.push(...Object.entries(
|
|
152600
|
+
result.push(...Object.entries(init2));
|
|
152601
152601
|
} else {
|
|
152602
152602
|
if (typeof method !== "function") {
|
|
152603
152603
|
throw new TypeError("Header pairs must be iterable");
|
|
152604
152604
|
}
|
|
152605
|
-
result = [...
|
|
152605
|
+
result = [...init2].map((pair) => {
|
|
152606
152606
|
if (typeof pair !== "object" || import_node_util7.types.isBoxedPrimitive(pair)) {
|
|
152607
152607
|
throw new TypeError("Each header pair must be an iterable object");
|
|
152608
152608
|
}
|
|
@@ -152797,17 +152797,17 @@ var Response22 = class extends Body2 {
|
|
|
152797
152797
|
response[INTERNALS22].type = "error";
|
|
152798
152798
|
return response;
|
|
152799
152799
|
}
|
|
152800
|
-
static json(data = void 0,
|
|
152800
|
+
static json(data = void 0, init2 = {}) {
|
|
152801
152801
|
const body = JSON.stringify(data);
|
|
152802
152802
|
if (body === void 0) {
|
|
152803
152803
|
throw new TypeError("data is not JSON serializable");
|
|
152804
152804
|
}
|
|
152805
|
-
const headers = new Headers2(
|
|
152805
|
+
const headers = new Headers2(init2 && init2.headers);
|
|
152806
152806
|
if (!headers.has("content-type")) {
|
|
152807
152807
|
headers.set("content-type", "application/json");
|
|
152808
152808
|
}
|
|
152809
152809
|
return new Response22(body, {
|
|
152810
|
-
...
|
|
152810
|
+
...init2,
|
|
152811
152811
|
headers
|
|
152812
152812
|
});
|
|
152813
152813
|
}
|
|
@@ -152853,7 +152853,7 @@ var doBadDataWarn2 = (0, import_node_util8.deprecate)(
|
|
|
152853
152853
|
"https://github.com/node-fetch/node-fetch/issues/1000 (request)"
|
|
152854
152854
|
);
|
|
152855
152855
|
var Request22 = class extends Body2 {
|
|
152856
|
-
constructor(input,
|
|
152856
|
+
constructor(input, init2 = {}) {
|
|
152857
152857
|
let parsedURL;
|
|
152858
152858
|
if (isRequest2(input)) {
|
|
152859
152859
|
parsedURL = new URL(input.url);
|
|
@@ -152864,21 +152864,21 @@ var Request22 = class extends Body2 {
|
|
|
152864
152864
|
if (parsedURL.username !== "" || parsedURL.password !== "") {
|
|
152865
152865
|
throw new TypeError(`${parsedURL} is an url with embedded credentials.`);
|
|
152866
152866
|
}
|
|
152867
|
-
let method =
|
|
152867
|
+
let method = init2.method || input.method || "GET";
|
|
152868
152868
|
if (/^(delete|get|head|options|post|put)$/i.test(method)) {
|
|
152869
152869
|
method = method.toUpperCase();
|
|
152870
152870
|
}
|
|
152871
|
-
if (!isRequest2(
|
|
152871
|
+
if (!isRequest2(init2) && "data" in init2) {
|
|
152872
152872
|
doBadDataWarn2();
|
|
152873
152873
|
}
|
|
152874
|
-
if ((
|
|
152874
|
+
if ((init2.body != null || isRequest2(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
|
152875
152875
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
|
152876
152876
|
}
|
|
152877
|
-
const inputBody =
|
|
152877
|
+
const inputBody = init2.body ? init2.body : isRequest2(input) && input.body !== null ? clone2(input) : null;
|
|
152878
152878
|
super(inputBody, {
|
|
152879
|
-
size:
|
|
152879
|
+
size: init2.size || input.size || 0
|
|
152880
152880
|
});
|
|
152881
|
-
const headers = new Headers2(
|
|
152881
|
+
const headers = new Headers2(init2.headers || input.headers || {});
|
|
152882
152882
|
if (inputBody !== null && !headers.has("Content-Type")) {
|
|
152883
152883
|
const contentType = extractContentType2(inputBody, this);
|
|
152884
152884
|
if (contentType) {
|
|
@@ -152886,13 +152886,13 @@ var Request22 = class extends Body2 {
|
|
|
152886
152886
|
}
|
|
152887
152887
|
}
|
|
152888
152888
|
let signal = isRequest2(input) ? input.signal : null;
|
|
152889
|
-
if ("signal" in
|
|
152890
|
-
signal =
|
|
152889
|
+
if ("signal" in init2) {
|
|
152890
|
+
signal = init2.signal;
|
|
152891
152891
|
}
|
|
152892
152892
|
if (signal != null && !isAbortSignal2(signal)) {
|
|
152893
152893
|
throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
|
|
152894
152894
|
}
|
|
152895
|
-
let referrer =
|
|
152895
|
+
let referrer = init2.referrer == null ? input.referrer : init2.referrer;
|
|
152896
152896
|
if (referrer === "") {
|
|
152897
152897
|
referrer = "no-referrer";
|
|
152898
152898
|
} else if (referrer) {
|
|
@@ -152903,19 +152903,19 @@ var Request22 = class extends Body2 {
|
|
|
152903
152903
|
}
|
|
152904
152904
|
this[INTERNALS32] = {
|
|
152905
152905
|
method,
|
|
152906
|
-
redirect:
|
|
152906
|
+
redirect: init2.redirect || input.redirect || "follow",
|
|
152907
152907
|
headers,
|
|
152908
152908
|
parsedURL,
|
|
152909
152909
|
signal,
|
|
152910
152910
|
referrer
|
|
152911
152911
|
};
|
|
152912
|
-
this.follow =
|
|
152913
|
-
this.compress =
|
|
152914
|
-
this.counter =
|
|
152915
|
-
this.agent =
|
|
152916
|
-
this.highWaterMark =
|
|
152917
|
-
this.insecureHTTPParser =
|
|
152918
|
-
this.referrerPolicy =
|
|
152912
|
+
this.follow = init2.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init2.follow;
|
|
152913
|
+
this.compress = init2.compress === void 0 ? input.compress === void 0 ? true : input.compress : init2.compress;
|
|
152914
|
+
this.counter = init2.counter || input.counter || 0;
|
|
152915
|
+
this.agent = init2.agent || input.agent;
|
|
152916
|
+
this.highWaterMark = init2.highWaterMark || input.highWaterMark || 16384;
|
|
152917
|
+
this.insecureHTTPParser = init2.insecureHTTPParser || input.insecureHTTPParser || false;
|
|
152918
|
+
this.referrerPolicy = init2.referrerPolicy || input.referrerPolicy || "";
|
|
152919
152919
|
}
|
|
152920
152920
|
get method() {
|
|
152921
152921
|
return this[INTERNALS32].method;
|
|
@@ -155782,6 +155782,53 @@ For more information, please visit these links:
|
|
|
155782
155782
|
- https://graphql.org/learn/global-object-identification/
|
|
155783
155783
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
155784
155784
|
`;
|
|
155785
|
+
var FORCE_COLOR;
|
|
155786
|
+
var NODE_DISABLE_COLORS;
|
|
155787
|
+
var NO_COLOR;
|
|
155788
|
+
var TERM;
|
|
155789
|
+
var isTTY = true;
|
|
155790
|
+
if (typeof process !== "undefined") {
|
|
155791
|
+
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
|
|
155792
|
+
isTTY = process.stdout && process.stdout.isTTY;
|
|
155793
|
+
}
|
|
155794
|
+
var $ = {
|
|
155795
|
+
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
|
|
155796
|
+
};
|
|
155797
|
+
function init(x22, y) {
|
|
155798
|
+
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
|
|
155799
|
+
let open = `\x1B[${x22}m`, close = `\x1B[${y}m`;
|
|
155800
|
+
return function(txt) {
|
|
155801
|
+
if (!$.enabled || txt == null)
|
|
155802
|
+
return txt;
|
|
155803
|
+
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
|
|
155804
|
+
};
|
|
155805
|
+
}
|
|
155806
|
+
var reset6 = init(0, 0);
|
|
155807
|
+
var bold6 = init(1, 22);
|
|
155808
|
+
var dim6 = init(2, 22);
|
|
155809
|
+
var italic6 = init(3, 23);
|
|
155810
|
+
var underline6 = init(4, 24);
|
|
155811
|
+
var inverse6 = init(7, 27);
|
|
155812
|
+
var hidden6 = init(8, 28);
|
|
155813
|
+
var strikethrough6 = init(9, 29);
|
|
155814
|
+
var black6 = init(30, 39);
|
|
155815
|
+
var red6 = init(31, 39);
|
|
155816
|
+
var green6 = init(32, 39);
|
|
155817
|
+
var yellow6 = init(33, 39);
|
|
155818
|
+
var blue6 = init(34, 39);
|
|
155819
|
+
var magenta6 = init(35, 39);
|
|
155820
|
+
var cyan6 = init(36, 39);
|
|
155821
|
+
var white6 = init(37, 39);
|
|
155822
|
+
var gray6 = init(90, 39);
|
|
155823
|
+
var grey = init(90, 39);
|
|
155824
|
+
var bgBlack6 = init(40, 49);
|
|
155825
|
+
var bgRed6 = init(41, 49);
|
|
155826
|
+
var bgGreen6 = init(42, 49);
|
|
155827
|
+
var bgYellow6 = init(43, 49);
|
|
155828
|
+
var bgBlue6 = init(44, 49);
|
|
155829
|
+
var bgMagenta6 = init(45, 49);
|
|
155830
|
+
var bgCyan6 = init(46, 49);
|
|
155831
|
+
var bgWhite6 = init(47, 49);
|
|
155785
155832
|
var recast14 = __toESM3(require_main22(), 1);
|
|
155786
155833
|
var AST15 = recast14.types.builders;
|
|
155787
155834
|
function find_insert_index(script) {
|
|
@@ -155810,21 +155857,21 @@ function find_exported_fn(body, name) {
|
|
|
155810
155857
|
continue;
|
|
155811
155858
|
}
|
|
155812
155859
|
const declaration = value.declarations[0];
|
|
155813
|
-
let { init } = declaration;
|
|
155814
|
-
if (!
|
|
155860
|
+
let { init: init2 } = declaration;
|
|
155861
|
+
if (!init2) {
|
|
155815
155862
|
continue;
|
|
155816
155863
|
}
|
|
155817
|
-
if (
|
|
155818
|
-
|
|
155864
|
+
if (init2.type === "TSSatisfiesExpression") {
|
|
155865
|
+
init2 = init2.expression;
|
|
155819
155866
|
}
|
|
155820
|
-
if (
|
|
155821
|
-
|
|
155867
|
+
if (init2.type === "CallExpression" && init2.arguments[0] && (init2.arguments[0].type === "FunctionExpression" || init2.arguments[0].type === "ArrowFunctionExpression")) {
|
|
155868
|
+
init2 = init2.arguments[0];
|
|
155822
155869
|
}
|
|
155823
|
-
if (
|
|
155824
|
-
return { declaration:
|
|
155870
|
+
if (init2.type === "FunctionExpression" || init2.type === "ArrowFunctionExpression") {
|
|
155871
|
+
return { declaration: init2, export: exportDeclaration };
|
|
155825
155872
|
}
|
|
155826
|
-
if (
|
|
155827
|
-
return { declaration:
|
|
155873
|
+
if (init2.type === "Identifier" || init2.type === "CallExpression") {
|
|
155874
|
+
return { declaration: init2, export: exportDeclaration };
|
|
155828
155875
|
}
|
|
155829
155876
|
} else {
|
|
155830
155877
|
continue;
|