@typescript-deploys/pr-build 5.4.0-pr-56300-6 → 5.4.0-pr-56305-8

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.
@@ -18,3 +18,4 @@ and limitations under the License.
18
18
 
19
19
  /// <reference lib="es2015" />
20
20
  /// <reference lib="es2016.array.include" />
21
+ /// <reference lib="es2016.intl" />
@@ -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
@@ -23404,7 +23404,7 @@ function createEmitHelperFactory(context) {
23404
23404
  ]
23405
23405
  );
23406
23406
  }
23407
- function createAwaiterHelper(hasLexicalThis, hasLexicalArguments, promiseConstructor, body) {
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
- /*parameters*/
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
- hasLexicalArguments ? factory2.createIdentifier("arguments") : factory2.createVoidZero(),
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,
@@ -63740,7 +63741,7 @@ function createTypeChecker(host) {
63740
63741
  const templateType = getTemplateTypeFromMappedType(target);
63741
63742
  const inference = createInferenceInfo(typeParameter);
63742
63743
  inferTypes([inference], sourceType, templateType);
63743
- return getTypeFromInference(inference) || getBaseConstraintOfType(typeParameter) || unknownType;
63744
+ return getTypeFromInference(inference) || unknownType;
63744
63745
  }
63745
63746
  function* getUnmatchedProperties(source, target, requireOptionalProperties, matchDiscriminantProperties) {
63746
63747
  const properties = getPropertiesOfType(target);
@@ -66869,15 +66870,23 @@ function createTypeChecker(host) {
66869
66870
  error(node, Diagnostics.arguments_cannot_be_referenced_in_property_initializers);
66870
66871
  return errorType;
66871
66872
  }
66872
- const container = getContainingFunction(node);
66873
- if (languageVersion < 2 /* ES2015 */) {
66874
- if (container.kind === 219 /* ArrowFunction */) {
66875
- error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression);
66876
- } else if (hasSyntacticModifier(container, 1024 /* Async */)) {
66877
- 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);
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
+ }
66878
66888
  }
66879
66889
  }
66880
- getNodeLinks(container).flags |= 512 /* CaptureArguments */;
66881
66890
  return getTypeOfSymbol(symbol);
66882
66891
  }
66883
66892
  if (shouldMarkIdentifierAliasReferenced(node)) {
@@ -74270,6 +74279,9 @@ function createTypeChecker(host) {
74270
74279
  return false;
74271
74280
  }
74272
74281
  }
74282
+ function isTypeStrictEqualityComparableTo(source, target) {
74283
+ return (target.flags & 32768 /* Undefined */) !== 0 || isTypeComparableTo(source, target);
74284
+ }
74273
74285
  function isTypeEqualityComparableTo(source, target) {
74274
74286
  return (target.flags & 98304 /* Nullable */) !== 0 || isTypeComparableTo(source, target);
74275
74287
  }
@@ -74588,7 +74600,8 @@ function createTypeChecker(host) {
74588
74600
  error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
74589
74601
  }
74590
74602
  checkNaNEquality(errorNode, operator, left, right);
74591
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
74603
+ const checkFunction = operator === 35 /* EqualsEqualsToken */ || operator === 36 /* ExclamationEqualsToken */ ? isTypeEqualityComparableTo : isTypeStrictEqualityComparableTo;
74604
+ reportOperatorErrorUnless((left2, right2) => checkFunction(left2, right2) || checkFunction(right2, left2));
74592
74605
  }
74593
74606
  return booleanType;
74594
74607
  case 104 /* InstanceOfKeyword */:
@@ -86744,6 +86757,12 @@ function setPrivateIdentifier(privateEnv, name, entry) {
86744
86757
  function accessPrivateIdentifier(env, name) {
86745
86758
  return walkUpLexicalEnvironments(env, (env2) => getPrivateIdentifier(env2.privateEnv, name));
86746
86759
  }
86760
+ function isSimpleParameter(node) {
86761
+ return !node.initializer && isIdentifier(node.name);
86762
+ }
86763
+ function isSimpleParameterList(nodes) {
86764
+ return every(nodes, isSimpleParameter);
86765
+ }
86747
86766
 
86748
86767
  // src/compiler/transformers/destructuring.ts
86749
86768
  function flattenDestructuringAssignment(node, visitor, context, level, needsValue, createAssignmentCallback) {
@@ -94220,6 +94239,7 @@ function transformES2017(context) {
94220
94239
  let enclosingFunctionParameterNames;
94221
94240
  let capturedSuperProperties;
94222
94241
  let hasSuperElementAccess;
94242
+ let lexicalArgumentsBinding;
94223
94243
  const substitutedSuperAccessors = [];
94224
94244
  let contextFlags = 0 /* None */;
94225
94245
  const previousOnEmitNode = context.onEmitNode;
@@ -94270,9 +94290,30 @@ function transformES2017(context) {
94270
94290
  function visitDefault(node) {
94271
94291
  return visitEachChild(node, visitor, context);
94272
94292
  }
94293
+ function argumentsVisitor(node) {
94294
+ switch (node.kind) {
94295
+ case 218 /* FunctionExpression */:
94296
+ case 262 /* FunctionDeclaration */:
94297
+ case 174 /* MethodDeclaration */:
94298
+ case 177 /* GetAccessor */:
94299
+ case 178 /* SetAccessor */:
94300
+ case 176 /* Constructor */:
94301
+ return node;
94302
+ case 169 /* Parameter */:
94303
+ case 208 /* BindingElement */:
94304
+ case 260 /* VariableDeclaration */:
94305
+ break;
94306
+ case 80 /* Identifier */:
94307
+ if (lexicalArgumentsBinding && resolver.isArgumentsLocalBinding(node)) {
94308
+ return lexicalArgumentsBinding;
94309
+ }
94310
+ break;
94311
+ }
94312
+ return visitEachChild(node, argumentsVisitor, context);
94313
+ }
94273
94314
  function visitor(node) {
94274
94315
  if ((node.transformFlags & 256 /* ContainsES2017 */) === 0) {
94275
- return node;
94316
+ return lexicalArgumentsBinding ? argumentsVisitor(node) : node;
94276
94317
  }
94277
94318
  switch (node.kind) {
94278
94319
  case 134 /* AsyncKeyword */:
@@ -94430,15 +94471,23 @@ function transformES2017(context) {
94430
94471
  );
94431
94472
  }
94432
94473
  function visitConstructorDeclaration(node) {
94433
- return factory2.updateConstructorDeclaration(
94474
+ const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
94475
+ lexicalArgumentsBinding = void 0;
94476
+ const updated = factory2.updateConstructorDeclaration(
94434
94477
  node,
94435
94478
  visitNodes2(node.modifiers, visitor, isModifier),
94436
94479
  visitParameterList(node.parameters, visitor, context),
94437
94480
  transformMethodBody(node)
94438
94481
  );
94482
+ lexicalArgumentsBinding = savedLexicalArgumentsBinding;
94483
+ return updated;
94439
94484
  }
94440
94485
  function visitMethodDeclaration(node) {
94441
- return factory2.updateMethodDeclaration(
94486
+ let parameters;
94487
+ const functionFlags = getFunctionFlags(node);
94488
+ const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
94489
+ lexicalArgumentsBinding = void 0;
94490
+ const updated = factory2.updateMethodDeclaration(
94442
94491
  node,
94443
94492
  visitNodes2(node.modifiers, visitor, isModifierLike),
94444
94493
  node.asteriskToken,
@@ -94447,14 +94496,18 @@ function transformES2017(context) {
94447
94496
  void 0,
94448
94497
  /*typeParameters*/
94449
94498
  void 0,
94450
- visitParameterList(node.parameters, visitor, context),
94499
+ parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
94451
94500
  /*type*/
94452
94501
  void 0,
94453
- getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : transformMethodBody(node)
94502
+ functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : transformMethodBody(node)
94454
94503
  );
94504
+ lexicalArgumentsBinding = savedLexicalArgumentsBinding;
94505
+ return updated;
94455
94506
  }
94456
94507
  function visitGetAccessorDeclaration(node) {
94457
- return factory2.updateGetAccessorDeclaration(
94508
+ const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
94509
+ lexicalArgumentsBinding = void 0;
94510
+ const updated = factory2.updateGetAccessorDeclaration(
94458
94511
  node,
94459
94512
  visitNodes2(node.modifiers, visitor, isModifierLike),
94460
94513
  node.name,
@@ -94463,55 +94516,75 @@ function transformES2017(context) {
94463
94516
  void 0,
94464
94517
  transformMethodBody(node)
94465
94518
  );
94519
+ lexicalArgumentsBinding = savedLexicalArgumentsBinding;
94520
+ return updated;
94466
94521
  }
94467
94522
  function visitSetAccessorDeclaration(node) {
94468
- return factory2.updateSetAccessorDeclaration(
94523
+ const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
94524
+ lexicalArgumentsBinding = void 0;
94525
+ const updated = factory2.updateSetAccessorDeclaration(
94469
94526
  node,
94470
94527
  visitNodes2(node.modifiers, visitor, isModifierLike),
94471
94528
  node.name,
94472
94529
  visitParameterList(node.parameters, visitor, context),
94473
94530
  transformMethodBody(node)
94474
94531
  );
94532
+ lexicalArgumentsBinding = savedLexicalArgumentsBinding;
94533
+ return updated;
94475
94534
  }
94476
94535
  function visitFunctionDeclaration(node) {
94477
- return factory2.updateFunctionDeclaration(
94536
+ let parameters;
94537
+ const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
94538
+ lexicalArgumentsBinding = void 0;
94539
+ const functionFlags = getFunctionFlags(node);
94540
+ const updated = factory2.updateFunctionDeclaration(
94478
94541
  node,
94479
94542
  visitNodes2(node.modifiers, visitor, isModifierLike),
94480
94543
  node.asteriskToken,
94481
94544
  node.name,
94482
94545
  /*typeParameters*/
94483
94546
  void 0,
94484
- visitParameterList(node.parameters, visitor, context),
94547
+ parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
94485
94548
  /*type*/
94486
94549
  void 0,
94487
- getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : visitFunctionBody(node.body, visitor, context)
94550
+ functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
94488
94551
  );
94552
+ lexicalArgumentsBinding = savedLexicalArgumentsBinding;
94553
+ return updated;
94489
94554
  }
94490
94555
  function visitFunctionExpression(node) {
94491
- return factory2.updateFunctionExpression(
94556
+ let parameters;
94557
+ const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
94558
+ lexicalArgumentsBinding = void 0;
94559
+ const functionFlags = getFunctionFlags(node);
94560
+ const updated = factory2.updateFunctionExpression(
94492
94561
  node,
94493
94562
  visitNodes2(node.modifiers, visitor, isModifier),
94494
94563
  node.asteriskToken,
94495
94564
  node.name,
94496
94565
  /*typeParameters*/
94497
94566
  void 0,
94498
- visitParameterList(node.parameters, visitor, context),
94567
+ parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
94499
94568
  /*type*/
94500
94569
  void 0,
94501
- getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : visitFunctionBody(node.body, visitor, context)
94570
+ functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
94502
94571
  );
94572
+ lexicalArgumentsBinding = savedLexicalArgumentsBinding;
94573
+ return updated;
94503
94574
  }
94504
94575
  function visitArrowFunction(node) {
94576
+ let parameters;
94577
+ const functionFlags = getFunctionFlags(node);
94505
94578
  return factory2.updateArrowFunction(
94506
94579
  node,
94507
94580
  visitNodes2(node.modifiers, visitor, isModifier),
94508
94581
  /*typeParameters*/
94509
94582
  void 0,
94510
- visitParameterList(node.parameters, visitor, context),
94583
+ parameters = functionFlags & 2 /* Async */ ? transformAsyncFunctionParameterList(node) : visitParameterList(node.parameters, visitor, context),
94511
94584
  /*type*/
94512
94585
  void 0,
94513
94586
  node.equalsGreaterThanToken,
94514
- getFunctionFlags(node) & 2 /* Async */ ? transformAsyncFunctionBody(node) : visitFunctionBody(node.body, visitor, context)
94587
+ functionFlags & 2 /* Async */ ? transformAsyncFunctionBody(node, parameters) : visitFunctionBody(node.body, visitor, context)
94515
94588
  );
94516
94589
  }
94517
94590
  function recordDeclarationName({ name }, names) {
@@ -94605,13 +94678,91 @@ function transformES2017(context) {
94605
94678
  hasSuperElementAccess = savedHasSuperElementAccess;
94606
94679
  return updated;
94607
94680
  }
94608
- function transformAsyncFunctionBody(node) {
94681
+ function createCaptureArgumentsStatement() {
94682
+ Debug.assert(lexicalArgumentsBinding);
94683
+ const variable = factory2.createVariableDeclaration(
94684
+ lexicalArgumentsBinding,
94685
+ /*exclamationToken*/
94686
+ void 0,
94687
+ /*type*/
94688
+ void 0,
94689
+ factory2.createIdentifier("arguments")
94690
+ );
94691
+ const statement = factory2.createVariableStatement(
94692
+ /*modifiers*/
94693
+ void 0,
94694
+ [variable]
94695
+ );
94696
+ startOnNewLine(statement);
94697
+ addEmitFlags(statement, 2097152 /* CustomPrologue */);
94698
+ return statement;
94699
+ }
94700
+ function transformAsyncFunctionParameterList(node) {
94701
+ if (isSimpleParameterList(node.parameters)) {
94702
+ return visitParameterList(node.parameters, visitor, context);
94703
+ }
94704
+ const newParameters = [];
94705
+ for (const parameter of node.parameters) {
94706
+ if (parameter.initializer || parameter.dotDotDotToken) {
94707
+ if (node.kind === 219 /* ArrowFunction */) {
94708
+ const restParameter = factory2.createParameterDeclaration(
94709
+ /*modifiers*/
94710
+ void 0,
94711
+ factory2.createToken(26 /* DotDotDotToken */),
94712
+ factory2.createUniqueName("args", 8 /* ReservedInNestedScopes */)
94713
+ );
94714
+ newParameters.push(restParameter);
94715
+ }
94716
+ break;
94717
+ }
94718
+ const newParameter = factory2.createParameterDeclaration(
94719
+ /*modifiers*/
94720
+ void 0,
94721
+ /*dotDotDotToken*/
94722
+ void 0,
94723
+ factory2.getGeneratedNameForNode(parameter.name, 8 /* ReservedInNestedScopes */)
94724
+ );
94725
+ newParameters.push(newParameter);
94726
+ }
94727
+ const newParametersArray = factory2.createNodeArray(newParameters);
94728
+ setTextRange(newParametersArray, node.parameters);
94729
+ return newParametersArray;
94730
+ }
94731
+ function transformAsyncFunctionBody(node, outerParameters) {
94732
+ const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context) : void 0;
94609
94733
  resumeLexicalEnvironment();
94610
94734
  const original = getOriginalNode(node, isFunctionLike);
94611
94735
  const nodeType = original.type;
94612
94736
  const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
94613
94737
  const isArrowFunction2 = node.kind === 219 /* ArrowFunction */;
94738
+ const savedLexicalArgumentsBinding = lexicalArgumentsBinding;
94614
94739
  const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
94740
+ const captureLexicalArguments = hasLexicalArguments && !lexicalArgumentsBinding;
94741
+ if (captureLexicalArguments) {
94742
+ lexicalArgumentsBinding = factory2.createUniqueName("arguments");
94743
+ }
94744
+ let argumentsExpression;
94745
+ if (innerParameters) {
94746
+ if (isArrowFunction2) {
94747
+ const parameterBindings = [];
94748
+ Debug.assert(outerParameters.length <= node.parameters.length);
94749
+ for (let i = 0; i < node.parameters.length; i++) {
94750
+ Debug.assert(i < outerParameters.length);
94751
+ const originalParameter = node.parameters[i];
94752
+ const outerParameter = outerParameters[i];
94753
+ Debug.assertNode(outerParameter.name, isIdentifier);
94754
+ if (originalParameter.initializer || originalParameter.dotDotDotToken) {
94755
+ Debug.assert(i === outerParameters.length - 1);
94756
+ parameterBindings.push(factory2.createSpreadElement(outerParameter.name));
94757
+ break;
94758
+ }
94759
+ parameterBindings.push(outerParameter.name);
94760
+ }
94761
+ argumentsExpression = factory2.createArrayLiteralExpression(parameterBindings);
94762
+ } else {
94763
+ argumentsExpression = factory2.createIdentifier("arguments");
94764
+ }
94765
+ }
94615
94766
  const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
94616
94767
  enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
94617
94768
  for (const parameter of node.parameters) {
@@ -94623,27 +94774,23 @@ function transformES2017(context) {
94623
94774
  capturedSuperProperties = /* @__PURE__ */ new Set();
94624
94775
  hasSuperElementAccess = false;
94625
94776
  }
94777
+ const hasLexicalThis = inHasLexicalThisContext();
94778
+ let asyncBody = transformAsyncFunctionBodyWorker(node.body);
94779
+ asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, endLexicalEnvironment()));
94626
94780
  let result;
94627
94781
  if (!isArrowFunction2) {
94628
94782
  const statements = [];
94629
- const statementOffset = factory2.copyPrologue(
94630
- node.body.statements,
94631
- statements,
94632
- /*ensureUseStrict*/
94633
- false,
94634
- visitor
94635
- );
94636
94783
  statements.push(
94637
94784
  factory2.createReturnStatement(
94638
94785
  emitHelpers().createAwaiterHelper(
94639
- inHasLexicalThisContext(),
94640
- hasLexicalArguments,
94786
+ hasLexicalThis,
94787
+ argumentsExpression,
94641
94788
  promiseConstructor,
94642
- transformAsyncFunctionBodyWorker(node.body, statementOffset)
94789
+ innerParameters,
94790
+ asyncBody
94643
94791
  )
94644
94792
  )
94645
94793
  );
94646
- insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
94647
94794
  const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
94648
94795
  if (emitSuperHelpers) {
94649
94796
  enableSubstitutionForAsyncMethodsWithSuper();
@@ -94653,6 +94800,9 @@ function transformES2017(context) {
94653
94800
  insertStatementsAfterStandardPrologue(statements, [variableStatement]);
94654
94801
  }
94655
94802
  }
94803
+ if (captureLexicalArguments) {
94804
+ insertStatementsAfterStandardPrologue(statements, [createCaptureArgumentsStatement()]);
94805
+ }
94656
94806
  const block = factory2.createBlock(
94657
94807
  statements,
94658
94808
  /*multiLine*/
@@ -94668,24 +94818,23 @@ function transformES2017(context) {
94668
94818
  }
94669
94819
  result = block;
94670
94820
  } else {
94671
- const expression = emitHelpers().createAwaiterHelper(
94672
- inHasLexicalThisContext(),
94673
- hasLexicalArguments,
94821
+ result = emitHelpers().createAwaiterHelper(
94822
+ hasLexicalThis,
94823
+ argumentsExpression,
94674
94824
  promiseConstructor,
94675
- transformAsyncFunctionBodyWorker(node.body)
94825
+ innerParameters,
94826
+ asyncBody
94676
94827
  );
94677
- const declarations = endLexicalEnvironment();
94678
- if (some(declarations)) {
94679
- const block = factory2.converters.convertToFunctionBlock(expression);
94680
- result = factory2.updateBlock(block, setTextRange(factory2.createNodeArray(concatenate(declarations, block.statements)), block.statements));
94681
- } else {
94682
- result = expression;
94828
+ if (captureLexicalArguments) {
94829
+ const block = factory2.converters.convertToFunctionBlock(result);
94830
+ result = factory2.updateBlock(block, factory2.mergeLexicalEnvironment(block.statements, [createCaptureArgumentsStatement()]));
94683
94831
  }
94684
94832
  }
94685
94833
  enclosingFunctionParameterNames = savedEnclosingFunctionParameterNames;
94686
94834
  if (!isArrowFunction2) {
94687
94835
  capturedSuperProperties = savedCapturedSuperProperties;
94688
94836
  hasSuperElementAccess = savedHasSuperElementAccess;
94837
+ lexicalArgumentsBinding = savedLexicalArgumentsBinding;
94689
94838
  }
94690
94839
  return result;
94691
94840
  }
@@ -95801,7 +95950,7 @@ function transformES2018(context) {
95801
95950
  ),
95802
95951
  /*typeParameters*/
95803
95952
  void 0,
95804
- visitParameterList(node.parameters, parameterVisitor, context),
95953
+ enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
95805
95954
  /*type*/
95806
95955
  void 0,
95807
95956
  enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node)
@@ -95822,7 +95971,7 @@ function transformES2018(context) {
95822
95971
  node.name,
95823
95972
  /*typeParameters*/
95824
95973
  void 0,
95825
- visitParameterList(node.parameters, parameterVisitor, context),
95974
+ enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
95826
95975
  /*type*/
95827
95976
  void 0,
95828
95977
  enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node)
@@ -95863,7 +96012,7 @@ function transformES2018(context) {
95863
96012
  node.name,
95864
96013
  /*typeParameters*/
95865
96014
  void 0,
95866
- visitParameterList(node.parameters, parameterVisitor, context),
96015
+ enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionParameterList(node) : visitParameterList(node.parameters, parameterVisitor, context),
95867
96016
  /*type*/
95868
96017
  void 0,
95869
96018
  enclosingFunctionFlags & 2 /* Async */ && enclosingFunctionFlags & 1 /* Generator */ ? transformAsyncGeneratorFunctionBody(node) : transformFunctionBody(node)
@@ -95872,21 +96021,38 @@ function transformES2018(context) {
95872
96021
  parametersWithPrecedingObjectRestOrSpread = savedParametersWithPrecedingObjectRestOrSpread;
95873
96022
  return updated;
95874
96023
  }
96024
+ function transformAsyncGeneratorFunctionParameterList(node) {
96025
+ if (isSimpleParameterList(node.parameters)) {
96026
+ return visitParameterList(node.parameters, visitor, context);
96027
+ }
96028
+ const newParameters = [];
96029
+ for (const parameter of node.parameters) {
96030
+ if (parameter.initializer || parameter.dotDotDotToken) {
96031
+ break;
96032
+ }
96033
+ const newParameter = factory2.createParameterDeclaration(
96034
+ /*modifiers*/
96035
+ void 0,
96036
+ /*dotDotDotToken*/
96037
+ void 0,
96038
+ factory2.getGeneratedNameForNode(parameter.name, 8 /* ReservedInNestedScopes */)
96039
+ );
96040
+ newParameters.push(newParameter);
96041
+ }
96042
+ const newParametersArray = factory2.createNodeArray(newParameters);
96043
+ setTextRange(newParametersArray, node.parameters);
96044
+ return newParametersArray;
96045
+ }
95875
96046
  function transformAsyncGeneratorFunctionBody(node) {
96047
+ const innerParameters = !isSimpleParameterList(node.parameters) ? visitParameterList(node.parameters, visitor, context) : void 0;
95876
96048
  resumeLexicalEnvironment();
95877
- const statements = [];
95878
- const statementOffset = factory2.copyPrologue(
95879
- node.body.statements,
95880
- statements,
95881
- /*ensureUseStrict*/
95882
- false,
95883
- visitor
95884
- );
95885
- appendObjectRestAssignmentsIfNeeded(statements, node);
95886
96049
  const savedCapturedSuperProperties = capturedSuperProperties;
95887
96050
  const savedHasSuperElementAccess = hasSuperElementAccess;
95888
96051
  capturedSuperProperties = /* @__PURE__ */ new Set();
95889
96052
  hasSuperElementAccess = false;
96053
+ const outerStatements = [];
96054
+ let asyncBody = factory2.updateBlock(node.body, visitNodes2(node.body.statements, visitor, isStatement));
96055
+ asyncBody = factory2.updateBlock(asyncBody, factory2.mergeLexicalEnvironment(asyncBody.statements, appendObjectRestAssignmentsIfNeeded(endLexicalEnvironment(), node)));
95890
96056
  const returnStatement = factory2.createReturnStatement(
95891
96057
  emitHelpers().createAsyncGeneratorHelper(
95892
96058
  factory2.createFunctionExpression(
@@ -95896,14 +96062,10 @@ function transformES2018(context) {
95896
96062
  node.name && factory2.getGeneratedNameForNode(node.name),
95897
96063
  /*typeParameters*/
95898
96064
  void 0,
95899
- /*parameters*/
95900
- [],
96065
+ innerParameters ?? [],
95901
96066
  /*type*/
95902
96067
  void 0,
95903
- factory2.updateBlock(
95904
- node.body,
95905
- visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset)
95906
- )
96068
+ asyncBody
95907
96069
  ),
95908
96070
  !!(hierarchyFacts & 1 /* HasLexicalThis */)
95909
96071
  )
@@ -95913,11 +96075,10 @@ function transformES2018(context) {
95913
96075
  enableSubstitutionForAsyncMethodsWithSuper();
95914
96076
  const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
95915
96077
  substitutedSuperAccessors[getNodeId(variableStatement)] = true;
95916
- insertStatementsAfterStandardPrologue(statements, [variableStatement]);
96078
+ insertStatementsAfterStandardPrologue(outerStatements, [variableStatement]);
95917
96079
  }
95918
- statements.push(returnStatement);
95919
- insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
95920
- const block = factory2.updateBlock(node.body, statements);
96080
+ outerStatements.push(returnStatement);
96081
+ const block = factory2.updateBlock(node.body, outerStatements);
95921
96082
  if (emitSuperHelpers && hasSuperElementAccess) {
95922
96083
  if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
95923
96084
  addEmitHelper(block, advancedAsyncSuperHelper);
@@ -125890,7 +126051,9 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
125890
126051
  default:
125891
126052
  const inverted = {};
125892
126053
  option3.type.forEach((value, name2) => {
125893
- (inverted[value] || (inverted[value] = [])).push(name2);
126054
+ if (!(option3.deprecatedKeys && option3.deprecatedKeys.has(name2))) {
126055
+ (inverted[value] || (inverted[value] = [])).push(name2);
126056
+ }
125894
126057
  });
125895
126058
  return Object.entries(inverted).map(([, synonyms]) => synonyms.join("/")).join(", ");
125896
126059
  }