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
|
@@ -1667,13 +1667,13 @@ var require_scope2 = __commonJS({
|
|
|
1667
1667
|
var name = prefix + index;
|
|
1668
1668
|
return this.bindings[name] = types11.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) {
|
|
@@ -7233,9 +7233,9 @@ var require_esprima5 = __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_esprima5 = __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_esprima5 = __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_esprima5 = __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_esprima5 = __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_esprima5 = __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_esprima5 = __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_esprima5 = __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_esprima5 = __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_esprima5 = __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_printer2 = __commonJS({
|
|
|
14857
14857
|
return (0, lines_1.concat)(parts);
|
|
14858
14858
|
}
|
|
14859
14859
|
case "ForStatement": {
|
|
14860
|
-
var
|
|
14861
|
-
var sep4 =
|
|
14860
|
+
var init2 = path5.call(print13, "init");
|
|
14861
|
+
var sep4 = init2.length > 1 ? ";\n" : "; ";
|
|
14862
14862
|
var forParen = "for (";
|
|
14863
|
-
var indented = (0, lines_1.fromString)(sep4).join([
|
|
14863
|
+
var indented = (0, lines_1.fromString)(sep4).join([init2, path5.call(print13, "test"), path5.call(print13, "update")]).indentTail(forParen.length);
|
|
14864
14864
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
14865
14865
|
var clause = adjustClause(path5.call(print13, "body"), options);
|
|
14866
14866
|
parts.push(head);
|
|
@@ -24574,10 +24574,10 @@ var require_ponyfill_es2018 = __commonJS2({
|
|
|
24574
24574
|
}
|
|
24575
24575
|
return size;
|
|
24576
24576
|
}
|
|
24577
|
-
function convertQueuingStrategy(
|
|
24578
|
-
assertDictionary(
|
|
24579
|
-
const highWaterMark =
|
|
24580
|
-
const size =
|
|
24577
|
+
function convertQueuingStrategy(init2, context) {
|
|
24578
|
+
assertDictionary(init2, context);
|
|
24579
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
24580
|
+
const size = init2 === null || init2 === void 0 ? void 0 : init2.size;
|
|
24581
24581
|
return {
|
|
24582
24582
|
highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark),
|
|
24583
24583
|
size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`)
|
|
@@ -26429,9 +26429,9 @@ var require_ponyfill_es2018 = __commonJS2({
|
|
|
26429
26429
|
function streamBrandCheckException$1(name) {
|
|
26430
26430
|
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
26431
26431
|
}
|
|
26432
|
-
function convertQueuingStrategyInit(
|
|
26433
|
-
assertDictionary(
|
|
26434
|
-
const highWaterMark =
|
|
26432
|
+
function convertQueuingStrategyInit(init2, context) {
|
|
26433
|
+
assertDictionary(init2, context);
|
|
26434
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
26435
26435
|
assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit");
|
|
26436
26436
|
return {
|
|
26437
26437
|
highWaterMark: convertUnrestrictedDouble(highWaterMark)
|
|
@@ -35599,10 +35599,10 @@ var require_generated2 = __commonJS2({
|
|
|
35599
35599
|
body
|
|
35600
35600
|
});
|
|
35601
35601
|
}
|
|
35602
|
-
function forStatement(
|
|
35602
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
35603
35603
|
return (0, _validateNode.default)({
|
|
35604
35604
|
type: "ForStatement",
|
|
35605
|
-
init,
|
|
35605
|
+
init: init2,
|
|
35606
35606
|
test,
|
|
35607
35607
|
update,
|
|
35608
35608
|
body
|
|
@@ -35820,11 +35820,11 @@ var require_generated2 = __commonJS2({
|
|
|
35820
35820
|
declarations
|
|
35821
35821
|
});
|
|
35822
35822
|
}
|
|
35823
|
-
function variableDeclarator(id,
|
|
35823
|
+
function variableDeclarator(id, init2 = null) {
|
|
35824
35824
|
return (0, _validateNode.default)({
|
|
35825
35825
|
type: "VariableDeclarator",
|
|
35826
35826
|
id,
|
|
35827
|
-
init
|
|
35827
|
+
init: init2
|
|
35828
35828
|
});
|
|
35829
35829
|
}
|
|
35830
35830
|
function whileStatement(test, body) {
|
|
@@ -36526,18 +36526,18 @@ var require_generated2 = __commonJS2({
|
|
|
36526
36526
|
init: null
|
|
36527
36527
|
});
|
|
36528
36528
|
}
|
|
36529
|
-
function enumNumberMember(id,
|
|
36529
|
+
function enumNumberMember(id, init2) {
|
|
36530
36530
|
return (0, _validateNode.default)({
|
|
36531
36531
|
type: "EnumNumberMember",
|
|
36532
36532
|
id,
|
|
36533
|
-
init
|
|
36533
|
+
init: init2
|
|
36534
36534
|
});
|
|
36535
36535
|
}
|
|
36536
|
-
function enumStringMember(id,
|
|
36536
|
+
function enumStringMember(id, init2) {
|
|
36537
36537
|
return (0, _validateNode.default)({
|
|
36538
36538
|
type: "EnumStringMember",
|
|
36539
36539
|
id,
|
|
36540
|
-
init
|
|
36540
|
+
init: init2
|
|
36541
36541
|
});
|
|
36542
36542
|
}
|
|
36543
36543
|
function enumDefaultedMember(id) {
|
|
@@ -48243,13 +48243,13 @@ var require_lib6 = __commonJS2({
|
|
|
48243
48243
|
flowEnumMemberRaw() {
|
|
48244
48244
|
const loc = this.state.startLoc;
|
|
48245
48245
|
const id = this.parseIdentifier(true);
|
|
48246
|
-
const
|
|
48246
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
48247
48247
|
type: "none",
|
|
48248
48248
|
loc
|
|
48249
48249
|
};
|
|
48250
48250
|
return {
|
|
48251
48251
|
id,
|
|
48252
|
-
init
|
|
48252
|
+
init: init2
|
|
48253
48253
|
};
|
|
48254
48254
|
}
|
|
48255
48255
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -48283,7 +48283,7 @@ var require_lib6 = __commonJS2({
|
|
|
48283
48283
|
const memberNode = this.startNode();
|
|
48284
48284
|
const {
|
|
48285
48285
|
id,
|
|
48286
|
-
init
|
|
48286
|
+
init: init2
|
|
48287
48287
|
} = this.flowEnumMemberRaw();
|
|
48288
48288
|
const memberName = id.name;
|
|
48289
48289
|
if (memberName === "") {
|
|
@@ -48309,35 +48309,35 @@ var require_lib6 = __commonJS2({
|
|
|
48309
48309
|
memberName
|
|
48310
48310
|
};
|
|
48311
48311
|
memberNode.id = id;
|
|
48312
|
-
switch (
|
|
48312
|
+
switch (init2.type) {
|
|
48313
48313
|
case "boolean": {
|
|
48314
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48315
|
-
memberNode.init =
|
|
48314
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
48315
|
+
memberNode.init = init2.value;
|
|
48316
48316
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
48317
48317
|
break;
|
|
48318
48318
|
}
|
|
48319
48319
|
case "number": {
|
|
48320
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48321
|
-
memberNode.init =
|
|
48320
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
48321
|
+
memberNode.init = init2.value;
|
|
48322
48322
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
48323
48323
|
break;
|
|
48324
48324
|
}
|
|
48325
48325
|
case "string": {
|
|
48326
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
48327
|
-
memberNode.init =
|
|
48326
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
48327
|
+
memberNode.init = init2.value;
|
|
48328
48328
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
48329
48329
|
break;
|
|
48330
48330
|
}
|
|
48331
48331
|
case "invalid": {
|
|
48332
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
48332
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
48333
48333
|
}
|
|
48334
48334
|
case "none": {
|
|
48335
48335
|
switch (explicitType) {
|
|
48336
48336
|
case "boolean":
|
|
48337
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
48337
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
48338
48338
|
break;
|
|
48339
48339
|
case "number":
|
|
48340
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
48340
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
48341
48341
|
break;
|
|
48342
48342
|
default:
|
|
48343
48343
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -51438,14 +51438,14 @@ var require_lib6 = __commonJS2({
|
|
|
51438
51438
|
return declaration;
|
|
51439
51439
|
for (const {
|
|
51440
51440
|
id,
|
|
51441
|
-
init
|
|
51441
|
+
init: init2
|
|
51442
51442
|
} of declaration.declarations) {
|
|
51443
|
-
if (!
|
|
51443
|
+
if (!init2)
|
|
51444
51444
|
continue;
|
|
51445
51445
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
51446
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
51447
|
-
} else if (!isValidAmbientConstInitializer(
|
|
51448
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
51446
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
51447
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
51448
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
51449
51449
|
}
|
|
51450
51450
|
}
|
|
51451
51451
|
return declaration;
|
|
@@ -54925,49 +54925,49 @@ var require_lib6 = __commonJS2({
|
|
|
54925
54925
|
}
|
|
54926
54926
|
this.next();
|
|
54927
54927
|
this.parseVar(initNode, true, kind);
|
|
54928
|
-
const
|
|
54928
|
+
const init22 = this.finishNode(initNode, "VariableDeclaration");
|
|
54929
54929
|
const isForIn = this.match(58);
|
|
54930
54930
|
if (isForIn && starsWithUsingDeclaration) {
|
|
54931
|
-
this.raise(Errors.ForInUsing,
|
|
54931
|
+
this.raise(Errors.ForInUsing, init22);
|
|
54932
54932
|
}
|
|
54933
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
54934
|
-
return this.parseForIn(node,
|
|
54933
|
+
if ((isForIn || this.isContextual(102)) && init22.declarations.length === 1) {
|
|
54934
|
+
return this.parseForIn(node, init22, awaitAt);
|
|
54935
54935
|
}
|
|
54936
54936
|
if (awaitAt !== null) {
|
|
54937
54937
|
this.unexpected(awaitAt);
|
|
54938
54938
|
}
|
|
54939
|
-
return this.parseFor(node,
|
|
54939
|
+
return this.parseFor(node, init22);
|
|
54940
54940
|
}
|
|
54941
54941
|
}
|
|
54942
54942
|
const startsWithAsync = this.isContextual(95);
|
|
54943
54943
|
const refExpressionErrors = new ExpressionErrors();
|
|
54944
|
-
const
|
|
54944
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
54945
54945
|
const isForOf = this.isContextual(102);
|
|
54946
54946
|
if (isForOf) {
|
|
54947
54947
|
if (startsWithLet) {
|
|
54948
|
-
this.raise(Errors.ForOfLet,
|
|
54948
|
+
this.raise(Errors.ForOfLet, init2);
|
|
54949
54949
|
}
|
|
54950
|
-
if (awaitAt === null && startsWithAsync &&
|
|
54951
|
-
this.raise(Errors.ForOfAsync,
|
|
54950
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
54951
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
54952
54952
|
}
|
|
54953
54953
|
}
|
|
54954
54954
|
if (isForOf || this.match(58)) {
|
|
54955
54955
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
54956
|
-
this.toAssignable(
|
|
54956
|
+
this.toAssignable(init2, true);
|
|
54957
54957
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
54958
|
-
this.checkLVal(
|
|
54958
|
+
this.checkLVal(init2, {
|
|
54959
54959
|
in: {
|
|
54960
54960
|
type
|
|
54961
54961
|
}
|
|
54962
54962
|
});
|
|
54963
|
-
return this.parseForIn(node,
|
|
54963
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
54964
54964
|
} else {
|
|
54965
54965
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
54966
54966
|
}
|
|
54967
54967
|
if (awaitAt !== null) {
|
|
54968
54968
|
this.unexpected(awaitAt);
|
|
54969
54969
|
}
|
|
54970
|
-
return this.parseFor(node,
|
|
54970
|
+
return this.parseFor(node, init2);
|
|
54971
54971
|
}
|
|
54972
54972
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
54973
54973
|
this.next();
|
|
@@ -55189,8 +55189,8 @@ var require_lib6 = __commonJS2({
|
|
|
55189
55189
|
}
|
|
55190
55190
|
this.next();
|
|
55191
55191
|
}
|
|
55192
|
-
parseFor(node,
|
|
55193
|
-
node.init =
|
|
55192
|
+
parseFor(node, init2) {
|
|
55193
|
+
node.init = init2;
|
|
55194
55194
|
this.semicolon(false);
|
|
55195
55195
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
55196
55196
|
this.semicolon(false);
|
|
@@ -55201,7 +55201,7 @@ var require_lib6 = __commonJS2({
|
|
|
55201
55201
|
this.state.labels.pop();
|
|
55202
55202
|
return this.finishNode(node, "ForStatement");
|
|
55203
55203
|
}
|
|
55204
|
-
parseForIn(node,
|
|
55204
|
+
parseForIn(node, init2, awaitAt) {
|
|
55205
55205
|
const isForIn = this.match(58);
|
|
55206
55206
|
this.next();
|
|
55207
55207
|
if (isForIn) {
|
|
@@ -55210,19 +55210,19 @@ var require_lib6 = __commonJS2({
|
|
|
55210
55210
|
} else {
|
|
55211
55211
|
node.await = awaitAt !== null;
|
|
55212
55212
|
}
|
|
55213
|
-
if (
|
|
55214
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
55213
|
+
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")) {
|
|
55214
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
55215
55215
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
55216
55216
|
});
|
|
55217
55217
|
}
|
|
55218
|
-
if (
|
|
55219
|
-
this.raise(Errors.InvalidLhs,
|
|
55218
|
+
if (init2.type === "AssignmentPattern") {
|
|
55219
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
55220
55220
|
ancestor: {
|
|
55221
55221
|
type: "ForStatement"
|
|
55222
55222
|
}
|
|
55223
55223
|
});
|
|
55224
55224
|
}
|
|
55225
|
-
node.left =
|
|
55225
|
+
node.left = init2;
|
|
55226
55226
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
55227
55227
|
this.expect(11);
|
|
55228
55228
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -58021,13 +58021,13 @@ var require_scope = __commonJS2({
|
|
|
58021
58021
|
var name = prefix + index;
|
|
58022
58022
|
return this.bindings[name] = types62.builders.identifier(name);
|
|
58023
58023
|
};
|
|
58024
|
-
Sp.injectTemporary = function(identifier,
|
|
58024
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
58025
58025
|
identifier || (identifier = this.declareTemporary());
|
|
58026
58026
|
var bodyPath = this.path.get("body");
|
|
58027
58027
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
58028
58028
|
bodyPath = bodyPath.get("body");
|
|
58029
58029
|
}
|
|
58030
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
58030
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
58031
58031
|
return identifier;
|
|
58032
58032
|
};
|
|
58033
58033
|
Sp.scan = function(force) {
|
|
@@ -63507,9 +63507,9 @@ var require_esprima2 = __commonJS2({
|
|
|
63507
63507
|
}();
|
|
63508
63508
|
exports2.ForOfStatement = ForOfStatement;
|
|
63509
63509
|
var ForStatement = function() {
|
|
63510
|
-
function ForStatement2(
|
|
63510
|
+
function ForStatement2(init2, test, update, body) {
|
|
63511
63511
|
this.type = syntax_1.Syntax.ForStatement;
|
|
63512
|
-
this.init =
|
|
63512
|
+
this.init = init2;
|
|
63513
63513
|
this.test = test;
|
|
63514
63514
|
this.update = update;
|
|
63515
63515
|
this.body = body;
|
|
@@ -63849,10 +63849,10 @@ var require_esprima2 = __commonJS2({
|
|
|
63849
63849
|
}();
|
|
63850
63850
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
63851
63851
|
var VariableDeclarator = function() {
|
|
63852
|
-
function VariableDeclarator2(id,
|
|
63852
|
+
function VariableDeclarator2(id, init2) {
|
|
63853
63853
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
63854
63854
|
this.id = id;
|
|
63855
|
-
this.init =
|
|
63855
|
+
this.init = init2;
|
|
63856
63856
|
}
|
|
63857
63857
|
return VariableDeclarator2;
|
|
63858
63858
|
}();
|
|
@@ -64557,8 +64557,8 @@ var require_esprima2 = __commonJS2({
|
|
|
64557
64557
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
64558
64558
|
this.nextToken();
|
|
64559
64559
|
shorthand = true;
|
|
64560
|
-
var
|
|
64561
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
64560
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
64561
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
64562
64562
|
} else {
|
|
64563
64563
|
shorthand = true;
|
|
64564
64564
|
value = id;
|
|
@@ -65336,21 +65336,21 @@ var require_esprima2 = __commonJS2({
|
|
|
65336
65336
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
65337
65337
|
}
|
|
65338
65338
|
}
|
|
65339
|
-
var
|
|
65339
|
+
var init2 = null;
|
|
65340
65340
|
if (kind === "const") {
|
|
65341
65341
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
65342
65342
|
if (this.match("=")) {
|
|
65343
65343
|
this.nextToken();
|
|
65344
|
-
|
|
65344
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65345
65345
|
} else {
|
|
65346
65346
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
65347
65347
|
}
|
|
65348
65348
|
}
|
|
65349
65349
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
65350
65350
|
this.expect("=");
|
|
65351
|
-
|
|
65351
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65352
65352
|
}
|
|
65353
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
65353
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
65354
65354
|
};
|
|
65355
65355
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
65356
65356
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -65414,17 +65414,17 @@ var require_esprima2 = __commonJS2({
|
|
|
65414
65414
|
if (this.lookahead.type === 3) {
|
|
65415
65415
|
var keyToken = this.lookahead;
|
|
65416
65416
|
key = this.parseVariableIdentifier();
|
|
65417
|
-
var
|
|
65417
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
65418
65418
|
if (this.match("=")) {
|
|
65419
65419
|
params.push(keyToken);
|
|
65420
65420
|
shorthand = true;
|
|
65421
65421
|
this.nextToken();
|
|
65422
65422
|
var expr = this.parseAssignmentExpression();
|
|
65423
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
65423
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
65424
65424
|
} else if (!this.match(":")) {
|
|
65425
65425
|
params.push(keyToken);
|
|
65426
65426
|
shorthand = true;
|
|
65427
|
-
value =
|
|
65427
|
+
value = init2;
|
|
65428
65428
|
} else {
|
|
65429
65429
|
this.expect(":");
|
|
65430
65430
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -65509,14 +65509,14 @@ var require_esprima2 = __commonJS2({
|
|
|
65509
65509
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
65510
65510
|
}
|
|
65511
65511
|
}
|
|
65512
|
-
var
|
|
65512
|
+
var init2 = null;
|
|
65513
65513
|
if (this.match("=")) {
|
|
65514
65514
|
this.nextToken();
|
|
65515
|
-
|
|
65515
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
65516
65516
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
65517
65517
|
this.expect("=");
|
|
65518
65518
|
}
|
|
65519
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
65519
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
65520
65520
|
};
|
|
65521
65521
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
65522
65522
|
var opt = { inFor: options.inFor };
|
|
@@ -65611,7 +65611,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65611
65611
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
65612
65612
|
};
|
|
65613
65613
|
Parser2.prototype.parseForStatement = function() {
|
|
65614
|
-
var
|
|
65614
|
+
var init2 = null;
|
|
65615
65615
|
var test = null;
|
|
65616
65616
|
var update = null;
|
|
65617
65617
|
var forIn = true;
|
|
@@ -65623,7 +65623,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65623
65623
|
this.nextToken();
|
|
65624
65624
|
} else {
|
|
65625
65625
|
if (this.matchKeyword("var")) {
|
|
65626
|
-
|
|
65626
|
+
init2 = this.createNode();
|
|
65627
65627
|
this.nextToken();
|
|
65628
65628
|
var previousAllowIn = this.context.allowIn;
|
|
65629
65629
|
this.context.allowIn = false;
|
|
@@ -65634,87 +65634,87 @@ var require_esprima2 = __commonJS2({
|
|
|
65634
65634
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
65635
65635
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
65636
65636
|
}
|
|
65637
|
-
|
|
65637
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65638
65638
|
this.nextToken();
|
|
65639
|
-
left =
|
|
65639
|
+
left = init2;
|
|
65640
65640
|
right = this.parseExpression();
|
|
65641
|
-
|
|
65641
|
+
init2 = null;
|
|
65642
65642
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
65643
|
-
|
|
65643
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65644
65644
|
this.nextToken();
|
|
65645
|
-
left =
|
|
65645
|
+
left = init2;
|
|
65646
65646
|
right = this.parseAssignmentExpression();
|
|
65647
|
-
|
|
65647
|
+
init2 = null;
|
|
65648
65648
|
forIn = false;
|
|
65649
65649
|
} else {
|
|
65650
|
-
|
|
65650
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
65651
65651
|
this.expect(";");
|
|
65652
65652
|
}
|
|
65653
65653
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
65654
|
-
|
|
65654
|
+
init2 = this.createNode();
|
|
65655
65655
|
var kind = this.nextToken().value;
|
|
65656
65656
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
65657
|
-
|
|
65657
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
65658
65658
|
this.nextToken();
|
|
65659
|
-
left =
|
|
65659
|
+
left = init2;
|
|
65660
65660
|
right = this.parseExpression();
|
|
65661
|
-
|
|
65661
|
+
init2 = null;
|
|
65662
65662
|
} else {
|
|
65663
65663
|
var previousAllowIn = this.context.allowIn;
|
|
65664
65664
|
this.context.allowIn = false;
|
|
65665
65665
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
65666
65666
|
this.context.allowIn = previousAllowIn;
|
|
65667
65667
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
65668
|
-
|
|
65668
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65669
65669
|
this.nextToken();
|
|
65670
|
-
left =
|
|
65670
|
+
left = init2;
|
|
65671
65671
|
right = this.parseExpression();
|
|
65672
|
-
|
|
65672
|
+
init2 = null;
|
|
65673
65673
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
65674
|
-
|
|
65674
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65675
65675
|
this.nextToken();
|
|
65676
|
-
left =
|
|
65676
|
+
left = init2;
|
|
65677
65677
|
right = this.parseAssignmentExpression();
|
|
65678
|
-
|
|
65678
|
+
init2 = null;
|
|
65679
65679
|
forIn = false;
|
|
65680
65680
|
} else {
|
|
65681
65681
|
this.consumeSemicolon();
|
|
65682
|
-
|
|
65682
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
65683
65683
|
}
|
|
65684
65684
|
}
|
|
65685
65685
|
} else {
|
|
65686
65686
|
var initStartToken = this.lookahead;
|
|
65687
65687
|
var previousAllowIn = this.context.allowIn;
|
|
65688
65688
|
this.context.allowIn = false;
|
|
65689
|
-
|
|
65689
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
65690
65690
|
this.context.allowIn = previousAllowIn;
|
|
65691
65691
|
if (this.matchKeyword("in")) {
|
|
65692
|
-
if (!this.context.isAssignmentTarget ||
|
|
65692
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
65693
65693
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
65694
65694
|
}
|
|
65695
65695
|
this.nextToken();
|
|
65696
|
-
this.reinterpretExpressionAsPattern(
|
|
65697
|
-
left =
|
|
65696
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
65697
|
+
left = init2;
|
|
65698
65698
|
right = this.parseExpression();
|
|
65699
|
-
|
|
65699
|
+
init2 = null;
|
|
65700
65700
|
} else if (this.matchContextualKeyword("of")) {
|
|
65701
|
-
if (!this.context.isAssignmentTarget ||
|
|
65701
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
65702
65702
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
65703
65703
|
}
|
|
65704
65704
|
this.nextToken();
|
|
65705
|
-
this.reinterpretExpressionAsPattern(
|
|
65706
|
-
left =
|
|
65705
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
65706
|
+
left = init2;
|
|
65707
65707
|
right = this.parseAssignmentExpression();
|
|
65708
|
-
|
|
65708
|
+
init2 = null;
|
|
65709
65709
|
forIn = false;
|
|
65710
65710
|
} else {
|
|
65711
65711
|
if (this.match(",")) {
|
|
65712
|
-
var initSeq = [
|
|
65712
|
+
var initSeq = [init2];
|
|
65713
65713
|
while (this.match(",")) {
|
|
65714
65714
|
this.nextToken();
|
|
65715
65715
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
65716
65716
|
}
|
|
65717
|
-
|
|
65717
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
65718
65718
|
}
|
|
65719
65719
|
this.expect(";");
|
|
65720
65720
|
}
|
|
@@ -65740,7 +65740,7 @@ var require_esprima2 = __commonJS2({
|
|
|
65740
65740
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
65741
65741
|
this.context.inIteration = previousInIteration;
|
|
65742
65742
|
}
|
|
65743
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
65743
|
+
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));
|
|
65744
65744
|
};
|
|
65745
65745
|
Parser2.prototype.parseContinueStatement = function() {
|
|
65746
65746
|
var node = this.createNode();
|
|
@@ -71113,10 +71113,10 @@ var require_printer = __commonJS2({
|
|
|
71113
71113
|
return (0, lines_1.concat)(parts);
|
|
71114
71114
|
}
|
|
71115
71115
|
case "ForStatement": {
|
|
71116
|
-
var
|
|
71117
|
-
var sep32 =
|
|
71116
|
+
var init2 = path42.call(print62, "init");
|
|
71117
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
71118
71118
|
var forParen = "for (";
|
|
71119
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
71119
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path42.call(print62, "test"), path42.call(print62, "update")]).indentTail(forParen.length);
|
|
71120
71120
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
71121
71121
|
var clause = adjustClause(path42.call(print62, "body"), options);
|
|
71122
71122
|
parts.push(head);
|
|
@@ -81834,23 +81834,23 @@ var validateHeaderValue = typeof http.validateHeaderValue === "function" ? http.
|
|
|
81834
81834
|
}
|
|
81835
81835
|
};
|
|
81836
81836
|
var Headers = class extends URLSearchParams {
|
|
81837
|
-
constructor(
|
|
81837
|
+
constructor(init2) {
|
|
81838
81838
|
let result = [];
|
|
81839
|
-
if (
|
|
81840
|
-
const raw =
|
|
81839
|
+
if (init2 instanceof Headers) {
|
|
81840
|
+
const raw = init2.raw();
|
|
81841
81841
|
for (const [name, values] of Object.entries(raw)) {
|
|
81842
81842
|
result.push(...values.map((value) => [name, value]));
|
|
81843
81843
|
}
|
|
81844
|
-
} else if (
|
|
81845
|
-
} else if (typeof
|
|
81846
|
-
const method =
|
|
81844
|
+
} else if (init2 == null) {
|
|
81845
|
+
} else if (typeof init2 === "object" && !types3.isBoxedPrimitive(init2)) {
|
|
81846
|
+
const method = init2[Symbol.iterator];
|
|
81847
81847
|
if (method == null) {
|
|
81848
|
-
result.push(...Object.entries(
|
|
81848
|
+
result.push(...Object.entries(init2));
|
|
81849
81849
|
} else {
|
|
81850
81850
|
if (typeof method !== "function") {
|
|
81851
81851
|
throw new TypeError("Header pairs must be iterable");
|
|
81852
81852
|
}
|
|
81853
|
-
result = [...
|
|
81853
|
+
result = [...init2].map((pair) => {
|
|
81854
81854
|
if (typeof pair !== "object" || types3.isBoxedPrimitive(pair)) {
|
|
81855
81855
|
throw new TypeError("Each header pair must be an iterable object");
|
|
81856
81856
|
}
|
|
@@ -82063,17 +82063,17 @@ var Response2 = class extends Body {
|
|
|
82063
82063
|
response[INTERNALS2].type = "error";
|
|
82064
82064
|
return response;
|
|
82065
82065
|
}
|
|
82066
|
-
static json(data = void 0,
|
|
82066
|
+
static json(data = void 0, init2 = {}) {
|
|
82067
82067
|
const body = JSON.stringify(data);
|
|
82068
82068
|
if (body === void 0) {
|
|
82069
82069
|
throw new TypeError("data is not JSON serializable");
|
|
82070
82070
|
}
|
|
82071
|
-
const headers = new Headers(
|
|
82071
|
+
const headers = new Headers(init2 && init2.headers);
|
|
82072
82072
|
if (!headers.has("content-type")) {
|
|
82073
82073
|
headers.set("content-type", "application/json");
|
|
82074
82074
|
}
|
|
82075
82075
|
return new Response2(body, {
|
|
82076
|
-
...
|
|
82076
|
+
...init2,
|
|
82077
82077
|
headers
|
|
82078
82078
|
});
|
|
82079
82079
|
}
|
|
@@ -82247,7 +82247,7 @@ var doBadDataWarn = deprecate2(
|
|
|
82247
82247
|
"https://github.com/node-fetch/node-fetch/issues/1000 (request)"
|
|
82248
82248
|
);
|
|
82249
82249
|
var Request2 = class extends Body {
|
|
82250
|
-
constructor(input,
|
|
82250
|
+
constructor(input, init2 = {}) {
|
|
82251
82251
|
let parsedURL;
|
|
82252
82252
|
if (isRequest(input)) {
|
|
82253
82253
|
parsedURL = new URL(input.url);
|
|
@@ -82258,21 +82258,21 @@ var Request2 = class extends Body {
|
|
|
82258
82258
|
if (parsedURL.username !== "" || parsedURL.password !== "") {
|
|
82259
82259
|
throw new TypeError(`${parsedURL} is an url with embedded credentials.`);
|
|
82260
82260
|
}
|
|
82261
|
-
let method =
|
|
82261
|
+
let method = init2.method || input.method || "GET";
|
|
82262
82262
|
if (/^(delete|get|head|options|post|put)$/i.test(method)) {
|
|
82263
82263
|
method = method.toUpperCase();
|
|
82264
82264
|
}
|
|
82265
|
-
if (!isRequest(
|
|
82265
|
+
if (!isRequest(init2) && "data" in init2) {
|
|
82266
82266
|
doBadDataWarn();
|
|
82267
82267
|
}
|
|
82268
|
-
if ((
|
|
82268
|
+
if ((init2.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
|
82269
82269
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
|
82270
82270
|
}
|
|
82271
|
-
const inputBody =
|
|
82271
|
+
const inputBody = init2.body ? init2.body : isRequest(input) && input.body !== null ? clone(input) : null;
|
|
82272
82272
|
super(inputBody, {
|
|
82273
|
-
size:
|
|
82273
|
+
size: init2.size || input.size || 0
|
|
82274
82274
|
});
|
|
82275
|
-
const headers = new Headers(
|
|
82275
|
+
const headers = new Headers(init2.headers || input.headers || {});
|
|
82276
82276
|
if (inputBody !== null && !headers.has("Content-Type")) {
|
|
82277
82277
|
const contentType = extractContentType(inputBody, this);
|
|
82278
82278
|
if (contentType) {
|
|
@@ -82280,13 +82280,13 @@ var Request2 = class extends Body {
|
|
|
82280
82280
|
}
|
|
82281
82281
|
}
|
|
82282
82282
|
let signal = isRequest(input) ? input.signal : null;
|
|
82283
|
-
if ("signal" in
|
|
82284
|
-
signal =
|
|
82283
|
+
if ("signal" in init2) {
|
|
82284
|
+
signal = init2.signal;
|
|
82285
82285
|
}
|
|
82286
82286
|
if (signal != null && !isAbortSignal(signal)) {
|
|
82287
82287
|
throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
|
|
82288
82288
|
}
|
|
82289
|
-
let referrer =
|
|
82289
|
+
let referrer = init2.referrer == null ? input.referrer : init2.referrer;
|
|
82290
82290
|
if (referrer === "") {
|
|
82291
82291
|
referrer = "no-referrer";
|
|
82292
82292
|
} else if (referrer) {
|
|
@@ -82297,19 +82297,19 @@ var Request2 = class extends Body {
|
|
|
82297
82297
|
}
|
|
82298
82298
|
this[INTERNALS3] = {
|
|
82299
82299
|
method,
|
|
82300
|
-
redirect:
|
|
82300
|
+
redirect: init2.redirect || input.redirect || "follow",
|
|
82301
82301
|
headers,
|
|
82302
82302
|
parsedURL,
|
|
82303
82303
|
signal,
|
|
82304
82304
|
referrer
|
|
82305
82305
|
};
|
|
82306
|
-
this.follow =
|
|
82307
|
-
this.compress =
|
|
82308
|
-
this.counter =
|
|
82309
|
-
this.agent =
|
|
82310
|
-
this.highWaterMark =
|
|
82311
|
-
this.insecureHTTPParser =
|
|
82312
|
-
this.referrerPolicy =
|
|
82306
|
+
this.follow = init2.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init2.follow;
|
|
82307
|
+
this.compress = init2.compress === void 0 ? input.compress === void 0 ? true : input.compress : init2.compress;
|
|
82308
|
+
this.counter = init2.counter || input.counter || 0;
|
|
82309
|
+
this.agent = init2.agent || input.agent;
|
|
82310
|
+
this.highWaterMark = init2.highWaterMark || input.highWaterMark || 16384;
|
|
82311
|
+
this.insecureHTTPParser = init2.insecureHTTPParser || input.insecureHTTPParser || false;
|
|
82312
|
+
this.referrerPolicy = init2.referrerPolicy || input.referrerPolicy || "";
|
|
82313
82313
|
}
|
|
82314
82314
|
get method() {
|
|
82315
82315
|
return this[INTERNALS3].method;
|
|
@@ -97832,10 +97832,10 @@ var require_ponyfill_es20182 = __commonJS3({
|
|
|
97832
97832
|
}
|
|
97833
97833
|
return size;
|
|
97834
97834
|
}
|
|
97835
|
-
function convertQueuingStrategy(
|
|
97836
|
-
assertDictionary(
|
|
97837
|
-
const highWaterMark =
|
|
97838
|
-
const size =
|
|
97835
|
+
function convertQueuingStrategy(init2, context) {
|
|
97836
|
+
assertDictionary(init2, context);
|
|
97837
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
97838
|
+
const size = init2 === null || init2 === void 0 ? void 0 : init2.size;
|
|
97839
97839
|
return {
|
|
97840
97840
|
highWaterMark: highWaterMark === void 0 ? void 0 : convertUnrestrictedDouble(highWaterMark),
|
|
97841
97841
|
size: size === void 0 ? void 0 : convertQueuingStrategySize(size, `${context} has member 'size' that`)
|
|
@@ -99687,9 +99687,9 @@ var require_ponyfill_es20182 = __commonJS3({
|
|
|
99687
99687
|
function streamBrandCheckException$1(name) {
|
|
99688
99688
|
return new TypeError(`ReadableStream.prototype.${name} can only be used on a ReadableStream`);
|
|
99689
99689
|
}
|
|
99690
|
-
function convertQueuingStrategyInit(
|
|
99691
|
-
assertDictionary(
|
|
99692
|
-
const highWaterMark =
|
|
99690
|
+
function convertQueuingStrategyInit(init2, context) {
|
|
99691
|
+
assertDictionary(init2, context);
|
|
99692
|
+
const highWaterMark = init2 === null || init2 === void 0 ? void 0 : init2.highWaterMark;
|
|
99693
99693
|
assertRequiredField(highWaterMark, "highWaterMark", "QueuingStrategyInit");
|
|
99694
99694
|
return {
|
|
99695
99695
|
highWaterMark: convertUnrestrictedDouble(highWaterMark)
|
|
@@ -108857,10 +108857,10 @@ var require_generated22 = __commonJS3({
|
|
|
108857
108857
|
body
|
|
108858
108858
|
});
|
|
108859
108859
|
}
|
|
108860
|
-
function forStatement(
|
|
108860
|
+
function forStatement(init2 = null, test = null, update = null, body) {
|
|
108861
108861
|
return (0, _validateNode.default)({
|
|
108862
108862
|
type: "ForStatement",
|
|
108863
|
-
init,
|
|
108863
|
+
init: init2,
|
|
108864
108864
|
test,
|
|
108865
108865
|
update,
|
|
108866
108866
|
body
|
|
@@ -109078,11 +109078,11 @@ var require_generated22 = __commonJS3({
|
|
|
109078
109078
|
declarations
|
|
109079
109079
|
});
|
|
109080
109080
|
}
|
|
109081
|
-
function variableDeclarator(id,
|
|
109081
|
+
function variableDeclarator(id, init2 = null) {
|
|
109082
109082
|
return (0, _validateNode.default)({
|
|
109083
109083
|
type: "VariableDeclarator",
|
|
109084
109084
|
id,
|
|
109085
|
-
init
|
|
109085
|
+
init: init2
|
|
109086
109086
|
});
|
|
109087
109087
|
}
|
|
109088
109088
|
function whileStatement(test, body) {
|
|
@@ -109784,18 +109784,18 @@ var require_generated22 = __commonJS3({
|
|
|
109784
109784
|
init: null
|
|
109785
109785
|
});
|
|
109786
109786
|
}
|
|
109787
|
-
function enumNumberMember(id,
|
|
109787
|
+
function enumNumberMember(id, init2) {
|
|
109788
109788
|
return (0, _validateNode.default)({
|
|
109789
109789
|
type: "EnumNumberMember",
|
|
109790
109790
|
id,
|
|
109791
|
-
init
|
|
109791
|
+
init: init2
|
|
109792
109792
|
});
|
|
109793
109793
|
}
|
|
109794
|
-
function enumStringMember(id,
|
|
109794
|
+
function enumStringMember(id, init2) {
|
|
109795
109795
|
return (0, _validateNode.default)({
|
|
109796
109796
|
type: "EnumStringMember",
|
|
109797
109797
|
id,
|
|
109798
|
-
init
|
|
109798
|
+
init: init2
|
|
109799
109799
|
});
|
|
109800
109800
|
}
|
|
109801
109801
|
function enumDefaultedMember(id) {
|
|
@@ -121501,13 +121501,13 @@ var require_lib62 = __commonJS3({
|
|
|
121501
121501
|
flowEnumMemberRaw() {
|
|
121502
121502
|
const loc = this.state.startLoc;
|
|
121503
121503
|
const id = this.parseIdentifier(true);
|
|
121504
|
-
const
|
|
121504
|
+
const init2 = this.eat(29) ? this.flowEnumMemberInit() : {
|
|
121505
121505
|
type: "none",
|
|
121506
121506
|
loc
|
|
121507
121507
|
};
|
|
121508
121508
|
return {
|
|
121509
121509
|
id,
|
|
121510
|
-
init
|
|
121510
|
+
init: init2
|
|
121511
121511
|
};
|
|
121512
121512
|
}
|
|
121513
121513
|
flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) {
|
|
@@ -121541,7 +121541,7 @@ var require_lib62 = __commonJS3({
|
|
|
121541
121541
|
const memberNode = this.startNode();
|
|
121542
121542
|
const {
|
|
121543
121543
|
id,
|
|
121544
|
-
init
|
|
121544
|
+
init: init2
|
|
121545
121545
|
} = this.flowEnumMemberRaw();
|
|
121546
121546
|
const memberName = id.name;
|
|
121547
121547
|
if (memberName === "") {
|
|
@@ -121567,35 +121567,35 @@ var require_lib62 = __commonJS3({
|
|
|
121567
121567
|
memberName
|
|
121568
121568
|
};
|
|
121569
121569
|
memberNode.id = id;
|
|
121570
|
-
switch (
|
|
121570
|
+
switch (init2.type) {
|
|
121571
121571
|
case "boolean": {
|
|
121572
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
121573
|
-
memberNode.init =
|
|
121572
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "boolean");
|
|
121573
|
+
memberNode.init = init2.value;
|
|
121574
121574
|
members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
|
|
121575
121575
|
break;
|
|
121576
121576
|
}
|
|
121577
121577
|
case "number": {
|
|
121578
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
121579
|
-
memberNode.init =
|
|
121578
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "number");
|
|
121579
|
+
memberNode.init = init2.value;
|
|
121580
121580
|
members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
|
|
121581
121581
|
break;
|
|
121582
121582
|
}
|
|
121583
121583
|
case "string": {
|
|
121584
|
-
this.flowEnumCheckExplicitTypeMismatch(
|
|
121585
|
-
memberNode.init =
|
|
121584
|
+
this.flowEnumCheckExplicitTypeMismatch(init2.loc, context, "string");
|
|
121585
|
+
memberNode.init = init2.value;
|
|
121586
121586
|
members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
|
|
121587
121587
|
break;
|
|
121588
121588
|
}
|
|
121589
121589
|
case "invalid": {
|
|
121590
|
-
throw this.flowEnumErrorInvalidMemberInitializer(
|
|
121590
|
+
throw this.flowEnumErrorInvalidMemberInitializer(init2.loc, context);
|
|
121591
121591
|
}
|
|
121592
121592
|
case "none": {
|
|
121593
121593
|
switch (explicitType) {
|
|
121594
121594
|
case "boolean":
|
|
121595
|
-
this.flowEnumErrorBooleanMemberNotInitialized(
|
|
121595
|
+
this.flowEnumErrorBooleanMemberNotInitialized(init2.loc, context);
|
|
121596
121596
|
break;
|
|
121597
121597
|
case "number":
|
|
121598
|
-
this.flowEnumErrorNumberMemberNotInitialized(
|
|
121598
|
+
this.flowEnumErrorNumberMemberNotInitialized(init2.loc, context);
|
|
121599
121599
|
break;
|
|
121600
121600
|
default:
|
|
121601
121601
|
members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
|
|
@@ -124696,14 +124696,14 @@ var require_lib62 = __commonJS3({
|
|
|
124696
124696
|
return declaration;
|
|
124697
124697
|
for (const {
|
|
124698
124698
|
id,
|
|
124699
|
-
init
|
|
124699
|
+
init: init2
|
|
124700
124700
|
} of declaration.declarations) {
|
|
124701
|
-
if (!
|
|
124701
|
+
if (!init2)
|
|
124702
124702
|
continue;
|
|
124703
124703
|
if (kind !== "const" || !!id.typeAnnotation) {
|
|
124704
|
-
this.raise(TSErrors.InitializerNotAllowedInAmbientContext,
|
|
124705
|
-
} else if (!isValidAmbientConstInitializer(
|
|
124706
|
-
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference,
|
|
124704
|
+
this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init2);
|
|
124705
|
+
} else if (!isValidAmbientConstInitializer(init2, this.hasPlugin("estree"))) {
|
|
124706
|
+
this.raise(TSErrors.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference, init2);
|
|
124707
124707
|
}
|
|
124708
124708
|
}
|
|
124709
124709
|
return declaration;
|
|
@@ -128183,49 +128183,49 @@ var require_lib62 = __commonJS3({
|
|
|
128183
128183
|
}
|
|
128184
128184
|
this.next();
|
|
128185
128185
|
this.parseVar(initNode, true, kind);
|
|
128186
|
-
const
|
|
128186
|
+
const init3 = this.finishNode(initNode, "VariableDeclaration");
|
|
128187
128187
|
const isForIn = this.match(58);
|
|
128188
128188
|
if (isForIn && starsWithUsingDeclaration) {
|
|
128189
|
-
this.raise(Errors.ForInUsing,
|
|
128189
|
+
this.raise(Errors.ForInUsing, init3);
|
|
128190
128190
|
}
|
|
128191
|
-
if ((isForIn || this.isContextual(102)) &&
|
|
128192
|
-
return this.parseForIn(node,
|
|
128191
|
+
if ((isForIn || this.isContextual(102)) && init3.declarations.length === 1) {
|
|
128192
|
+
return this.parseForIn(node, init3, awaitAt);
|
|
128193
128193
|
}
|
|
128194
128194
|
if (awaitAt !== null) {
|
|
128195
128195
|
this.unexpected(awaitAt);
|
|
128196
128196
|
}
|
|
128197
|
-
return this.parseFor(node,
|
|
128197
|
+
return this.parseFor(node, init3);
|
|
128198
128198
|
}
|
|
128199
128199
|
}
|
|
128200
128200
|
const startsWithAsync = this.isContextual(95);
|
|
128201
128201
|
const refExpressionErrors = new ExpressionErrors();
|
|
128202
|
-
const
|
|
128202
|
+
const init2 = this.parseExpression(true, refExpressionErrors);
|
|
128203
128203
|
const isForOf = this.isContextual(102);
|
|
128204
128204
|
if (isForOf) {
|
|
128205
128205
|
if (startsWithLet) {
|
|
128206
|
-
this.raise(Errors.ForOfLet,
|
|
128206
|
+
this.raise(Errors.ForOfLet, init2);
|
|
128207
128207
|
}
|
|
128208
|
-
if (awaitAt === null && startsWithAsync &&
|
|
128209
|
-
this.raise(Errors.ForOfAsync,
|
|
128208
|
+
if (awaitAt === null && startsWithAsync && init2.type === "Identifier") {
|
|
128209
|
+
this.raise(Errors.ForOfAsync, init2);
|
|
128210
128210
|
}
|
|
128211
128211
|
}
|
|
128212
128212
|
if (isForOf || this.match(58)) {
|
|
128213
128213
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
128214
|
-
this.toAssignable(
|
|
128214
|
+
this.toAssignable(init2, true);
|
|
128215
128215
|
const type = isForOf ? "ForOfStatement" : "ForInStatement";
|
|
128216
|
-
this.checkLVal(
|
|
128216
|
+
this.checkLVal(init2, {
|
|
128217
128217
|
in: {
|
|
128218
128218
|
type
|
|
128219
128219
|
}
|
|
128220
128220
|
});
|
|
128221
|
-
return this.parseForIn(node,
|
|
128221
|
+
return this.parseForIn(node, init2, awaitAt);
|
|
128222
128222
|
} else {
|
|
128223
128223
|
this.checkExpressionErrors(refExpressionErrors, true);
|
|
128224
128224
|
}
|
|
128225
128225
|
if (awaitAt !== null) {
|
|
128226
128226
|
this.unexpected(awaitAt);
|
|
128227
128227
|
}
|
|
128228
|
-
return this.parseFor(node,
|
|
128228
|
+
return this.parseFor(node, init2);
|
|
128229
128229
|
}
|
|
128230
128230
|
parseFunctionStatement(node, isAsync, isHangingDeclaration) {
|
|
128231
128231
|
this.next();
|
|
@@ -128447,8 +128447,8 @@ var require_lib62 = __commonJS3({
|
|
|
128447
128447
|
}
|
|
128448
128448
|
this.next();
|
|
128449
128449
|
}
|
|
128450
|
-
parseFor(node,
|
|
128451
|
-
node.init =
|
|
128450
|
+
parseFor(node, init2) {
|
|
128451
|
+
node.init = init2;
|
|
128452
128452
|
this.semicolon(false);
|
|
128453
128453
|
node.test = this.match(13) ? null : this.parseExpression();
|
|
128454
128454
|
this.semicolon(false);
|
|
@@ -128459,7 +128459,7 @@ var require_lib62 = __commonJS3({
|
|
|
128459
128459
|
this.state.labels.pop();
|
|
128460
128460
|
return this.finishNode(node, "ForStatement");
|
|
128461
128461
|
}
|
|
128462
|
-
parseForIn(node,
|
|
128462
|
+
parseForIn(node, init2, awaitAt) {
|
|
128463
128463
|
const isForIn = this.match(58);
|
|
128464
128464
|
this.next();
|
|
128465
128465
|
if (isForIn) {
|
|
@@ -128468,19 +128468,19 @@ var require_lib62 = __commonJS3({
|
|
|
128468
128468
|
} else {
|
|
128469
128469
|
node.await = awaitAt !== null;
|
|
128470
128470
|
}
|
|
128471
|
-
if (
|
|
128472
|
-
this.raise(Errors.ForInOfLoopInitializer,
|
|
128471
|
+
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")) {
|
|
128472
|
+
this.raise(Errors.ForInOfLoopInitializer, init2, {
|
|
128473
128473
|
type: isForIn ? "ForInStatement" : "ForOfStatement"
|
|
128474
128474
|
});
|
|
128475
128475
|
}
|
|
128476
|
-
if (
|
|
128477
|
-
this.raise(Errors.InvalidLhs,
|
|
128476
|
+
if (init2.type === "AssignmentPattern") {
|
|
128477
|
+
this.raise(Errors.InvalidLhs, init2, {
|
|
128478
128478
|
ancestor: {
|
|
128479
128479
|
type: "ForStatement"
|
|
128480
128480
|
}
|
|
128481
128481
|
});
|
|
128482
128482
|
}
|
|
128483
|
-
node.left =
|
|
128483
|
+
node.left = init2;
|
|
128484
128484
|
node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn();
|
|
128485
128485
|
this.expect(11);
|
|
128486
128486
|
node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement());
|
|
@@ -130424,11 +130424,11 @@ var require_types3 = __commonJS3({
|
|
|
130424
130424
|
}();
|
|
130425
130425
|
exports.Def = Def;
|
|
130426
130426
|
var Field = function() {
|
|
130427
|
-
function Field2(name, type, defaultFn,
|
|
130427
|
+
function Field2(name, type, defaultFn, hidden7) {
|
|
130428
130428
|
this.name = name;
|
|
130429
130429
|
this.type = type;
|
|
130430
130430
|
this.defaultFn = defaultFn;
|
|
130431
|
-
this.hidden = !!
|
|
130431
|
+
this.hidden = !!hidden7;
|
|
130432
130432
|
}
|
|
130433
130433
|
Field2.prototype.toString = function() {
|
|
130434
130434
|
return JSON.stringify(this.name) + ": " + this.type;
|
|
@@ -130677,12 +130677,12 @@ var require_types3 = __commonJS3({
|
|
|
130677
130677
|
});
|
|
130678
130678
|
return this;
|
|
130679
130679
|
};
|
|
130680
|
-
DefImpl2.prototype.field = function(name, type, defaultFn,
|
|
130680
|
+
DefImpl2.prototype.field = function(name, type, defaultFn, hidden7) {
|
|
130681
130681
|
if (this.finalized) {
|
|
130682
130682
|
console.error("Ignoring attempt to redefine field " + JSON.stringify(name) + " of finalized type " + JSON.stringify(this.typeName));
|
|
130683
130683
|
return this;
|
|
130684
130684
|
}
|
|
130685
|
-
this.ownFields[name] = new Field(name, Type.from(type), defaultFn,
|
|
130685
|
+
this.ownFields[name] = new Field(name, Type.from(type), defaultFn, hidden7);
|
|
130686
130686
|
return this;
|
|
130687
130687
|
};
|
|
130688
130688
|
DefImpl2.prototype.finalize = function() {
|
|
@@ -131279,13 +131279,13 @@ var require_scope3 = __commonJS3({
|
|
|
131279
131279
|
var name = prefix + index;
|
|
131280
131280
|
return this.bindings[name] = types19.builders.identifier(name);
|
|
131281
131281
|
};
|
|
131282
|
-
Sp.injectTemporary = function(identifier,
|
|
131282
|
+
Sp.injectTemporary = function(identifier, init2) {
|
|
131283
131283
|
identifier || (identifier = this.declareTemporary());
|
|
131284
131284
|
var bodyPath = this.path.get("body");
|
|
131285
131285
|
if (namedTypes.BlockStatement.check(bodyPath.value)) {
|
|
131286
131286
|
bodyPath = bodyPath.get("body");
|
|
131287
131287
|
}
|
|
131288
|
-
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier,
|
|
131288
|
+
bodyPath.unshift(b.variableDeclaration("var", [b.variableDeclarator(identifier, init2 || null)]));
|
|
131289
131289
|
return identifier;
|
|
131290
131290
|
};
|
|
131291
131291
|
Sp.scan = function(force) {
|
|
@@ -132054,7 +132054,7 @@ var require_path_visitor3 = __commonJS3({
|
|
|
132054
132054
|
return Context;
|
|
132055
132055
|
}
|
|
132056
132056
|
var sharedContextProtoMethods = /* @__PURE__ */ Object.create(null);
|
|
132057
|
-
sharedContextProtoMethods.reset = function
|
|
132057
|
+
sharedContextProtoMethods.reset = function reset7(path42) {
|
|
132058
132058
|
if (!(this instanceof this.Context)) {
|
|
132059
132059
|
throw new Error("");
|
|
132060
132060
|
}
|
|
@@ -136765,9 +136765,9 @@ var require_esprima22 = __commonJS3({
|
|
|
136765
136765
|
}();
|
|
136766
136766
|
exports2.ForOfStatement = ForOfStatement;
|
|
136767
136767
|
var ForStatement = function() {
|
|
136768
|
-
function ForStatement2(
|
|
136768
|
+
function ForStatement2(init2, test, update, body) {
|
|
136769
136769
|
this.type = syntax_1.Syntax.ForStatement;
|
|
136770
|
-
this.init =
|
|
136770
|
+
this.init = init2;
|
|
136771
136771
|
this.test = test;
|
|
136772
136772
|
this.update = update;
|
|
136773
136773
|
this.body = body;
|
|
@@ -137107,10 +137107,10 @@ var require_esprima22 = __commonJS3({
|
|
|
137107
137107
|
}();
|
|
137108
137108
|
exports2.VariableDeclaration = VariableDeclaration;
|
|
137109
137109
|
var VariableDeclarator = function() {
|
|
137110
|
-
function VariableDeclarator2(id,
|
|
137110
|
+
function VariableDeclarator2(id, init2) {
|
|
137111
137111
|
this.type = syntax_1.Syntax.VariableDeclarator;
|
|
137112
137112
|
this.id = id;
|
|
137113
|
-
this.init =
|
|
137113
|
+
this.init = init2;
|
|
137114
137114
|
}
|
|
137115
137115
|
return VariableDeclarator2;
|
|
137116
137116
|
}();
|
|
@@ -137815,8 +137815,8 @@ var require_esprima22 = __commonJS3({
|
|
|
137815
137815
|
this.context.firstCoverInitializedNameError = this.lookahead;
|
|
137816
137816
|
this.nextToken();
|
|
137817
137817
|
shorthand = true;
|
|
137818
|
-
var
|
|
137819
|
-
value = this.finalize(node, new Node.AssignmentPattern(id,
|
|
137818
|
+
var init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
137819
|
+
value = this.finalize(node, new Node.AssignmentPattern(id, init2));
|
|
137820
137820
|
} else {
|
|
137821
137821
|
shorthand = true;
|
|
137822
137822
|
value = id;
|
|
@@ -138594,21 +138594,21 @@ var require_esprima22 = __commonJS3({
|
|
|
138594
138594
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
138595
138595
|
}
|
|
138596
138596
|
}
|
|
138597
|
-
var
|
|
138597
|
+
var init2 = null;
|
|
138598
138598
|
if (kind === "const") {
|
|
138599
138599
|
if (!this.matchKeyword("in") && !this.matchContextualKeyword("of")) {
|
|
138600
138600
|
if (this.match("=")) {
|
|
138601
138601
|
this.nextToken();
|
|
138602
|
-
|
|
138602
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
138603
138603
|
} else {
|
|
138604
138604
|
this.throwError(messages_1.Messages.DeclarationMissingInitializer, "const");
|
|
138605
138605
|
}
|
|
138606
138606
|
}
|
|
138607
138607
|
} else if (!options.inFor && id.type !== syntax_1.Syntax.Identifier || this.match("=")) {
|
|
138608
138608
|
this.expect("=");
|
|
138609
|
-
|
|
138609
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
138610
138610
|
}
|
|
138611
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
138611
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
138612
138612
|
};
|
|
138613
138613
|
Parser2.prototype.parseBindingList = function(kind, options) {
|
|
138614
138614
|
var list = [this.parseLexicalBinding(kind, options)];
|
|
@@ -138672,17 +138672,17 @@ var require_esprima22 = __commonJS3({
|
|
|
138672
138672
|
if (this.lookahead.type === 3) {
|
|
138673
138673
|
var keyToken = this.lookahead;
|
|
138674
138674
|
key = this.parseVariableIdentifier();
|
|
138675
|
-
var
|
|
138675
|
+
var init2 = this.finalize(node, new Node.Identifier(keyToken.value));
|
|
138676
138676
|
if (this.match("=")) {
|
|
138677
138677
|
params.push(keyToken);
|
|
138678
138678
|
shorthand = true;
|
|
138679
138679
|
this.nextToken();
|
|
138680
138680
|
var expr = this.parseAssignmentExpression();
|
|
138681
|
-
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(
|
|
138681
|
+
value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init2, expr));
|
|
138682
138682
|
} else if (!this.match(":")) {
|
|
138683
138683
|
params.push(keyToken);
|
|
138684
138684
|
shorthand = true;
|
|
138685
|
-
value =
|
|
138685
|
+
value = init2;
|
|
138686
138686
|
} else {
|
|
138687
138687
|
this.expect(":");
|
|
138688
138688
|
value = this.parsePatternWithDefault(params, kind);
|
|
@@ -138767,14 +138767,14 @@ var require_esprima22 = __commonJS3({
|
|
|
138767
138767
|
this.tolerateError(messages_1.Messages.StrictVarName);
|
|
138768
138768
|
}
|
|
138769
138769
|
}
|
|
138770
|
-
var
|
|
138770
|
+
var init2 = null;
|
|
138771
138771
|
if (this.match("=")) {
|
|
138772
138772
|
this.nextToken();
|
|
138773
|
-
|
|
138773
|
+
init2 = this.isolateCoverGrammar(this.parseAssignmentExpression);
|
|
138774
138774
|
} else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
|
|
138775
138775
|
this.expect("=");
|
|
138776
138776
|
}
|
|
138777
|
-
return this.finalize(node, new Node.VariableDeclarator(id,
|
|
138777
|
+
return this.finalize(node, new Node.VariableDeclarator(id, init2));
|
|
138778
138778
|
};
|
|
138779
138779
|
Parser2.prototype.parseVariableDeclarationList = function(options) {
|
|
138780
138780
|
var opt = { inFor: options.inFor };
|
|
@@ -138869,7 +138869,7 @@ var require_esprima22 = __commonJS3({
|
|
|
138869
138869
|
return this.finalize(node, new Node.WhileStatement(test, body));
|
|
138870
138870
|
};
|
|
138871
138871
|
Parser2.prototype.parseForStatement = function() {
|
|
138872
|
-
var
|
|
138872
|
+
var init2 = null;
|
|
138873
138873
|
var test = null;
|
|
138874
138874
|
var update = null;
|
|
138875
138875
|
var forIn = true;
|
|
@@ -138881,7 +138881,7 @@ var require_esprima22 = __commonJS3({
|
|
|
138881
138881
|
this.nextToken();
|
|
138882
138882
|
} else {
|
|
138883
138883
|
if (this.matchKeyword("var")) {
|
|
138884
|
-
|
|
138884
|
+
init2 = this.createNode();
|
|
138885
138885
|
this.nextToken();
|
|
138886
138886
|
var previousAllowIn = this.context.allowIn;
|
|
138887
138887
|
this.context.allowIn = false;
|
|
@@ -138892,87 +138892,87 @@ var require_esprima22 = __commonJS3({
|
|
|
138892
138892
|
if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
|
|
138893
138893
|
this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, "for-in");
|
|
138894
138894
|
}
|
|
138895
|
-
|
|
138895
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
138896
138896
|
this.nextToken();
|
|
138897
|
-
left =
|
|
138897
|
+
left = init2;
|
|
138898
138898
|
right = this.parseExpression();
|
|
138899
|
-
|
|
138899
|
+
init2 = null;
|
|
138900
138900
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
138901
|
-
|
|
138901
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
138902
138902
|
this.nextToken();
|
|
138903
|
-
left =
|
|
138903
|
+
left = init2;
|
|
138904
138904
|
right = this.parseAssignmentExpression();
|
|
138905
|
-
|
|
138905
|
+
init2 = null;
|
|
138906
138906
|
forIn = false;
|
|
138907
138907
|
} else {
|
|
138908
|
-
|
|
138908
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, "var"));
|
|
138909
138909
|
this.expect(";");
|
|
138910
138910
|
}
|
|
138911
138911
|
} else if (this.matchKeyword("const") || this.matchKeyword("let")) {
|
|
138912
|
-
|
|
138912
|
+
init2 = this.createNode();
|
|
138913
138913
|
var kind = this.nextToken().value;
|
|
138914
138914
|
if (!this.context.strict && this.lookahead.value === "in") {
|
|
138915
|
-
|
|
138915
|
+
init2 = this.finalize(init2, new Node.Identifier(kind));
|
|
138916
138916
|
this.nextToken();
|
|
138917
|
-
left =
|
|
138917
|
+
left = init2;
|
|
138918
138918
|
right = this.parseExpression();
|
|
138919
|
-
|
|
138919
|
+
init2 = null;
|
|
138920
138920
|
} else {
|
|
138921
138921
|
var previousAllowIn = this.context.allowIn;
|
|
138922
138922
|
this.context.allowIn = false;
|
|
138923
138923
|
var declarations = this.parseBindingList(kind, { inFor: true });
|
|
138924
138924
|
this.context.allowIn = previousAllowIn;
|
|
138925
138925
|
if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword("in")) {
|
|
138926
|
-
|
|
138926
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
138927
138927
|
this.nextToken();
|
|
138928
|
-
left =
|
|
138928
|
+
left = init2;
|
|
138929
138929
|
right = this.parseExpression();
|
|
138930
|
-
|
|
138930
|
+
init2 = null;
|
|
138931
138931
|
} else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword("of")) {
|
|
138932
|
-
|
|
138932
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
138933
138933
|
this.nextToken();
|
|
138934
|
-
left =
|
|
138934
|
+
left = init2;
|
|
138935
138935
|
right = this.parseAssignmentExpression();
|
|
138936
|
-
|
|
138936
|
+
init2 = null;
|
|
138937
138937
|
forIn = false;
|
|
138938
138938
|
} else {
|
|
138939
138939
|
this.consumeSemicolon();
|
|
138940
|
-
|
|
138940
|
+
init2 = this.finalize(init2, new Node.VariableDeclaration(declarations, kind));
|
|
138941
138941
|
}
|
|
138942
138942
|
}
|
|
138943
138943
|
} else {
|
|
138944
138944
|
var initStartToken = this.lookahead;
|
|
138945
138945
|
var previousAllowIn = this.context.allowIn;
|
|
138946
138946
|
this.context.allowIn = false;
|
|
138947
|
-
|
|
138947
|
+
init2 = this.inheritCoverGrammar(this.parseAssignmentExpression);
|
|
138948
138948
|
this.context.allowIn = previousAllowIn;
|
|
138949
138949
|
if (this.matchKeyword("in")) {
|
|
138950
|
-
if (!this.context.isAssignmentTarget ||
|
|
138950
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
138951
138951
|
this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
|
|
138952
138952
|
}
|
|
138953
138953
|
this.nextToken();
|
|
138954
|
-
this.reinterpretExpressionAsPattern(
|
|
138955
|
-
left =
|
|
138954
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
138955
|
+
left = init2;
|
|
138956
138956
|
right = this.parseExpression();
|
|
138957
|
-
|
|
138957
|
+
init2 = null;
|
|
138958
138958
|
} else if (this.matchContextualKeyword("of")) {
|
|
138959
|
-
if (!this.context.isAssignmentTarget ||
|
|
138959
|
+
if (!this.context.isAssignmentTarget || init2.type === syntax_1.Syntax.AssignmentExpression) {
|
|
138960
138960
|
this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
|
|
138961
138961
|
}
|
|
138962
138962
|
this.nextToken();
|
|
138963
|
-
this.reinterpretExpressionAsPattern(
|
|
138964
|
-
left =
|
|
138963
|
+
this.reinterpretExpressionAsPattern(init2);
|
|
138964
|
+
left = init2;
|
|
138965
138965
|
right = this.parseAssignmentExpression();
|
|
138966
|
-
|
|
138966
|
+
init2 = null;
|
|
138967
138967
|
forIn = false;
|
|
138968
138968
|
} else {
|
|
138969
138969
|
if (this.match(",")) {
|
|
138970
|
-
var initSeq = [
|
|
138970
|
+
var initSeq = [init2];
|
|
138971
138971
|
while (this.match(",")) {
|
|
138972
138972
|
this.nextToken();
|
|
138973
138973
|
initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
|
|
138974
138974
|
}
|
|
138975
|
-
|
|
138975
|
+
init2 = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
|
|
138976
138976
|
}
|
|
138977
138977
|
this.expect(";");
|
|
138978
138978
|
}
|
|
@@ -138998,7 +138998,7 @@ var require_esprima22 = __commonJS3({
|
|
|
138998
138998
|
body = this.isolateCoverGrammar(this.parseStatement);
|
|
138999
138999
|
this.context.inIteration = previousInIteration;
|
|
139000
139000
|
}
|
|
139001
|
-
return typeof left === "undefined" ? this.finalize(node, new Node.ForStatement(
|
|
139001
|
+
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));
|
|
139002
139002
|
};
|
|
139003
139003
|
Parser2.prototype.parseContinueStatement = function() {
|
|
139004
139004
|
var node = this.createNode();
|
|
@@ -144371,10 +144371,10 @@ var require_printer3 = __commonJS3({
|
|
|
144371
144371
|
return (0, lines_1.concat)(parts);
|
|
144372
144372
|
}
|
|
144373
144373
|
case "ForStatement": {
|
|
144374
|
-
var
|
|
144375
|
-
var sep32 =
|
|
144374
|
+
var init2 = path42.call(print13, "init");
|
|
144375
|
+
var sep32 = init2.length > 1 ? ";\n" : "; ";
|
|
144376
144376
|
var forParen = "for (";
|
|
144377
|
-
var indented = (0, lines_1.fromString)(sep32).join([
|
|
144377
|
+
var indented = (0, lines_1.fromString)(sep32).join([init2, path42.call(print13, "test"), path42.call(print13, "update")]).indentTail(forParen.length);
|
|
144378
144378
|
var head = (0, lines_1.concat)([forParen, indented, ")"]);
|
|
144379
144379
|
var clause = adjustClause(path42.call(print13, "body"), options);
|
|
144380
144380
|
parts.push(head);
|
|
@@ -152582,23 +152582,23 @@ var validateHeaderValue2 = typeof http3.validateHeaderValue === "function" ? htt
|
|
|
152582
152582
|
}
|
|
152583
152583
|
};
|
|
152584
152584
|
var Headers2 = class extends URLSearchParams {
|
|
152585
|
-
constructor(
|
|
152585
|
+
constructor(init2) {
|
|
152586
152586
|
let result = [];
|
|
152587
|
-
if (
|
|
152588
|
-
const raw =
|
|
152587
|
+
if (init2 instanceof Headers2) {
|
|
152588
|
+
const raw = init2.raw();
|
|
152589
152589
|
for (const [name, values] of Object.entries(raw)) {
|
|
152590
152590
|
result.push(...values.map((value) => [name, value]));
|
|
152591
152591
|
}
|
|
152592
|
-
} else if (
|
|
152593
|
-
} else if (typeof
|
|
152594
|
-
const method =
|
|
152592
|
+
} else if (init2 == null) {
|
|
152593
|
+
} else if (typeof init2 === "object" && !types32.isBoxedPrimitive(init2)) {
|
|
152594
|
+
const method = init2[Symbol.iterator];
|
|
152595
152595
|
if (method == null) {
|
|
152596
|
-
result.push(...Object.entries(
|
|
152596
|
+
result.push(...Object.entries(init2));
|
|
152597
152597
|
} else {
|
|
152598
152598
|
if (typeof method !== "function") {
|
|
152599
152599
|
throw new TypeError("Header pairs must be iterable");
|
|
152600
152600
|
}
|
|
152601
|
-
result = [...
|
|
152601
|
+
result = [...init2].map((pair) => {
|
|
152602
152602
|
if (typeof pair !== "object" || types32.isBoxedPrimitive(pair)) {
|
|
152603
152603
|
throw new TypeError("Each header pair must be an iterable object");
|
|
152604
152604
|
}
|
|
@@ -152793,17 +152793,17 @@ var Response22 = class extends Body2 {
|
|
|
152793
152793
|
response[INTERNALS22].type = "error";
|
|
152794
152794
|
return response;
|
|
152795
152795
|
}
|
|
152796
|
-
static json(data = void 0,
|
|
152796
|
+
static json(data = void 0, init2 = {}) {
|
|
152797
152797
|
const body = JSON.stringify(data);
|
|
152798
152798
|
if (body === void 0) {
|
|
152799
152799
|
throw new TypeError("data is not JSON serializable");
|
|
152800
152800
|
}
|
|
152801
|
-
const headers = new Headers2(
|
|
152801
|
+
const headers = new Headers2(init2 && init2.headers);
|
|
152802
152802
|
if (!headers.has("content-type")) {
|
|
152803
152803
|
headers.set("content-type", "application/json");
|
|
152804
152804
|
}
|
|
152805
152805
|
return new Response22(body, {
|
|
152806
|
-
...
|
|
152806
|
+
...init2,
|
|
152807
152807
|
headers
|
|
152808
152808
|
});
|
|
152809
152809
|
}
|
|
@@ -152849,7 +152849,7 @@ var doBadDataWarn2 = deprecate22(
|
|
|
152849
152849
|
"https://github.com/node-fetch/node-fetch/issues/1000 (request)"
|
|
152850
152850
|
);
|
|
152851
152851
|
var Request22 = class extends Body2 {
|
|
152852
|
-
constructor(input,
|
|
152852
|
+
constructor(input, init2 = {}) {
|
|
152853
152853
|
let parsedURL;
|
|
152854
152854
|
if (isRequest2(input)) {
|
|
152855
152855
|
parsedURL = new URL(input.url);
|
|
@@ -152860,21 +152860,21 @@ var Request22 = class extends Body2 {
|
|
|
152860
152860
|
if (parsedURL.username !== "" || parsedURL.password !== "") {
|
|
152861
152861
|
throw new TypeError(`${parsedURL} is an url with embedded credentials.`);
|
|
152862
152862
|
}
|
|
152863
|
-
let method =
|
|
152863
|
+
let method = init2.method || input.method || "GET";
|
|
152864
152864
|
if (/^(delete|get|head|options|post|put)$/i.test(method)) {
|
|
152865
152865
|
method = method.toUpperCase();
|
|
152866
152866
|
}
|
|
152867
|
-
if (!isRequest2(
|
|
152867
|
+
if (!isRequest2(init2) && "data" in init2) {
|
|
152868
152868
|
doBadDataWarn2();
|
|
152869
152869
|
}
|
|
152870
|
-
if ((
|
|
152870
|
+
if ((init2.body != null || isRequest2(input) && input.body !== null) && (method === "GET" || method === "HEAD")) {
|
|
152871
152871
|
throw new TypeError("Request with GET/HEAD method cannot have body");
|
|
152872
152872
|
}
|
|
152873
|
-
const inputBody =
|
|
152873
|
+
const inputBody = init2.body ? init2.body : isRequest2(input) && input.body !== null ? clone2(input) : null;
|
|
152874
152874
|
super(inputBody, {
|
|
152875
|
-
size:
|
|
152875
|
+
size: init2.size || input.size || 0
|
|
152876
152876
|
});
|
|
152877
|
-
const headers = new Headers2(
|
|
152877
|
+
const headers = new Headers2(init2.headers || input.headers || {});
|
|
152878
152878
|
if (inputBody !== null && !headers.has("Content-Type")) {
|
|
152879
152879
|
const contentType = extractContentType2(inputBody, this);
|
|
152880
152880
|
if (contentType) {
|
|
@@ -152882,13 +152882,13 @@ var Request22 = class extends Body2 {
|
|
|
152882
152882
|
}
|
|
152883
152883
|
}
|
|
152884
152884
|
let signal = isRequest2(input) ? input.signal : null;
|
|
152885
|
-
if ("signal" in
|
|
152886
|
-
signal =
|
|
152885
|
+
if ("signal" in init2) {
|
|
152886
|
+
signal = init2.signal;
|
|
152887
152887
|
}
|
|
152888
152888
|
if (signal != null && !isAbortSignal2(signal)) {
|
|
152889
152889
|
throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");
|
|
152890
152890
|
}
|
|
152891
|
-
let referrer =
|
|
152891
|
+
let referrer = init2.referrer == null ? input.referrer : init2.referrer;
|
|
152892
152892
|
if (referrer === "") {
|
|
152893
152893
|
referrer = "no-referrer";
|
|
152894
152894
|
} else if (referrer) {
|
|
@@ -152899,19 +152899,19 @@ var Request22 = class extends Body2 {
|
|
|
152899
152899
|
}
|
|
152900
152900
|
this[INTERNALS32] = {
|
|
152901
152901
|
method,
|
|
152902
|
-
redirect:
|
|
152902
|
+
redirect: init2.redirect || input.redirect || "follow",
|
|
152903
152903
|
headers,
|
|
152904
152904
|
parsedURL,
|
|
152905
152905
|
signal,
|
|
152906
152906
|
referrer
|
|
152907
152907
|
};
|
|
152908
|
-
this.follow =
|
|
152909
|
-
this.compress =
|
|
152910
|
-
this.counter =
|
|
152911
|
-
this.agent =
|
|
152912
|
-
this.highWaterMark =
|
|
152913
|
-
this.insecureHTTPParser =
|
|
152914
|
-
this.referrerPolicy =
|
|
152908
|
+
this.follow = init2.follow === void 0 ? input.follow === void 0 ? 20 : input.follow : init2.follow;
|
|
152909
|
+
this.compress = init2.compress === void 0 ? input.compress === void 0 ? true : input.compress : init2.compress;
|
|
152910
|
+
this.counter = init2.counter || input.counter || 0;
|
|
152911
|
+
this.agent = init2.agent || input.agent;
|
|
152912
|
+
this.highWaterMark = init2.highWaterMark || input.highWaterMark || 16384;
|
|
152913
|
+
this.insecureHTTPParser = init2.insecureHTTPParser || input.insecureHTTPParser || false;
|
|
152914
|
+
this.referrerPolicy = init2.referrerPolicy || input.referrerPolicy || "";
|
|
152915
152915
|
}
|
|
152916
152916
|
get method() {
|
|
152917
152917
|
return this[INTERNALS32].method;
|
|
@@ -155778,6 +155778,53 @@ For more information, please visit these links:
|
|
|
155778
155778
|
- https://graphql.org/learn/global-object-identification/
|
|
155779
155779
|
- ${siteURL}/guides/caching-data#custom-ids
|
|
155780
155780
|
`;
|
|
155781
|
+
var FORCE_COLOR;
|
|
155782
|
+
var NODE_DISABLE_COLORS;
|
|
155783
|
+
var NO_COLOR;
|
|
155784
|
+
var TERM;
|
|
155785
|
+
var isTTY = true;
|
|
155786
|
+
if (typeof process !== "undefined") {
|
|
155787
|
+
({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {});
|
|
155788
|
+
isTTY = process.stdout && process.stdout.isTTY;
|
|
155789
|
+
}
|
|
155790
|
+
var $ = {
|
|
155791
|
+
enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY)
|
|
155792
|
+
};
|
|
155793
|
+
function init(x22, y) {
|
|
155794
|
+
let rgx = new RegExp(`\\x1b\\[${y}m`, "g");
|
|
155795
|
+
let open = `\x1B[${x22}m`, close = `\x1B[${y}m`;
|
|
155796
|
+
return function(txt) {
|
|
155797
|
+
if (!$.enabled || txt == null)
|
|
155798
|
+
return txt;
|
|
155799
|
+
return open + (!!~("" + txt).indexOf(close) ? txt.replace(rgx, close + open) : txt) + close;
|
|
155800
|
+
};
|
|
155801
|
+
}
|
|
155802
|
+
var reset6 = init(0, 0);
|
|
155803
|
+
var bold6 = init(1, 22);
|
|
155804
|
+
var dim6 = init(2, 22);
|
|
155805
|
+
var italic6 = init(3, 23);
|
|
155806
|
+
var underline6 = init(4, 24);
|
|
155807
|
+
var inverse6 = init(7, 27);
|
|
155808
|
+
var hidden6 = init(8, 28);
|
|
155809
|
+
var strikethrough6 = init(9, 29);
|
|
155810
|
+
var black6 = init(30, 39);
|
|
155811
|
+
var red6 = init(31, 39);
|
|
155812
|
+
var green6 = init(32, 39);
|
|
155813
|
+
var yellow6 = init(33, 39);
|
|
155814
|
+
var blue6 = init(34, 39);
|
|
155815
|
+
var magenta6 = init(35, 39);
|
|
155816
|
+
var cyan6 = init(36, 39);
|
|
155817
|
+
var white6 = init(37, 39);
|
|
155818
|
+
var gray6 = init(90, 39);
|
|
155819
|
+
var grey = init(90, 39);
|
|
155820
|
+
var bgBlack6 = init(40, 49);
|
|
155821
|
+
var bgRed6 = init(41, 49);
|
|
155822
|
+
var bgGreen6 = init(42, 49);
|
|
155823
|
+
var bgYellow6 = init(43, 49);
|
|
155824
|
+
var bgBlue6 = init(44, 49);
|
|
155825
|
+
var bgMagenta6 = init(45, 49);
|
|
155826
|
+
var bgCyan6 = init(46, 49);
|
|
155827
|
+
var bgWhite6 = init(47, 49);
|
|
155781
155828
|
var recast14 = __toESM3(require_main22(), 1);
|
|
155782
155829
|
var AST15 = recast14.types.builders;
|
|
155783
155830
|
function find_insert_index(script) {
|
|
@@ -155806,21 +155853,21 @@ function find_exported_fn(body, name) {
|
|
|
155806
155853
|
continue;
|
|
155807
155854
|
}
|
|
155808
155855
|
const declaration = value.declarations[0];
|
|
155809
|
-
let { init } = declaration;
|
|
155810
|
-
if (!
|
|
155856
|
+
let { init: init2 } = declaration;
|
|
155857
|
+
if (!init2) {
|
|
155811
155858
|
continue;
|
|
155812
155859
|
}
|
|
155813
|
-
if (
|
|
155814
|
-
|
|
155860
|
+
if (init2.type === "TSSatisfiesExpression") {
|
|
155861
|
+
init2 = init2.expression;
|
|
155815
155862
|
}
|
|
155816
|
-
if (
|
|
155817
|
-
|
|
155863
|
+
if (init2.type === "CallExpression" && init2.arguments[0] && (init2.arguments[0].type === "FunctionExpression" || init2.arguments[0].type === "ArrowFunctionExpression")) {
|
|
155864
|
+
init2 = init2.arguments[0];
|
|
155818
155865
|
}
|
|
155819
|
-
if (
|
|
155820
|
-
return { declaration:
|
|
155866
|
+
if (init2.type === "FunctionExpression" || init2.type === "ArrowFunctionExpression") {
|
|
155867
|
+
return { declaration: init2, export: exportDeclaration };
|
|
155821
155868
|
}
|
|
155822
|
-
if (
|
|
155823
|
-
return { declaration:
|
|
155869
|
+
if (init2.type === "Identifier" || init2.type === "CallExpression") {
|
|
155870
|
+
return { declaration: init2, export: exportDeclaration };
|
|
155824
155871
|
}
|
|
155825
155872
|
} else {
|
|
155826
155873
|
continue;
|