@typescript-deploys/pr-build 5.1.0-pr-53980-14 → 5.1.0-pr-54052-7

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.es5.d.ts CHANGED
@@ -4329,12 +4329,21 @@ interface Float64Array {
4329
4329
  sort(compareFn?: (a: number, b: number) => number): this;
4330
4330
 
4331
4331
  /**
4332
+ * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements
4332
4333
  * at begin, inclusive, up to end, exclusive.
4333
4334
  * @param begin The index of the beginning of the array.
4334
4335
  * @param end The index of the end of the array.
4335
4336
  */
4336
4337
  subarray(begin?: number, end?: number): Float64Array;
4337
4338
 
4339
+ /**
4340
+ * Converts a number to a string by using the current locale.
4341
+ */
4342
+ toLocaleString(): string;
4343
+
4344
+ /**
4345
+ * Returns a string representation of an array.
4346
+ */
4338
4347
  toString(): string;
4339
4348
 
4340
4349
  /** Returns the primitive value of the specified object. */
@@ -4383,11 +4392,12 @@ declare var Float64Array: Float64ArrayConstructor;
4383
4392
 
4384
4393
  declare namespace Intl {
4385
4394
  interface CollatorOptions {
4386
- usage?: string | undefined;
4387
- localeMatcher?: string | undefined;
4395
+ usage?: "sort" | "search" | undefined;
4396
+ localeMatcher?: "lookup" | "best fit" | undefined;
4388
4397
  numeric?: boolean | undefined;
4389
- caseFirst?: string | undefined;
4390
- sensitivity?: string | undefined;
4398
+ caseFirst?: "upper" | "lower" | "false" | undefined;
4399
+ sensitivity?: "base" | "accent" | "case" | "variant" | undefined;
4400
+ collation?: "big5han" | "compat" | "dict" | "direct" | "ducet" | "emoji" | "eor" | "gb2312" | "phonebk" | "phonetic" | "pinyin" | "reformed" | "searchjl" | "stroke" | "trad" | "unihan" | "zhuyin" | undefined;
4391
4401
  ignorePunctuation?: boolean | undefined;
4392
4402
  }
4393
4403
 
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.1";
21
- var version = `${versionMajorMinor}.0-insiders.20230424`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230428`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -13734,6 +13734,7 @@ function canHaveJSDoc(node) {
13734
13734
  case 171 /* PropertyDeclaration */:
13735
13735
  case 170 /* PropertySignature */:
13736
13736
  case 252 /* ReturnStatement */:
13737
+ case 239 /* SemicolonClassElement */:
13737
13738
  case 177 /* SetAccessor */:
13738
13739
  case 303 /* ShorthandPropertyAssignment */:
13739
13740
  case 304 /* SpreadAssignment */:
@@ -31102,11 +31103,11 @@ var Parser;
31102
31103
  }
31103
31104
  function parseClassElement() {
31104
31105
  const pos = getNodePos();
31106
+ const hasJSDoc = hasPrecedingJSDocComment();
31105
31107
  if (token() === 27 /* SemicolonToken */) {
31106
31108
  nextToken();
31107
- return finishNode(factory2.createSemicolonClassElement(), pos);
31109
+ return withJSDoc(finishNode(factory2.createSemicolonClassElement(), pos), hasJSDoc);
31108
31110
  }
31109
- const hasJSDoc = hasPrecedingJSDocComment();
31110
31111
  const modifiers = parseModifiers(
31111
31112
  /*allowDecorators*/
31112
31113
  true,
@@ -43641,13 +43642,14 @@ function createTypeChecker(host) {
43641
43642
  return diagnostic;
43642
43643
  }
43643
43644
  function isDeprecatedSymbol(symbol) {
43644
- if (length(symbol.declarations) > 1) {
43645
- const parentSymbol = getParentOfSymbol(symbol);
43646
- if (parentSymbol && parentSymbol.flags & 64 /* Interface */) {
43647
- return some(symbol.declarations, (d) => !!(getCombinedNodeFlags(d) & 268435456 /* Deprecated */));
43648
- }
43645
+ const parentSymbol = getParentOfSymbol(symbol);
43646
+ if (parentSymbol && length(symbol.declarations) > 1) {
43647
+ return parentSymbol.flags & 64 /* Interface */ ? some(symbol.declarations, isDeprecatedDeclaration) : every(symbol.declarations, isDeprecatedDeclaration);
43649
43648
  }
43650
- return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 268435456 /* Deprecated */);
43649
+ return !!symbol.valueDeclaration && isDeprecatedDeclaration(symbol.valueDeclaration) || length(symbol.declarations) && every(symbol.declarations, isDeprecatedDeclaration);
43650
+ }
43651
+ function isDeprecatedDeclaration(declaration) {
43652
+ return !!(getCombinedNodeFlags(declaration) & 268435456 /* Deprecated */);
43651
43653
  }
43652
43654
  function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
43653
43655
  const diagnostic = createDiagnosticForNode(location, Diagnostics._0_is_deprecated, deprecatedEntity);
@@ -49273,7 +49275,7 @@ function createTypeChecker(host) {
49273
49275
  if (symbol.flags & 524288 /* TypeAlias */) {
49274
49276
  serializeTypeAlias(symbol, symbolName2, modifierFlags);
49275
49277
  }
49276
- if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
49278
+ if (symbol.flags & (2 /* BlockScopedVariable */ | 1 /* FunctionScopedVariable */ | 4 /* Property */ | 98304 /* Accessor */) && symbol.escapedName !== "export=" /* ExportEquals */ && !(symbol.flags & 4194304 /* Prototype */) && !(symbol.flags & 32 /* Class */) && !(symbol.flags & 8192 /* Method */) && !isConstMergedWithNSPrintableAsSignatureMerge) {
49277
49279
  if (propertyAsAlias) {
49278
49280
  const createdExport = serializeMaybeAliasAssignment(symbol);
49279
49281
  if (createdExport) {
@@ -54540,16 +54542,16 @@ function createTypeChecker(host) {
54540
54542
  if (declaration.kind === 175 /* Constructor */) {
54541
54543
  return getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol));
54542
54544
  }
54545
+ const typeNode = getEffectiveReturnTypeNode(declaration);
54543
54546
  if (isJSDocSignature(declaration)) {
54544
54547
  const root = getJSDocRoot(declaration);
54545
- if (root && isConstructorDeclaration(root.parent)) {
54548
+ if (root && isConstructorDeclaration(root.parent) && !typeNode) {
54546
54549
  return getDeclaredTypeOfClassOrInterface(getMergedSymbol(root.parent.parent.symbol));
54547
54550
  }
54548
54551
  }
54549
54552
  if (isJSDocConstructSignature(declaration)) {
54550
54553
  return getTypeFromTypeNode(declaration.parameters[0].type);
54551
54554
  }
54552
- const typeNode = getEffectiveReturnTypeNode(declaration);
54553
54555
  if (typeNode) {
54554
54556
  return getTypeFromTypeNode(typeNode);
54555
54557
  }
@@ -61669,7 +61671,7 @@ function createTypeChecker(host) {
61669
61671
  }
61670
61672
  }
61671
61673
  }
61672
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
61674
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
61673
61675
  return filtered.flags & 131072 /* Never */ ? target : filtered;
61674
61676
  }
61675
61677
  function isWeakType(type) {
@@ -65807,7 +65809,7 @@ function createTypeChecker(host) {
65807
65809
  markAliasReferenced(symbol, node);
65808
65810
  }
65809
65811
  const localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
65810
- const targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
65812
+ const targetSymbol = resolveAliasWithDeprecationCheck(localOrExportSymbol, node);
65811
65813
  if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
65812
65814
  addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
65813
65815
  }
@@ -67236,18 +67238,10 @@ function createTypeChecker(host) {
67236
67238
  function getJsxManagedAttributesFromLocatedAttributes(context, ns, attributesType) {
67237
67239
  const managedSym = getJsxLibraryManagedAttributes(ns);
67238
67240
  if (managedSym) {
67239
- const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
67240
67241
  const ctorType = getStaticTypeOfReferencedJsxConstructor(context);
67241
- if (managedSym.flags & 524288 /* TypeAlias */) {
67242
- const params = getSymbolLinks(managedSym).typeParameters;
67243
- if (length(params) >= 2) {
67244
- const args = fillMissingTypeArguments([ctorType, attributesType], params, 2, isInJSFile(context));
67245
- return getTypeAliasInstantiation(managedSym, args);
67246
- }
67247
- }
67248
- if (length(declaredManagedType.typeParameters) >= 2) {
67249
- const args = fillMissingTypeArguments([ctorType, attributesType], declaredManagedType.typeParameters, 2, isInJSFile(context));
67250
- return createTypeReference(declaredManagedType, args);
67242
+ const result = instantiateAliasOrInterfaceWithDefaults(managedSym, isInJSFile(context), ctorType, attributesType);
67243
+ if (result) {
67244
+ return result;
67251
67245
  }
67252
67246
  }
67253
67247
  return attributesType;
@@ -68134,6 +68128,9 @@ function createTypeChecker(host) {
68134
68128
  function getJsxLibraryManagedAttributes(jsxNamespace) {
68135
68129
  return jsxNamespace && getSymbol(jsxNamespace.exports, JsxNames.LibraryManagedAttributes, 788968 /* Type */);
68136
68130
  }
68131
+ function getJsxElementTypeSymbol(jsxNamespace) {
68132
+ return jsxNamespace && getSymbol(jsxNamespace.exports, JsxNames.ElementType, 788968 /* Type */);
68133
+ }
68137
68134
  function getJsxElementPropertiesName(jsxNamespace) {
68138
68135
  return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace);
68139
68136
  }
@@ -68240,11 +68237,32 @@ function createTypeChecker(host) {
68240
68237
  }
68241
68238
  }
68242
68239
  function getJsxElementTypeTypeAt(location) {
68243
- const type = getJsxType(JsxNames.ElementType, location);
68244
- if (isErrorType(type))
68240
+ const ns = getJsxNamespaceAt(location);
68241
+ if (!ns)
68242
+ return void 0;
68243
+ const sym = getJsxElementTypeSymbol(ns);
68244
+ if (!sym)
68245
+ return void 0;
68246
+ const type = instantiateAliasOrInterfaceWithDefaults(sym, isInJSFile(location));
68247
+ if (!type || isErrorType(type))
68245
68248
  return void 0;
68246
68249
  return type;
68247
68250
  }
68251
+ function instantiateAliasOrInterfaceWithDefaults(managedSym, inJs, ...typeArguments) {
68252
+ const declaredManagedType = getDeclaredTypeOfSymbol(managedSym);
68253
+ if (managedSym.flags & 524288 /* TypeAlias */) {
68254
+ const params = getSymbolLinks(managedSym).typeParameters;
68255
+ if (length(params) >= typeArguments.length) {
68256
+ const args = fillMissingTypeArguments(typeArguments, params, typeArguments.length, inJs);
68257
+ return length(args) === 0 ? declaredManagedType : getTypeAliasInstantiation(managedSym, args);
68258
+ }
68259
+ }
68260
+ if (length(declaredManagedType.typeParameters) >= typeArguments.length) {
68261
+ const args = fillMissingTypeArguments(typeArguments, declaredManagedType.typeParameters, typeArguments.length, inJs);
68262
+ return createTypeReference(declaredManagedType, args);
68263
+ }
68264
+ return void 0;
68265
+ }
68248
68266
  function getJsxIntrinsicTagNamesAt(location) {
68249
68267
  const intrinsics = getJsxType(JsxNames.IntrinsicElements, location);
68250
68268
  return intrinsics ? getPropertiesOfType(intrinsics) : emptyArray;
@@ -68795,8 +68813,9 @@ function createTypeChecker(host) {
68795
68813
  addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
68796
68814
  }
68797
68815
  } else {
68798
- if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
68799
- addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
68816
+ const targetPropSymbol = resolveAliasWithDeprecationCheck(prop, right);
68817
+ if (isDeprecatedSymbol(targetPropSymbol) && isUncalledFunctionReference(node, targetPropSymbol) && targetPropSymbol.declarations) {
68818
+ addDeprecatedSuggestion(right, targetPropSymbol.declarations, right.escapedText);
68800
68819
  }
68801
68820
  checkPropertyNotUsedBeforeDeclaration(prop, node, right);
68802
68821
  markPropertyAsReferenced(prop, node, isSelfTypeAccess(left, parentSymbol));
@@ -79072,19 +79091,17 @@ function createTypeChecker(host) {
79072
79091
  }
79073
79092
  }
79074
79093
  if (isImportSpecifier(node)) {
79075
- const targetSymbol = checkDeprecatedAliasedSymbol(symbol, node);
79076
- if (isDeprecatedAliasedSymbol(targetSymbol) && targetSymbol.declarations) {
79094
+ const targetSymbol = resolveAliasWithDeprecationCheck(symbol, node);
79095
+ if (isDeprecatedSymbol(targetSymbol) && targetSymbol.declarations) {
79077
79096
  addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName);
79078
79097
  }
79079
79098
  }
79080
79099
  }
79081
79100
  }
79082
- function isDeprecatedAliasedSymbol(symbol) {
79083
- return !!symbol.declarations && every(symbol.declarations, (d) => !!(getCombinedNodeFlags(d) & 268435456 /* Deprecated */));
79084
- }
79085
- function checkDeprecatedAliasedSymbol(symbol, location) {
79086
- if (!(symbol.flags & 2097152 /* Alias */))
79101
+ function resolveAliasWithDeprecationCheck(symbol, location) {
79102
+ if (!(symbol.flags & 2097152 /* Alias */) || isDeprecatedSymbol(symbol) || !getDeclarationOfAliasSymbol(symbol)) {
79087
79103
  return symbol;
79104
+ }
79088
79105
  const targetSymbol = resolveAlias(symbol);
79089
79106
  if (targetSymbol === unknownSymbol)
79090
79107
  return targetSymbol;
@@ -79094,7 +79111,7 @@ function createTypeChecker(host) {
79094
79111
  if (target === targetSymbol)
79095
79112
  break;
79096
79113
  if (target.declarations && length(target.declarations)) {
79097
- if (isDeprecatedAliasedSymbol(target)) {
79114
+ if (isDeprecatedSymbol(target)) {
79098
79115
  addDeprecatedSuggestion(location, target.declarations, target.escapedName);
79099
79116
  break;
79100
79117
  } else {
@@ -101396,12 +101413,56 @@ function transformModule(context) {
101396
101413
  return visitExportDeclaration(node);
101397
101414
  case 276 /* ExportAssignment */:
101398
101415
  return visitExportAssignment(node);
101416
+ case 261 /* FunctionDeclaration */:
101417
+ return visitFunctionDeclaration(node);
101418
+ case 262 /* ClassDeclaration */:
101419
+ return visitClassDeclaration(node);
101420
+ default:
101421
+ return topLevelNestedVisitor(node);
101422
+ }
101423
+ }
101424
+ function topLevelNestedVisitor(node) {
101425
+ switch (node.kind) {
101399
101426
  case 242 /* VariableStatement */:
101400
101427
  return visitVariableStatement(node);
101401
101428
  case 261 /* FunctionDeclaration */:
101402
101429
  return visitFunctionDeclaration(node);
101403
101430
  case 262 /* ClassDeclaration */:
101404
101431
  return visitClassDeclaration(node);
101432
+ case 247 /* ForStatement */:
101433
+ return visitForStatement(
101434
+ node,
101435
+ /*isTopLevel*/
101436
+ true
101437
+ );
101438
+ case 248 /* ForInStatement */:
101439
+ return visitForInStatement(node);
101440
+ case 249 /* ForOfStatement */:
101441
+ return visitForOfStatement(node);
101442
+ case 245 /* DoStatement */:
101443
+ return visitDoStatement(node);
101444
+ case 246 /* WhileStatement */:
101445
+ return visitWhileStatement(node);
101446
+ case 255 /* LabeledStatement */:
101447
+ return visitLabeledStatement(node);
101448
+ case 253 /* WithStatement */:
101449
+ return visitWithStatement(node);
101450
+ case 244 /* IfStatement */:
101451
+ return visitIfStatement(node);
101452
+ case 254 /* SwitchStatement */:
101453
+ return visitSwitchStatement(node);
101454
+ case 268 /* CaseBlock */:
101455
+ return visitCaseBlock(node);
101456
+ case 295 /* CaseClause */:
101457
+ return visitCaseClause(node);
101458
+ case 296 /* DefaultClause */:
101459
+ return visitDefaultClause(node);
101460
+ case 257 /* TryStatement */:
101461
+ return visitTryStatement(node);
101462
+ case 298 /* CatchClause */:
101463
+ return visitCatchClause(node);
101464
+ case 240 /* Block */:
101465
+ return visitBlock(node);
101405
101466
  default:
101406
101467
  return visitor(node);
101407
101468
  }
@@ -101412,7 +101473,11 @@ function transformModule(context) {
101412
101473
  }
101413
101474
  switch (node.kind) {
101414
101475
  case 247 /* ForStatement */:
101415
- return visitForStatement(node);
101476
+ return visitForStatement(
101477
+ node,
101478
+ /*isTopLevel*/
101479
+ false
101480
+ );
101416
101481
  case 243 /* ExpressionStatement */:
101417
101482
  return visitExpressionStatement(node);
101418
101483
  case 216 /* ParenthesizedExpression */:
@@ -101497,15 +101562,177 @@ function transformModule(context) {
101497
101562
  }
101498
101563
  return visitEachChild(node, visitor, context);
101499
101564
  }
101500
- function visitForStatement(node) {
101565
+ function visitForStatement(node, isTopLevel) {
101566
+ if (isTopLevel && node.initializer && isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 3 /* BlockScoped */)) {
101567
+ const exportStatements = appendExportsOfVariableDeclarationList(
101568
+ /*statements*/
101569
+ void 0,
101570
+ node.initializer,
101571
+ /*isForInOrOfInitializer*/
101572
+ false
101573
+ );
101574
+ if (exportStatements) {
101575
+ const statements = [];
101576
+ const varDeclList = visitNode(node.initializer, discardedValueVisitor, isVariableDeclarationList);
101577
+ const varStatement = factory2.createVariableStatement(
101578
+ /*modifiers*/
101579
+ void 0,
101580
+ varDeclList
101581
+ );
101582
+ statements.push(varStatement);
101583
+ addRange(statements, exportStatements);
101584
+ const condition = visitNode(node.condition, visitor, isExpression);
101585
+ const incrementor = visitNode(node.incrementor, discardedValueVisitor, isExpression);
101586
+ const body = visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context);
101587
+ statements.push(factory2.updateForStatement(
101588
+ node,
101589
+ /*initializer*/
101590
+ void 0,
101591
+ condition,
101592
+ incrementor,
101593
+ body
101594
+ ));
101595
+ return statements;
101596
+ }
101597
+ }
101501
101598
  return factory2.updateForStatement(
101502
101599
  node,
101503
101600
  visitNode(node.initializer, discardedValueVisitor, isForInitializer),
101504
101601
  visitNode(node.condition, visitor, isExpression),
101505
101602
  visitNode(node.incrementor, discardedValueVisitor, isExpression),
101506
- visitIterationBody(node.statement, visitor, context)
101603
+ visitIterationBody(node.statement, isTopLevel ? topLevelNestedVisitor : visitor, context)
101604
+ );
101605
+ }
101606
+ function visitForInStatement(node) {
101607
+ if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 3 /* BlockScoped */)) {
101608
+ const exportStatements = appendExportsOfVariableDeclarationList(
101609
+ /*statements*/
101610
+ void 0,
101611
+ node.initializer,
101612
+ /*isForInOrOfInitializer*/
101613
+ true
101614
+ );
101615
+ if (some(exportStatements)) {
101616
+ const initializer = visitNode(node.initializer, discardedValueVisitor, isForInitializer);
101617
+ const expression = visitNode(node.expression, visitor, isExpression);
101618
+ const body = visitIterationBody(node.statement, topLevelNestedVisitor, context);
101619
+ const mergedBody = isBlock(body) ? factory2.updateBlock(body, [...exportStatements, ...body.statements]) : factory2.createBlock(
101620
+ [...exportStatements, body],
101621
+ /*multiLine*/
101622
+ true
101623
+ );
101624
+ return factory2.updateForInStatement(node, initializer, expression, mergedBody);
101625
+ }
101626
+ }
101627
+ return factory2.updateForInStatement(
101628
+ node,
101629
+ visitNode(node.initializer, discardedValueVisitor, isForInitializer),
101630
+ visitNode(node.expression, visitor, isExpression),
101631
+ visitIterationBody(node.statement, topLevelNestedVisitor, context)
101632
+ );
101633
+ }
101634
+ function visitForOfStatement(node) {
101635
+ if (isVariableDeclarationList(node.initializer) && !(node.initializer.flags & 3 /* BlockScoped */)) {
101636
+ const exportStatements = appendExportsOfVariableDeclarationList(
101637
+ /*statements*/
101638
+ void 0,
101639
+ node.initializer,
101640
+ /*isForInOrOfInitializer*/
101641
+ true
101642
+ );
101643
+ const initializer = visitNode(node.initializer, discardedValueVisitor, isForInitializer);
101644
+ const expression = visitNode(node.expression, visitor, isExpression);
101645
+ let body = visitIterationBody(node.statement, topLevelNestedVisitor, context);
101646
+ if (some(exportStatements)) {
101647
+ body = isBlock(body) ? factory2.updateBlock(body, [...exportStatements, ...body.statements]) : factory2.createBlock(
101648
+ [...exportStatements, body],
101649
+ /*multiLine*/
101650
+ true
101651
+ );
101652
+ }
101653
+ return factory2.updateForOfStatement(node, node.awaitModifier, initializer, expression, body);
101654
+ }
101655
+ return factory2.updateForOfStatement(
101656
+ node,
101657
+ node.awaitModifier,
101658
+ visitNode(node.initializer, discardedValueVisitor, isForInitializer),
101659
+ visitNode(node.expression, visitor, isExpression),
101660
+ visitIterationBody(node.statement, topLevelNestedVisitor, context)
101661
+ );
101662
+ }
101663
+ function visitDoStatement(node) {
101664
+ return factory2.updateDoStatement(
101665
+ node,
101666
+ visitIterationBody(node.statement, topLevelNestedVisitor, context),
101667
+ visitNode(node.expression, visitor, isExpression)
101668
+ );
101669
+ }
101670
+ function visitWhileStatement(node) {
101671
+ return factory2.updateWhileStatement(
101672
+ node,
101673
+ visitNode(node.expression, visitor, isExpression),
101674
+ visitIterationBody(node.statement, topLevelNestedVisitor, context)
101675
+ );
101676
+ }
101677
+ function visitLabeledStatement(node) {
101678
+ return factory2.updateLabeledStatement(
101679
+ node,
101680
+ node.label,
101681
+ Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock))
101682
+ );
101683
+ }
101684
+ function visitWithStatement(node) {
101685
+ return factory2.updateWithStatement(
101686
+ node,
101687
+ visitNode(node.expression, visitor, isExpression),
101688
+ Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock))
101689
+ );
101690
+ }
101691
+ function visitIfStatement(node) {
101692
+ return factory2.updateIfStatement(
101693
+ node,
101694
+ visitNode(node.expression, visitor, isExpression),
101695
+ Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)),
101696
+ visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
101697
+ );
101698
+ }
101699
+ function visitSwitchStatement(node) {
101700
+ return factory2.updateSwitchStatement(
101701
+ node,
101702
+ visitNode(node.expression, visitor, isExpression),
101703
+ Debug.checkDefined(visitNode(node.caseBlock, topLevelNestedVisitor, isCaseBlock))
101507
101704
  );
101508
101705
  }
101706
+ function visitCaseBlock(node) {
101707
+ return factory2.updateCaseBlock(
101708
+ node,
101709
+ visitNodes2(node.clauses, topLevelNestedVisitor, isCaseOrDefaultClause)
101710
+ );
101711
+ }
101712
+ function visitCaseClause(node) {
101713
+ return factory2.updateCaseClause(
101714
+ node,
101715
+ visitNode(node.expression, visitor, isExpression),
101716
+ visitNodes2(node.statements, topLevelNestedVisitor, isStatement)
101717
+ );
101718
+ }
101719
+ function visitDefaultClause(node) {
101720
+ return visitEachChild(node, topLevelNestedVisitor, context);
101721
+ }
101722
+ function visitTryStatement(node) {
101723
+ return visitEachChild(node, topLevelNestedVisitor, context);
101724
+ }
101725
+ function visitCatchClause(node) {
101726
+ return factory2.updateCatchClause(
101727
+ node,
101728
+ node.variableDeclaration,
101729
+ Debug.checkDefined(visitNode(node.block, topLevelNestedVisitor, isBlock))
101730
+ );
101731
+ }
101732
+ function visitBlock(node) {
101733
+ node = visitEachChild(node, topLevelNestedVisitor, context);
101734
+ return node;
101735
+ }
101509
101736
  function visitExpressionStatement(node) {
101510
101737
  return factory2.updateExpressionStatement(
101511
101738
  node,
@@ -102298,25 +102525,33 @@ function transformModule(context) {
102298
102525
  return appendExportsOfDeclaration(statements, decl);
102299
102526
  }
102300
102527
  function appendExportsOfVariableStatement(statements, node) {
102528
+ return appendExportsOfVariableDeclarationList(
102529
+ statements,
102530
+ node.declarationList,
102531
+ /*isForInOrOfInitializer*/
102532
+ false
102533
+ );
102534
+ }
102535
+ function appendExportsOfVariableDeclarationList(statements, node, isForInOrOfInitializer) {
102301
102536
  if (currentModuleInfo.exportEquals) {
102302
102537
  return statements;
102303
102538
  }
102304
- for (const decl of node.declarationList.declarations) {
102305
- statements = appendExportsOfBindingElement(statements, decl);
102539
+ for (const decl of node.declarations) {
102540
+ statements = appendExportsOfBindingElement(statements, decl, isForInOrOfInitializer);
102306
102541
  }
102307
102542
  return statements;
102308
102543
  }
102309
- function appendExportsOfBindingElement(statements, decl) {
102544
+ function appendExportsOfBindingElement(statements, decl, isForInOrOfInitializer) {
102310
102545
  if (currentModuleInfo.exportEquals) {
102311
102546
  return statements;
102312
102547
  }
102313
102548
  if (isBindingPattern(decl.name)) {
102314
102549
  for (const element of decl.name.elements) {
102315
102550
  if (!isOmittedExpression(element)) {
102316
- statements = appendExportsOfBindingElement(statements, element);
102551
+ statements = appendExportsOfBindingElement(statements, element, isForInOrOfInitializer);
102317
102552
  }
102318
102553
  }
102319
- } else if (!isGeneratedIdentifier(decl.name) && (!isVariableDeclaration(decl) || decl.initializer)) {
102554
+ } else if (!isGeneratedIdentifier(decl.name) && (!isVariableDeclaration(decl) || decl.initializer || isForInOrOfInitializer)) {
102320
102555
  statements = appendExportsOfDeclaration(statements, decl);
102321
102556
  }
102322
102557
  return statements;
@@ -103425,6 +103660,8 @@ function transformSystemModule(context) {
103425
103660
  return visitLabeledStatement(node);
103426
103661
  case 253 /* WithStatement */:
103427
103662
  return visitWithStatement(node);
103663
+ case 244 /* IfStatement */:
103664
+ return visitIfStatement(node);
103428
103665
  case 254 /* SwitchStatement */:
103429
103666
  return visitSwitchStatement(node);
103430
103667
  case 268 /* CaseBlock */:
@@ -103530,6 +103767,14 @@ function transformSystemModule(context) {
103530
103767
  Debug.checkDefined(visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock))
103531
103768
  );
103532
103769
  }
103770
+ function visitIfStatement(node) {
103771
+ return factory2.updateIfStatement(
103772
+ node,
103773
+ visitNode(node.expression, visitor, isExpression),
103774
+ Debug.checkDefined(visitNode(node.thenStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)),
103775
+ visitNode(node.elseStatement, topLevelNestedVisitor, isStatement, factory2.liftToBlock)
103776
+ );
103777
+ }
103533
103778
  function visitSwitchStatement(node) {
103534
103779
  return factory2.updateSwitchStatement(
103535
103780
  node,
@@ -119615,7 +119860,9 @@ var WatchType = {
119615
119860
  MissingSourceMapFile: "Missing source map file",
119616
119861
  NoopConfigFileForInferredRoot: "Noop Config file for the inferred project root",
119617
119862
  MissingGeneratedFile: "Missing generated file",
119618
- NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation"
119863
+ NodeModulesForModuleSpecifierCache: "node_modules for module specifier cache invalidation",
119864
+ TypingInstallerLocationFile: "File location for typing installer",
119865
+ TypingInstallerLocationDirectory: "Directory location for typing installer"
119619
119866
  };
119620
119867
  function createWatchFactory(host, options) {
119621
119868
  const watchLogLevel = host.trace ? options.extendedDiagnostics ? 2 /* Verbose */ : options.diagnostics ? 1 /* TriggerOnly */ : 0 /* None */ : 0 /* None */;