typescript 5.4.0-dev.20231103 → 5.4.0-dev.20231104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es2016.d.ts +1 -0
- package/lib/lib.es2016.intl.d.ts +31 -0
- package/lib/tsc.js +235 -72
- package/lib/tsserver.js +244 -78
- package/lib/typescript.js +253 -89
- package/lib/typingsInstaller.js +3 -1
- package/package.json +2 -2
package/lib/lib.es2016.d.ts
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/// <reference no-default-lib="true"/>
|
|
18
|
+
|
|
19
|
+
declare namespace Intl {
|
|
20
|
+
/**
|
|
21
|
+
* The `Intl.getCanonicalLocales()` method returns an array containing
|
|
22
|
+
* the canonical locale names. Duplicates will be omitted and elements
|
|
23
|
+
* will be validated as structurally valid language tags.
|
|
24
|
+
*
|
|
25
|
+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales)
|
|
26
|
+
*
|
|
27
|
+
* @param locale A list of String values for which to get the canonical locale names
|
|
28
|
+
* @returns An array containing the canonical and validated locale names.
|
|
29
|
+
*/
|
|
30
|
+
function getCanonicalLocales(locale?: string | string[]): string[];
|
|
31
|
+
}
|
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20231104`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -23404,7 +23404,7 @@ function createEmitHelperFactory(context) {
|
|
|
23404
23404
|
]
|
|
23405
23405
|
);
|
|
23406
23406
|
}
|
|
23407
|
-
function createAwaiterHelper(hasLexicalThis,
|
|
23407
|
+
function createAwaiterHelper(hasLexicalThis, argumentsExpression, promiseConstructor, parameters, body) {
|
|
23408
23408
|
context.requestEmitHelper(awaiterHelper);
|
|
23409
23409
|
const generatorFunc = factory2.createFunctionExpression(
|
|
23410
23410
|
/*modifiers*/
|
|
@@ -23414,8 +23414,7 @@ function createEmitHelperFactory(context) {
|
|
|
23414
23414
|
void 0,
|
|
23415
23415
|
/*typeParameters*/
|
|
23416
23416
|
void 0,
|
|
23417
|
-
|
|
23418
|
-
[],
|
|
23417
|
+
parameters ?? [],
|
|
23419
23418
|
/*type*/
|
|
23420
23419
|
void 0,
|
|
23421
23420
|
body
|
|
@@ -23427,7 +23426,7 @@ function createEmitHelperFactory(context) {
|
|
|
23427
23426
|
void 0,
|
|
23428
23427
|
[
|
|
23429
23428
|
hasLexicalThis ? factory2.createThis() : factory2.createVoidZero(),
|
|
23430
|
-
|
|
23429
|
+
argumentsExpression ?? factory2.createVoidZero(),
|
|
23431
23430
|
promiseConstructor ? createExpressionFromEntityName(factory2, promiseConstructor) : factory2.createVoidZero(),
|
|
23432
23431
|
generatorFunc
|
|
23433
23432
|
]
|
|
@@ -33842,6 +33841,7 @@ var libEntries = [
|
|
|
33842
33841
|
["es2015.symbol", "lib.es2015.symbol.d.ts"],
|
|
33843
33842
|
["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"],
|
|
33844
33843
|
["es2016.array.include", "lib.es2016.array.include.d.ts"],
|
|
33844
|
+
["es2016.intl", "lib.es2016.intl.d.ts"],
|
|
33845
33845
|
["es2017.date", "lib.es2017.date.d.ts"],
|
|
33846
33846
|
["es2017.object", "lib.es2017.object.d.ts"],
|
|
33847
33847
|
["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"],
|
|
@@ -34173,6 +34173,7 @@ var targetOptionDeclaration = {
|
|
|
34173
34173
|
affectsModuleResolution: true,
|
|
34174
34174
|
affectsEmit: true,
|
|
34175
34175
|
affectsBuildInfo: true,
|
|
34176
|
+
deprecatedKeys: /* @__PURE__ */ new Set(["es3"]),
|
|
34176
34177
|
paramType: Diagnostics.VERSION,
|
|
34177
34178
|
showInSimplifiedHelpView: true,
|
|
34178
34179
|
category: Diagnostics.Language_and_Environment,
|
|
@@ -40034,6 +40035,9 @@ function createBinder() {
|
|
|
40034
40035
|
case 213 /* CallExpression */:
|
|
40035
40036
|
return hasNarrowableArgument(expr);
|
|
40036
40037
|
case 217 /* ParenthesizedExpression */:
|
|
40038
|
+
if (isJSDocTypeAssertion(expr)) {
|
|
40039
|
+
return false;
|
|
40040
|
+
}
|
|
40037
40041
|
case 235 /* NonNullExpression */:
|
|
40038
40042
|
return isNarrowingExpression(expr.expression);
|
|
40039
40043
|
case 226 /* BinaryExpression */:
|
|
@@ -66866,15 +66870,23 @@ function createTypeChecker(host) {
|
|
|
66866
66870
|
error(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
|
|
66867
66871
|
return errorType;
|
|
66868
66872
|
}
|
|
66869
|
-
|
|
66870
|
-
if (
|
|
66871
|
-
if (
|
|
66872
|
-
|
|
66873
|
-
|
|
66874
|
-
|
|
66873
|
+
let container = getContainingFunction(node);
|
|
66874
|
+
if (container) {
|
|
66875
|
+
if (languageVersion < 2 /* ES2015 */) {
|
|
66876
|
+
if (container.kind === 219 /* ArrowFunction */) {
|
|
66877
|
+
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
|
|
66878
|
+
} else if (hasSyntacticModifier(container, 1024 /* Async */)) {
|
|
66879
|
+
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
|
|
66880
|
+
}
|
|
66881
|
+
}
|
|
66882
|
+
getNodeLinks(container).flags |= 512 /* CaptureArguments */;
|
|
66883
|
+
while (container && isArrowFunction(container)) {
|
|
66884
|
+
container = getContainingFunction(container);
|
|
66885
|
+
if (container) {
|
|
66886
|
+
getNodeLinks(container).flags |= 512 /* CaptureArguments */;
|
|
66887
|
+
}
|
|
66875
66888
|
}
|
|
66876
66889
|
}
|
|
66877
|
-
getNodeLinks(container).flags |= 512 /* CaptureArguments */;
|
|
66878
66890
|
return getTypeOfSymbol(symbol);
|
|
66879
66891
|
}
|
|
66880
66892
|
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
@@ -86741,6 +86753,12 @@ function setPrivateIdentifier(privateEnv, name, entry) {
|
|
|
86741
86753
|
function accessPrivateIdentifier(env, name) {
|
|
86742
86754
|
return walkUpLexicalEnvironments(env, (env2) => getPrivateIdentifier(env2.privateEnv, name));
|
|
86743
86755
|
}
|
|
86756
|
+
function isSimpleParameter(node) {
|
|
86757
|
+
return !node.initializer && isIdentifier(node.name);
|
|
86758
|
+
}
|
|
86759
|
+
function isSimpleParameterList(nodes) {
|
|
86760
|
+
return every(nodes, isSimpleParameter);
|
|
86761
|
+
}
|
|
86744
86762
|
|
|
86745
86763
|
// src/compiler/transformers/destructuring.ts
|
|
86746
86764
|
function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) {
|
|
@@ -94217,6 +94235,7 @@ function transformES2017(context) {
|
|
|
94217
94235
|
let enclosingFunctionParameterNames;
|
|
94218
94236
|
let capturedSuperProperties;
|
|
94219
94237
|
let hasSuperElementAccess;
|
|
94238
|
+
let lexicalArgumentsBinding;
|
|
94220
94239
|
const substitutedSuperAccessors = [];
|
|
94221
94240
|
let contextFlags = 0 /* None */;
|
|
94222
94241
|
const previousOnEmitNode = context.onEmitNode;
|
|
@@ -94267,9 +94286,30 @@ function transformES2017(context) {
|
|
|
94267
94286
|
function visitDefault(node) {
|
|
94268
94287
|
return visitEachChild(node, visitor, context);
|
|
94269
94288
|
}
|
|
94289
|
+
function argumentsVisitor(node) {
|
|
94290
|
+
switch (node.kind) {
|
|
94291
|
+
case 218 /* FunctionExpression */:
|
|
94292
|
+
case 262 /* FunctionDeclaration */:
|
|
94293
|
+
case 174 /* MethodDeclaration */:
|
|
94294
|
+
case 177 /* GetAccessor */:
|
|
94295
|
+
case 178 /* SetAccessor */:
|
|
94296
|
+
case 176 /* Constructor */:
|
|
94297
|
+
return node;
|
|
94298
|
+
case 169 /* Parameter */:
|
|
94299
|
+
case 208 /* BindingElement */:
|
|
94300
|
+
case 260 /* VariableDeclaration */:
|
|
94301
|
+
break;
|
|
94302
|
+
case 80 /* Identifier */:
|
|
94303
|
+
if (lexicalArgumentsBinding && resolver.isArgumentsLocalBinding(node)) {
|
|
94304
|
+
return lexicalArgumentsBinding;
|
|
94305
|
+
}
|
|
94306
|
+
break;
|
|
94307
|
+
}
|
|
94308
|
+
return visitEachChild(node, argumentsVisitor, context);
|
|
94309
|
+
}
|
|
94270
94310
|
function visitor(node) {
|
|
94271
94311
|
if ((node.transformFlags & 256 /* ContainsES2017 */) === 0) {
|
|
94272
|
-
return node;
|
|
94312
|
+
return lexicalArgumentsBinding ? argumentsVisitor(node) : node;
|
|
94273
94313
|
}
|
|
94274
94314
|
switch (node.kind) {
|
|
94275
94315
|
case 134 /* AsyncKeyword */:
|
|
@@ -94427,15 +94467,23 @@ function transformES2017(context) {
|
|
|
94427
94467
|
);
|
|
94428
94468
|
}
|
|
94429
94469
|
function visitConstructorDeclaration(node) {
|
|
94430
|
-
|
|
94470
|
+
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
94471
|
+
lexicalArgumentsBinding = void 0;
|
|
94472
|
+
const updated = factory2.updateConstructorDeclaration(
|
|
94431
94473
|
node,
|
|
94432
94474
|
visitNodes2(node.modifiers, visitor, isModifier),
|
|
94433
94475
|
visitParameterList(node.parameters, visitor, context),
|
|
94434
94476
|
transformMethodBody(node)
|
|
94435
94477
|
);
|
|
94478
|
+
lexicalArgumentsBinding = savedLexicalArgumentsBinding;
|
|
94479
|
+
return updated;
|
|
94436
94480
|
}
|
|
94437
94481
|
function visitMethodDeclaration(node) {
|
|
94438
|
-
|
|
94482
|
+
let parameters;
|
|
94483
|
+
const functionFlags = getFunctionFlags(node);
|
|
94484
|
+
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
94485
|
+
lexicalArgumentsBinding = void 0;
|
|
94486
|
+
const updated = factory2.updateMethodDeclaration(
|
|
94439
94487
|
node,
|
|
94440
94488
|
visitNodes2(node.modifiers, visitor, isModifierLike),
|
|
94441
94489
|
node.asteriskToken,
|
|
@@ -94444,14 +94492,18 @@ function transformES2017(context) {
|
|
|
94444
94492
|
void 0,
|
|
94445
94493
|
/*typeParameters*/
|
|
94446
94494
|
void 0,
|
|
94447
|
-
visitParameterList(node.parameters, visitor, context),
|
|
94495
|
+
parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
|
|
94448
94496
|
/*type*/
|
|
94449
94497
|
void 0,
|
|
94450
|
-
|
|
94498
|
+
functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : transformMethodBody(node)
|
|
94451
94499
|
);
|
|
94500
|
+
lexicalArgumentsBinding = savedLexicalArgumentsBinding;
|
|
94501
|
+
return updated;
|
|
94452
94502
|
}
|
|
94453
94503
|
function visitGetAccessorDeclaration(node) {
|
|
94454
|
-
|
|
94504
|
+
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
94505
|
+
lexicalArgumentsBinding = void 0;
|
|
94506
|
+
const updated = factory2.updateGetAccessorDeclaration(
|
|
94455
94507
|
node,
|
|
94456
94508
|
visitNodes2(node.modifiers, visitor, isModifierLike),
|
|
94457
94509
|
node.name,
|
|
@@ -94460,55 +94512,75 @@ function transformES2017(context) {
|
|
|
94460
94512
|
void 0,
|
|
94461
94513
|
transformMethodBody(node)
|
|
94462
94514
|
);
|
|
94515
|
+
lexicalArgumentsBinding = savedLexicalArgumentsBinding;
|
|
94516
|
+
return updated;
|
|
94463
94517
|
}
|
|
94464
94518
|
function visitSetAccessorDeclaration(node) {
|
|
94465
|
-
|
|
94519
|
+
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
94520
|
+
lexicalArgumentsBinding = void 0;
|
|
94521
|
+
const updated = factory2.updateSetAccessorDeclaration(
|
|
94466
94522
|
node,
|
|
94467
94523
|
visitNodes2(node.modifiers, visitor, isModifierLike),
|
|
94468
94524
|
node.name,
|
|
94469
94525
|
visitParameterList(node.parameters, visitor, context),
|
|
94470
94526
|
transformMethodBody(node)
|
|
94471
94527
|
);
|
|
94528
|
+
lexicalArgumentsBinding = savedLexicalArgumentsBinding;
|
|
94529
|
+
return updated;
|
|
94472
94530
|
}
|
|
94473
94531
|
function visitFunctionDeclaration(node) {
|
|
94474
|
-
|
|
94532
|
+
let parameters;
|
|
94533
|
+
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
94534
|
+
lexicalArgumentsBinding = void 0;
|
|
94535
|
+
const functionFlags = getFunctionFlags(node);
|
|
94536
|
+
const updated = factory2.updateFunctionDeclaration(
|
|
94475
94537
|
node,
|
|
94476
94538
|
visitNodes2(node.modifiers, visitor, isModifierLike),
|
|
94477
94539
|
node.asteriskToken,
|
|
94478
94540
|
node.name,
|
|
94479
94541
|
/*typeParameters*/
|
|
94480
94542
|
void 0,
|
|
94481
|
-
visitParameterList(node.parameters, visitor, context),
|
|
94543
|
+
parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
|
|
94482
94544
|
/*type*/
|
|
94483
94545
|
void 0,
|
|
94484
|
-
|
|
94546
|
+
functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
|
|
94485
94547
|
);
|
|
94548
|
+
lexicalArgumentsBinding = savedLexicalArgumentsBinding;
|
|
94549
|
+
return updated;
|
|
94486
94550
|
}
|
|
94487
94551
|
function visitFunctionExpression(node) {
|
|
94488
|
-
|
|
94552
|
+
let parameters;
|
|
94553
|
+
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
94554
|
+
lexicalArgumentsBinding = void 0;
|
|
94555
|
+
const functionFlags = getFunctionFlags(node);
|
|
94556
|
+
const updated = factory2.updateFunctionExpression(
|
|
94489
94557
|
node,
|
|
94490
94558
|
visitNodes2(node.modifiers, visitor, isModifier),
|
|
94491
94559
|
node.asteriskToken,
|
|
94492
94560
|
node.name,
|
|
94493
94561
|
/*typeParameters*/
|
|
94494
94562
|
void 0,
|
|
94495
|
-
visitParameterList(node.parameters, visitor, context),
|
|
94563
|
+
parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
|
|
94496
94564
|
/*type*/
|
|
94497
94565
|
void 0,
|
|
94498
|
-
|
|
94566
|
+
functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
|
|
94499
94567
|
);
|
|
94568
|
+
lexicalArgumentsBinding = savedLexicalArgumentsBinding;
|
|
94569
|
+
return updated;
|
|
94500
94570
|
}
|
|
94501
94571
|
function visitArrowFunction(node) {
|
|
94572
|
+
let parameters;
|
|
94573
|
+
const functionFlags = getFunctionFlags(node);
|
|
94502
94574
|
return factory2.updateArrowFunction(
|
|
94503
94575
|
node,
|
|
94504
94576
|
visitNodes2(node.modifiers, visitor, isModifier),
|
|
94505
94577
|
/*typeParameters*/
|
|
94506
94578
|
void 0,
|
|
94507
|
-
visitParameterList(node.parameters, visitor, context),
|
|
94579
|
+
parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
|
|
94508
94580
|
/*type*/
|
|
94509
94581
|
void 0,
|
|
94510
94582
|
node.equalsGreaterThanToken,
|
|
94511
|
-
|
|
94583
|
+
functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
|
|
94512
94584
|
);
|
|
94513
94585
|
}
|
|
94514
94586
|
function recordDeclarationName({ name }, names) {
|
|
@@ -94602,13 +94674,91 @@ function transformES2017(context) {
|
|
|
94602
94674
|
hasSuperElementAccess = savedHasSuperElementAccess;
|
|
94603
94675
|
return updated;
|
|
94604
94676
|
}
|
|
94605
|
-
function
|
|
94677
|
+
function createCaptureArgumentsStatement() {
|
|
94678
|
+
Debug.assert(lexicalArgumentsBinding);
|
|
94679
|
+
const variable = factory2.createVariableDeclaration(
|
|
94680
|
+
lexicalArgumentsBinding,
|
|
94681
|
+
/*exclamationToken*/
|
|
94682
|
+
void 0,
|
|
94683
|
+
/*type*/
|
|
94684
|
+
void 0,
|
|
94685
|
+
factory2.createIdentifier("arguments")
|
|
94686
|
+
);
|
|
94687
|
+
const statement = factory2.createVariableStatement(
|
|
94688
|
+
/*modifiers*/
|
|
94689
|
+
void 0,
|
|
94690
|
+
[variable]
|
|
94691
|
+
);
|
|
94692
|
+
startOnNewLine(statement);
|
|
94693
|
+
addEmitFlags(statement, 2097152 /* CustomPrologue */);
|
|
94694
|
+
return statement;
|
|
94695
|
+
}
|
|
94696
|
+
function transformAsyncFunctionParameterList(node) {
|
|
94697
|
+
if (isSimpleParameterList(node.parameters)) {
|
|
94698
|
+
return visitParameterList(node.parameters, visitor, context);
|
|
94699
|
+
}
|
|
94700
|
+
const newParameters = [];
|
|
94701
|
+
for (const parameter of node.parameters) {
|
|
94702
|
+
if (parameter.initializer || parameter.dotDotDotToken) {
|
|
94703
|
+
if (node.kind === 219 /* ArrowFunction */) {
|
|
94704
|
+
const restParameter = factory2.createParameterDeclaration(
|
|
94705
|
+
/*modifiers*/
|
|
94706
|
+
void 0,
|
|
94707
|
+
factory2.createToken(26 /* DotDotDotToken */),
|
|
94708
|
+
factory2.createUniqueName("args", 8 /* ReservedInNestedScopes */)
|
|
94709
|
+
);
|
|
94710
|
+
newParameters.push(restParameter);
|
|
94711
|
+
}
|
|
94712
|
+
break;
|
|
94713
|
+
}
|
|
94714
|
+
const newParameter = factory2.createParameterDeclaration(
|
|
94715
|
+
/*modifiers*/
|
|
94716
|
+
void 0,
|
|
94717
|
+
/*dotDotDotToken*/
|
|
94718
|
+
void 0,
|
|
94719
|
+
factory2.getGeneratedNameForNode(parameter.name, 8 /* ReservedInNestedScopes */)
|
|
94720
|
+
);
|
|
94721
|
+
newParameters.push(newParameter);
|
|
94722
|
+
}
|
|
94723
|
+
const newParametersArray = factory2.createNodeArray(newParameters);
|
|
94724
|
+
setTextRange(newParametersArray, node.parameters);
|
|
94725
|
+
return newParametersArray;
|
|
94726
|
+
}
|
|
94727
|
+
function transformAsyncFunctionBody(node, outerParameters) {
|
|
94728
|
+
const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context) : void 0;
|
|
94606
94729
|
resumeLexicalEnvironment();
|
|
94607
94730
|
const original = getOriginalNode(node, isFunctionLike);
|
|
94608
94731
|
const nodeType = original.type;
|
|
94609
94732
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
94610
94733
|
const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
|
|
94734
|
+
const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
|
|
94611
94735
|
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
|
|
94736
|
+
const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding;
|
|
94737
|
+
if (captureLexicalArguments) {
|
|
94738
|
+
lexicalArgumentsBinding = factory2.createUniqueName("arguments");
|
|
94739
|
+
}
|
|
94740
|
+
let argumentsExpression;
|
|
94741
|
+
if (innerParameters) {
|
|
94742
|
+
if (isArrowFunction2) {
|
|
94743
|
+
const parameterBindings = [];
|
|
94744
|
+
Debug.assert(outerParameters.length <= node.parameters.length);
|
|
94745
|
+
for (let i = 0; i < node.parameters.length; i++) {
|
|
94746
|
+
Debug.assert(i < outerParameters.length);
|
|
94747
|
+
const originalParameter = node.parameters[i];
|
|
94748
|
+
const outerParameter = outerParameters[i];
|
|
94749
|
+
Debug.assertNode(outerParameter.name, isIdentifier);
|
|
94750
|
+
if (originalParameter.initializer || originalParameter.dotDotDotToken) {
|
|
94751
|
+
Debug.assert(i === outerParameters.length - 1);
|
|
94752
|
+
parameterBindings.push(factory2.createSpreadElement(outerParameter.name));
|
|
94753
|
+
break;
|
|
94754
|
+
}
|
|
94755
|
+
parameterBindings.push(outerParameter.name);
|
|
94756
|
+
}
|
|
94757
|
+
argumentsExpression = factory2.createArrayLiteralExpression(parameterBindings);
|
|
94758
|
+
} else {
|
|
94759
|
+
argumentsExpression = factory2.createIdentifier("arguments");
|
|
94760
|
+
}
|
|
94761
|
+
}
|
|
94612
94762
|
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
|
|
94613
94763
|
enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
|
|
94614
94764
|
for (const parameter of node.parameters) {
|
|
@@ -94620,27 +94770,23 @@ function transformES2017(context) {
|
|
|
94620
94770
|
capturedSuperProperties = /* @__PURE__ */ new Set();
|
|
94621
94771
|
hasSuperElementAccess = false;
|
|
94622
94772
|
}
|
|
94773
|
+
const hasLexicalThis = inHasLexicalThisContext();
|
|
94774
|
+
let asyncBody = transformAsyncFunctionBodyWorker(node.body);
|
|
94775
|
+
asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, endLexicalEnvironment()));
|
|
94623
94776
|
let result;
|
|
94624
94777
|
if (!isArrowFunction2) {
|
|
94625
94778
|
const statements = [];
|
|
94626
|
-
const statementOffset = factory2.copyPrologue(
|
|
94627
|
-
node.body.statements,
|
|
94628
|
-
statements,
|
|
94629
|
-
/*ensureUseStrict*/
|
|
94630
|
-
false,
|
|
94631
|
-
visitor
|
|
94632
|
-
);
|
|
94633
94779
|
statements.push(
|
|
94634
94780
|
factory2.createReturnStatement(
|
|
94635
94781
|
emitHelpers().createAwaiterHelper(
|
|
94636
|
-
|
|
94637
|
-
|
|
94782
|
+
hasLexicalThis,
|
|
94783
|
+
argumentsExpression,
|
|
94638
94784
|
promiseConstructor,
|
|
94639
|
-
|
|
94785
|
+
innerParameters,
|
|
94786
|
+
asyncBody
|
|
94640
94787
|
)
|
|
94641
94788
|
)
|
|
94642
94789
|
);
|
|
94643
|
-
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
94644
94790
|
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
94645
94791
|
if (emitSuperHelpers) {
|
|
94646
94792
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
@@ -94650,6 +94796,9 @@ function transformES2017(context) {
|
|
|
94650
94796
|
insertStatementsAfterStandardPrologue(statements, [variableStatement]);
|
|
94651
94797
|
}
|
|
94652
94798
|
}
|
|
94799
|
+
if (captureLexicalArguments) {
|
|
94800
|
+
insertStatementsAfterStandardPrologue(statements, [createCaptureArgumentsStatement()]);
|
|
94801
|
+
}
|
|
94653
94802
|
const block = factory2.createBlock(
|
|
94654
94803
|
statements,
|
|
94655
94804
|
/*multiLine*/
|
|
@@ -94665,24 +94814,23 @@ function transformES2017(context) {
|
|
|
94665
94814
|
}
|
|
94666
94815
|
result = block;
|
|
94667
94816
|
} else {
|
|
94668
|
-
|
|
94669
|
-
|
|
94670
|
-
|
|
94817
|
+
result = emitHelpers().createAwaiterHelper(
|
|
94818
|
+
hasLexicalThis,
|
|
94819
|
+
argumentsExpression,
|
|
94671
94820
|
promiseConstructor,
|
|
94672
|
-
|
|
94821
|
+
innerParameters,
|
|
94822
|
+
asyncBody
|
|
94673
94823
|
);
|
|
94674
|
-
|
|
94675
|
-
|
|
94676
|
-
|
|
94677
|
-
result = factory2.updateBlock(block, setTextRange(factory2.createNodeArray(concatenate(declarations, block.statements)), block.statements));
|
|
94678
|
-
} else {
|
|
94679
|
-
result = expression;
|
|
94824
|
+
if (captureLexicalArguments) {
|
|
94825
|
+
const block = factory2.converters.convertToFunctionBlock(result);
|
|
94826
|
+
result = factory2.updateBlock(block, factory2.mergeLexicalEnvironment(block.statements, [createCaptureArgumentsStatement()]));
|
|
94680
94827
|
}
|
|
94681
94828
|
}
|
|
94682
94829
|
enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames;
|
|
94683
94830
|
if (!isArrowFunction2) {
|
|
94684
94831
|
capturedSuperProperties = savedCapturedSuperProperties;
|
|
94685
94832
|
hasSuperElementAccess = savedHasSuperElementAccess;
|
|
94833
|
+
lexicalArgumentsBinding = savedLexicalArgumentsBinding;
|
|
94686
94834
|
}
|
|
94687
94835
|
return result;
|
|
94688
94836
|
}
|
|
@@ -95798,7 +95946,7 @@ function transformES2018(context) {
|
|
|
95798
95946
|
),
|
|
95799
95947
|
/*typeParameters*/
|
|
95800
95948
|
void 0,
|
|
95801
|
-
visitParameterList(node.parameters, parameterVisitor, context),
|
|
95949
|
+
enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
|
|
95802
95950
|
/*type*/
|
|
95803
95951
|
void 0,
|
|
95804
95952
|
enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node)
|
|
@@ -95819,7 +95967,7 @@ function transformES2018(context) {
|
|
|
95819
95967
|
node.name,
|
|
95820
95968
|
/*typeParameters*/
|
|
95821
95969
|
void 0,
|
|
95822
|
-
visitParameterList(node.parameters, parameterVisitor, context),
|
|
95970
|
+
enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
|
|
95823
95971
|
/*type*/
|
|
95824
95972
|
void 0,
|
|
95825
95973
|
enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node)
|
|
@@ -95860,7 +96008,7 @@ function transformES2018(context) {
|
|
|
95860
96008
|
node.name,
|
|
95861
96009
|
/*typeParameters*/
|
|
95862
96010
|
void 0,
|
|
95863
|
-
visitParameterList(node.parameters, parameterVisitor, context),
|
|
96011
|
+
enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
|
|
95864
96012
|
/*type*/
|
|
95865
96013
|
void 0,
|
|
95866
96014
|
enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node)
|
|
@@ -95869,21 +96017,38 @@ function transformES2018(context) {
|
|
|
95869
96017
|
parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
|
|
95870
96018
|
return updated;
|
|
95871
96019
|
}
|
|
96020
|
+
function transformAsyncGeneratorFunctionParameterList(node) {
|
|
96021
|
+
if (isSimpleParameterList(node.parameters)) {
|
|
96022
|
+
return visitParameterList(node.parameters, visitor, context);
|
|
96023
|
+
}
|
|
96024
|
+
const newParameters = [];
|
|
96025
|
+
for (const parameter of node.parameters) {
|
|
96026
|
+
if (parameter.initializer || parameter.dotDotDotToken) {
|
|
96027
|
+
break;
|
|
96028
|
+
}
|
|
96029
|
+
const newParameter = factory2.createParameterDeclaration(
|
|
96030
|
+
/*modifiers*/
|
|
96031
|
+
void 0,
|
|
96032
|
+
/*dotDotDotToken*/
|
|
96033
|
+
void 0,
|
|
96034
|
+
factory2.getGeneratedNameForNode(parameter.name, 8 /* ReservedInNestedScopes */)
|
|
96035
|
+
);
|
|
96036
|
+
newParameters.push(newParameter);
|
|
96037
|
+
}
|
|
96038
|
+
const newParametersArray = factory2.createNodeArray(newParameters);
|
|
96039
|
+
setTextRange(newParametersArray, node.parameters);
|
|
96040
|
+
return newParametersArray;
|
|
96041
|
+
}
|
|
95872
96042
|
function transformAsyncGeneratorFunctionBody(node) {
|
|
96043
|
+
const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context) : void 0;
|
|
95873
96044
|
resumeLexicalEnvironment();
|
|
95874
|
-
const statements = [];
|
|
95875
|
-
const statementOffset = factory2.copyPrologue(
|
|
95876
|
-
node.body.statements,
|
|
95877
|
-
statements,
|
|
95878
|
-
/*ensureUseStrict*/
|
|
95879
|
-
false,
|
|
95880
|
-
visitor
|
|
95881
|
-
);
|
|
95882
|
-
appendObjectRestAssignmentsIfNeeded(statements, node);
|
|
95883
96045
|
const savedCapturedSuperProperties = capturedSuperProperties;
|
|
95884
96046
|
const savedHasSuperElementAccess = hasSuperElementAccess;
|
|
95885
96047
|
capturedSuperProperties = /* @__PURE__ */ new Set();
|
|
95886
96048
|
hasSuperElementAccess = false;
|
|
96049
|
+
const outerStatements = [];
|
|
96050
|
+
let asyncBody = factory2.updateBlock(node.body, visitNodes2(node.body.statements, visitor, isStatement));
|
|
96051
|
+
asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, appendObjectRestAssignmentsIfNeeded(endLexicalEnvironment(), node)));
|
|
95887
96052
|
const returnStatement = factory2.createReturnStatement(
|
|
95888
96053
|
emitHelpers().createAsyncGeneratorHelper(
|
|
95889
96054
|
factory2.createFunctionExpression(
|
|
@@ -95893,14 +96058,10 @@ function transformES2018(context) {
|
|
|
95893
96058
|
node.name && factory2.getGeneratedNameForNode(node.name),
|
|
95894
96059
|
/*typeParameters*/
|
|
95895
96060
|
void 0,
|
|
95896
|
-
|
|
95897
|
-
[],
|
|
96061
|
+
innerParameters ?? [],
|
|
95898
96062
|
/*type*/
|
|
95899
96063
|
void 0,
|
|
95900
|
-
|
|
95901
|
-
node.body,
|
|
95902
|
-
visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)
|
|
95903
|
-
)
|
|
96064
|
+
asyncBody
|
|
95904
96065
|
),
|
|
95905
96066
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
95906
96067
|
)
|
|
@@ -95910,11 +96071,10 @@ function transformES2018(context) {
|
|
|
95910
96071
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
95911
96072
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
95912
96073
|
substitutedSuperAccessors[getNodeId(variableStatement)] = true;
|
|
95913
|
-
insertStatementsAfterStandardPrologue(
|
|
96074
|
+
insertStatementsAfterStandardPrologue(outerStatements, [variableStatement]);
|
|
95914
96075
|
}
|
|
95915
|
-
|
|
95916
|
-
|
|
95917
|
-
const block = factory2.updateBlock(node.body, statements);
|
|
96076
|
+
outerStatements.push(returnStatement);
|
|
96077
|
+
const block = factory2.updateBlock(node.body, outerStatements);
|
|
95918
96078
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
95919
96079
|
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
95920
96080
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
@@ -125887,7 +126047,10 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
125887
126047
|
default:
|
|
125888
126048
|
const inverted = {};
|
|
125889
126049
|
option3.type.forEach((value, name2) => {
|
|
125890
|
-
|
|
126050
|
+
var _a2;
|
|
126051
|
+
if (!((_a2 = option3.deprecatedKeys) == null ? void 0 : _a2.has(name2))) {
|
|
126052
|
+
(inverted[value] || (inverted[value] = [])).push(name2);
|
|
126053
|
+
}
|
|
125891
126054
|
});
|
|
125892
126055
|
return Object.entries(inverted).map(([, synonyms]) => synonyms.join("/")).join(", ");
|
|
125893
126056
|
}
|