typescript 4.7.0-dev.20220221 → 4.7.0-dev.20220224

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.
@@ -1631,7 +1631,7 @@
1631
1631
  "Variable_declaration_not_allowed_at_this_location_1440": "Deklarace proměnné není v tomto umístění povolená.",
1632
1632
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Element variadic na pozici {0} ve zdroji neodpovídá elementu na pozici {1} v cíli.",
1633
1633
  "Version_0_6029": "Verze {0}",
1634
- "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file_95110": "Další informace o tomto souboru najdete tady: https://aka.ms/tsconfig.json",
1634
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Další informace o tomto souboru si můžete přečíst na https://aka.ms/tsconfig",
1635
1635
  "WATCH_OPTIONS_6918": "MOŽNOSTI SLEDOVÁNÍ",
1636
1636
  "Watch_and_Build_Modes_6250": "Režimy sledování a sestavování",
1637
1637
  "Watch_input_files_6005": "Sledovat vstupní soubory",
@@ -1631,7 +1631,7 @@
1631
1631
  "Variable_declaration_not_allowed_at_this_location_1440": "No se permite una declaración de variable en esta ubicación.",
1632
1632
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "El elemento variádico en la posición {0} del origen no coincide con el elemento en la posición {1} del destino.",
1633
1633
  "Version_0_6029": "Versión {0}",
1634
- "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file_95110": "Visite https://aka.ms/tsconfig.json para leer más información sobre este archivo",
1634
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Visite https://aka.ms/tsconfig para obtener más información acerca de este archivo",
1635
1635
  "WATCH_OPTIONS_6918": "OPCIONES DE INSPECCIÓN",
1636
1636
  "Watch_and_Build_Modes_6250": "Modos de compilación e inspección",
1637
1637
  "Watch_input_files_6005": "Inspeccionar archivos de entrada.",
@@ -1631,7 +1631,7 @@
1631
1631
  "Variable_declaration_not_allowed_at_this_location_1440": "Dichiarazione di variabile non consentita in questa posizione.",
1632
1632
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "L'elemento variadic alla posizione {0} nell'origine non corrisponde all'elemento alla posizione {1} nella destinazione.",
1633
1633
  "Version_0_6029": "Versione {0}",
1634
- "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file_95110": "Per altre informazioni su questo file, visitare il sito all'indirizzo https://aka.ms/tsconfig.json",
1634
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Per altre informazioni su questo file, visitare https://aka.ms/tsconfig",
1635
1635
  "WATCH_OPTIONS_6918": "OPZIONI DELL'ESPRESSIONE DI CONTROLLO",
1636
1636
  "Watch_and_Build_Modes_6250": "Modalità di espressione di controllo e compilazione",
1637
1637
  "Watch_input_files_6005": "Controlla i file di input.",
@@ -1631,7 +1631,7 @@
1631
1631
  "Variable_declaration_not_allowed_at_this_location_1440": "Deklaracja zmiennej jest niedozwolona w tej lokalizacji.",
1632
1632
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Element ze zmienną liczbą argumentów na pozycji {0} w źródle nie jest zgodny z elementem na pozycji {1} w lokalizacji docelowej.",
1633
1633
  "Version_0_6029": "Wersja {0}",
1634
- "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file_95110": "Odwiedź witrynę https://aka.ms/tsconfig.json, aby dowiedzieć się więcej o tym pliku",
1634
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Odwiedź https://aka.ms/tsconfig, aby dowiedzieć się więcej o tym pliku",
1635
1635
  "WATCH_OPTIONS_6918": "OPCJE OBSERWACJI",
1636
1636
  "Watch_and_Build_Modes_6250": "Tryb wyrażeń kontrolnych i kompilowania",
1637
1637
  "Watch_input_files_6005": "Obserwuj pliki wejściowe.",
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.7";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220221";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220224";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -21878,6 +21878,17 @@ var ts;
21878
21878
  return node;
21879
21879
  }
21880
21880
  ts.ignoreSourceNewlines = ignoreSourceNewlines;
21881
+ function setTypeNode(node, type) {
21882
+ var emitNode = getOrCreateEmitNode(node);
21883
+ emitNode.typeNode = type;
21884
+ return node;
21885
+ }
21886
+ ts.setTypeNode = setTypeNode;
21887
+ function getTypeNode(node) {
21888
+ var _a;
21889
+ return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.typeNode;
21890
+ }
21891
+ ts.getTypeNode = getTypeNode;
21881
21892
  })(ts || (ts = {}));
21882
21893
  var ts;
21883
21894
  (function (ts) {
@@ -58577,6 +58588,9 @@ var ts;
58577
58588
  if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
58578
58589
  var pattern = declaration.parent;
58579
58590
  var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, undefined, location.flowNode);
58591
+ if (narrowedType.flags & 131072) {
58592
+ return neverType;
58593
+ }
58580
58594
  return getBindingElementTypeFromParentType(declaration, narrowedType);
58581
58595
  }
58582
58596
  }
@@ -76718,7 +76732,11 @@ var ts;
76718
76732
  }
76719
76733
  }
76720
76734
  function visitVariableDeclaration(node) {
76721
- return factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
76735
+ var updated = factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName), undefined, undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
76736
+ if (node.type) {
76737
+ ts.setTypeNode(updated.name, node.type);
76738
+ }
76739
+ return updated;
76722
76740
  }
76723
76741
  function visitParenthesizedExpression(node) {
76724
76742
  var innerExpression = ts.skipOuterExpressions(node.expression, ~6);
@@ -91255,10 +91273,11 @@ var ts;
91255
91273
  writeTrailingSemicolon();
91256
91274
  }
91257
91275
  function emitVariableDeclaration(node) {
91276
+ var _a, _b, _c, _d, _e;
91258
91277
  emit(node.name);
91259
91278
  emit(node.exclamationToken);
91260
91279
  emitTypeAnnotation(node.type);
91261
- emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
91280
+ emitInitializer(node.initializer, (_e = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : (_d = (_c = node.name.emitNode) === null || _c === void 0 ? void 0 : _c.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
91262
91281
  }
91263
91282
  function emitVariableDeclarationList(node) {
91264
91283
  writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
@@ -93053,6 +93072,10 @@ var ts;
93053
93072
  commentsDisabled = false;
93054
93073
  }
93055
93074
  emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
93075
+ var typeNode = ts.getTypeNode(node);
93076
+ if (typeNode) {
93077
+ emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
93078
+ }
93056
93079
  }
93057
93080
  function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
93058
93081
  enterComment();
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20220221";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20220224";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -27190,6 +27190,19 @@ var ts;
27190
27190
  return node;
27191
27191
  }
27192
27192
  ts.ignoreSourceNewlines = ignoreSourceNewlines;
27193
+ /* @internal */
27194
+ function setTypeNode(node, type) {
27195
+ var emitNode = getOrCreateEmitNode(node);
27196
+ emitNode.typeNode = type;
27197
+ return node;
27198
+ }
27199
+ ts.setTypeNode = setTypeNode;
27200
+ /* @internal */
27201
+ function getTypeNode(node) {
27202
+ var _a;
27203
+ return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.typeNode;
27204
+ }
27205
+ ts.getTypeNode = getTypeNode;
27193
27206
  })(ts || (ts = {}));
27194
27207
  /* @internal */
27195
27208
  var ts;
@@ -70124,6 +70137,9 @@ var ts;
70124
70137
  if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
70125
70138
  var pattern = declaration.parent;
70126
70139
  var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
70140
+ if (narrowedType.flags & 131072 /* Never */) {
70141
+ return neverType;
70142
+ }
70127
70143
  return getBindingElementTypeFromParentType(declaration, narrowedType);
70128
70144
  }
70129
70145
  }
@@ -91617,9 +91633,13 @@ var ts;
91617
91633
  }
91618
91634
  }
91619
91635
  function visitVariableDeclaration(node) {
91620
- return factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91636
+ var updated = factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91621
91637
  /*exclamationToken*/ undefined,
91622
91638
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
91639
+ if (node.type) {
91640
+ ts.setTypeNode(updated.name, node.type);
91641
+ }
91642
+ return updated;
91623
91643
  }
91624
91644
  function visitParenthesizedExpression(node) {
91625
91645
  var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */);
@@ -110951,10 +110971,11 @@ var ts;
110951
110971
  // Declarations
110952
110972
  //
110953
110973
  function emitVariableDeclaration(node) {
110974
+ var _a, _b, _c, _d, _e;
110954
110975
  emit(node.name);
110955
110976
  emit(node.exclamationToken);
110956
110977
  emitTypeAnnotation(node.type);
110957
- emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
110978
+ emitInitializer(node.initializer, (_e = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : (_d = (_c = node.name.emitNode) === null || _c === void 0 ? void 0 : _c.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
110958
110979
  }
110959
110980
  function emitVariableDeclarationList(node) {
110960
110981
  writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
@@ -112936,6 +112957,10 @@ var ts;
112936
112957
  commentsDisabled = false;
112937
112958
  }
112938
112959
  emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
112960
+ var typeNode = ts.getTypeNode(node);
112961
+ if (typeNode) {
112962
+ emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
112963
+ }
112939
112964
  }
112940
112965
  function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
112941
112966
  enterComment();
@@ -139443,6 +139468,8 @@ var ts;
139443
139468
  return spanForArrowFunction(n);
139444
139469
  case 207 /* CallExpression */:
139445
139470
  return spanForCallExpression(n);
139471
+ case 211 /* ParenthesizedExpression */:
139472
+ return spanForParenthesizedExpression(n);
139446
139473
  }
139447
139474
  function spanForCallExpression(node) {
139448
139475
  if (!node.arguments.length) {
@@ -139456,7 +139483,7 @@ var ts;
139456
139483
  return spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ false, /*useFullStart*/ true);
139457
139484
  }
139458
139485
  function spanForArrowFunction(node) {
139459
- if (ts.isBlock(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
139486
+ if (ts.isBlock(node.body) || ts.isParenthesizedExpression(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
139460
139487
  return undefined;
139461
139488
  }
139462
139489
  var textSpan = ts.createTextSpanFromBounds(node.body.getFullStart(), node.body.getEnd());
@@ -139504,6 +139531,12 @@ var ts;
139504
139531
  function spanForNodeArray(nodeArray) {
139505
139532
  return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined;
139506
139533
  }
139534
+ function spanForParenthesizedExpression(node) {
139535
+ if (ts.positionsAreOnSameLine(node.getStart(), node.getEnd(), sourceFile))
139536
+ return undefined;
139537
+ var textSpan = ts.createTextSpanFromBounds(node.getStart(), node.getEnd());
139538
+ return createOutliningSpan(textSpan, "code" /* Code */, ts.createTextSpanFromNode(node));
139539
+ }
139507
139540
  }
139508
139541
  function functionSpan(node, body, sourceFile) {
139509
139542
  var openToken = tryGetFunctionOpenToken(node, body, sourceFile);
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20220221";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220224";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -27384,6 +27384,19 @@ var ts;
27384
27384
  return node;
27385
27385
  }
27386
27386
  ts.ignoreSourceNewlines = ignoreSourceNewlines;
27387
+ /* @internal */
27388
+ function setTypeNode(node, type) {
27389
+ var emitNode = getOrCreateEmitNode(node);
27390
+ emitNode.typeNode = type;
27391
+ return node;
27392
+ }
27393
+ ts.setTypeNode = setTypeNode;
27394
+ /* @internal */
27395
+ function getTypeNode(node) {
27396
+ var _a;
27397
+ return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.typeNode;
27398
+ }
27399
+ ts.getTypeNode = getTypeNode;
27387
27400
  })(ts || (ts = {}));
27388
27401
  /* @internal */
27389
27402
  var ts;
@@ -70318,6 +70331,9 @@ var ts;
70318
70331
  if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
70319
70332
  var pattern = declaration.parent;
70320
70333
  var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
70334
+ if (narrowedType.flags & 131072 /* Never */) {
70335
+ return neverType;
70336
+ }
70321
70337
  return getBindingElementTypeFromParentType(declaration, narrowedType);
70322
70338
  }
70323
70339
  }
@@ -91811,9 +91827,13 @@ var ts;
91811
91827
  }
91812
91828
  }
91813
91829
  function visitVariableDeclaration(node) {
91814
- return factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91830
+ var updated = factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91815
91831
  /*exclamationToken*/ undefined,
91816
91832
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
91833
+ if (node.type) {
91834
+ ts.setTypeNode(updated.name, node.type);
91835
+ }
91836
+ return updated;
91817
91837
  }
91818
91838
  function visitParenthesizedExpression(node) {
91819
91839
  var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */);
@@ -111145,10 +111165,11 @@ var ts;
111145
111165
  // Declarations
111146
111166
  //
111147
111167
  function emitVariableDeclaration(node) {
111168
+ var _a, _b, _c, _d, _e;
111148
111169
  emit(node.name);
111149
111170
  emit(node.exclamationToken);
111150
111171
  emitTypeAnnotation(node.type);
111151
- emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
111172
+ emitInitializer(node.initializer, (_e = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : (_d = (_c = node.name.emitNode) === null || _c === void 0 ? void 0 : _c.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
111152
111173
  }
111153
111174
  function emitVariableDeclarationList(node) {
111154
111175
  writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
@@ -113130,6 +113151,10 @@ var ts;
113130
113151
  commentsDisabled = false;
113131
113152
  }
113132
113153
  emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
113154
+ var typeNode = ts.getTypeNode(node);
113155
+ if (typeNode) {
113156
+ emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
113157
+ }
113133
113158
  }
113134
113159
  function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
113135
113160
  enterComment();
@@ -140054,6 +140079,8 @@ var ts;
140054
140079
  return spanForArrowFunction(n);
140055
140080
  case 207 /* CallExpression */:
140056
140081
  return spanForCallExpression(n);
140082
+ case 211 /* ParenthesizedExpression */:
140083
+ return spanForParenthesizedExpression(n);
140057
140084
  }
140058
140085
  function spanForCallExpression(node) {
140059
140086
  if (!node.arguments.length) {
@@ -140067,7 +140094,7 @@ var ts;
140067
140094
  return spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ false, /*useFullStart*/ true);
140068
140095
  }
140069
140096
  function spanForArrowFunction(node) {
140070
- if (ts.isBlock(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
140097
+ if (ts.isBlock(node.body) || ts.isParenthesizedExpression(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
140071
140098
  return undefined;
140072
140099
  }
140073
140100
  var textSpan = ts.createTextSpanFromBounds(node.body.getFullStart(), node.body.getEnd());
@@ -140115,6 +140142,12 @@ var ts;
140115
140142
  function spanForNodeArray(nodeArray) {
140116
140143
  return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined;
140117
140144
  }
140145
+ function spanForParenthesizedExpression(node) {
140146
+ if (ts.positionsAreOnSameLine(node.getStart(), node.getEnd(), sourceFile))
140147
+ return undefined;
140148
+ var textSpan = ts.createTextSpanFromBounds(node.getStart(), node.getEnd());
140149
+ return createOutliningSpan(textSpan, "code" /* Code */, ts.createTextSpanFromNode(node));
140150
+ }
140118
140151
  }
140119
140152
  function functionSpan(node, body, sourceFile) {
140120
140153
  var openToken = tryGetFunctionOpenToken(node, body, sourceFile);
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20220221";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220224";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -27384,6 +27384,19 @@ var ts;
27384
27384
  return node;
27385
27385
  }
27386
27386
  ts.ignoreSourceNewlines = ignoreSourceNewlines;
27387
+ /* @internal */
27388
+ function setTypeNode(node, type) {
27389
+ var emitNode = getOrCreateEmitNode(node);
27390
+ emitNode.typeNode = type;
27391
+ return node;
27392
+ }
27393
+ ts.setTypeNode = setTypeNode;
27394
+ /* @internal */
27395
+ function getTypeNode(node) {
27396
+ var _a;
27397
+ return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.typeNode;
27398
+ }
27399
+ ts.getTypeNode = getTypeNode;
27387
27400
  })(ts || (ts = {}));
27388
27401
  /* @internal */
27389
27402
  var ts;
@@ -70318,6 +70331,9 @@ var ts;
70318
70331
  if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
70319
70332
  var pattern = declaration.parent;
70320
70333
  var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
70334
+ if (narrowedType.flags & 131072 /* Never */) {
70335
+ return neverType;
70336
+ }
70321
70337
  return getBindingElementTypeFromParentType(declaration, narrowedType);
70322
70338
  }
70323
70339
  }
@@ -91811,9 +91827,13 @@ var ts;
91811
91827
  }
91812
91828
  }
91813
91829
  function visitVariableDeclaration(node) {
91814
- return factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91830
+ var updated = factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91815
91831
  /*exclamationToken*/ undefined,
91816
91832
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
91833
+ if (node.type) {
91834
+ ts.setTypeNode(updated.name, node.type);
91835
+ }
91836
+ return updated;
91817
91837
  }
91818
91838
  function visitParenthesizedExpression(node) {
91819
91839
  var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */);
@@ -111145,10 +111165,11 @@ var ts;
111145
111165
  // Declarations
111146
111166
  //
111147
111167
  function emitVariableDeclaration(node) {
111168
+ var _a, _b, _c, _d, _e;
111148
111169
  emit(node.name);
111149
111170
  emit(node.exclamationToken);
111150
111171
  emitTypeAnnotation(node.type);
111151
- emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
111172
+ emitInitializer(node.initializer, (_e = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : (_d = (_c = node.name.emitNode) === null || _c === void 0 ? void 0 : _c.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
111152
111173
  }
111153
111174
  function emitVariableDeclarationList(node) {
111154
111175
  writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
@@ -113130,6 +113151,10 @@ var ts;
113130
113151
  commentsDisabled = false;
113131
113152
  }
113132
113153
  emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
113154
+ var typeNode = ts.getTypeNode(node);
113155
+ if (typeNode) {
113156
+ emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
113157
+ }
113133
113158
  }
113134
113159
  function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
113135
113160
  enterComment();
@@ -140054,6 +140079,8 @@ var ts;
140054
140079
  return spanForArrowFunction(n);
140055
140080
  case 207 /* CallExpression */:
140056
140081
  return spanForCallExpression(n);
140082
+ case 211 /* ParenthesizedExpression */:
140083
+ return spanForParenthesizedExpression(n);
140057
140084
  }
140058
140085
  function spanForCallExpression(node) {
140059
140086
  if (!node.arguments.length) {
@@ -140067,7 +140094,7 @@ var ts;
140067
140094
  return spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ false, /*useFullStart*/ true);
140068
140095
  }
140069
140096
  function spanForArrowFunction(node) {
140070
- if (ts.isBlock(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
140097
+ if (ts.isBlock(node.body) || ts.isParenthesizedExpression(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
140071
140098
  return undefined;
140072
140099
  }
140073
140100
  var textSpan = ts.createTextSpanFromBounds(node.body.getFullStart(), node.body.getEnd());
@@ -140115,6 +140142,12 @@ var ts;
140115
140142
  function spanForNodeArray(nodeArray) {
140116
140143
  return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined;
140117
140144
  }
140145
+ function spanForParenthesizedExpression(node) {
140146
+ if (ts.positionsAreOnSameLine(node.getStart(), node.getEnd(), sourceFile))
140147
+ return undefined;
140148
+ var textSpan = ts.createTextSpanFromBounds(node.getStart(), node.getEnd());
140149
+ return createOutliningSpan(textSpan, "code" /* Code */, ts.createTextSpanFromNode(node));
140150
+ }
140118
140151
  }
140119
140152
  function functionSpan(node, body, sourceFile) {
140120
140153
  var openToken = tryGetFunctionOpenToken(node, body, sourceFile);
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20220221";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220224";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -27384,6 +27384,19 @@ var ts;
27384
27384
  return node;
27385
27385
  }
27386
27386
  ts.ignoreSourceNewlines = ignoreSourceNewlines;
27387
+ /* @internal */
27388
+ function setTypeNode(node, type) {
27389
+ var emitNode = getOrCreateEmitNode(node);
27390
+ emitNode.typeNode = type;
27391
+ return node;
27392
+ }
27393
+ ts.setTypeNode = setTypeNode;
27394
+ /* @internal */
27395
+ function getTypeNode(node) {
27396
+ var _a;
27397
+ return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.typeNode;
27398
+ }
27399
+ ts.getTypeNode = getTypeNode;
27387
27400
  })(ts || (ts = {}));
27388
27401
  /* @internal */
27389
27402
  var ts;
@@ -70318,6 +70331,9 @@ var ts;
70318
70331
  if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
70319
70332
  var pattern = declaration.parent;
70320
70333
  var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
70334
+ if (narrowedType.flags & 131072 /* Never */) {
70335
+ return neverType;
70336
+ }
70321
70337
  return getBindingElementTypeFromParentType(declaration, narrowedType);
70322
70338
  }
70323
70339
  }
@@ -91811,9 +91827,13 @@ var ts;
91811
91827
  }
91812
91828
  }
91813
91829
  function visitVariableDeclaration(node) {
91814
- return factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91830
+ var updated = factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91815
91831
  /*exclamationToken*/ undefined,
91816
91832
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
91833
+ if (node.type) {
91834
+ ts.setTypeNode(updated.name, node.type);
91835
+ }
91836
+ return updated;
91817
91837
  }
91818
91838
  function visitParenthesizedExpression(node) {
91819
91839
  var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */);
@@ -111145,10 +111165,11 @@ var ts;
111145
111165
  // Declarations
111146
111166
  //
111147
111167
  function emitVariableDeclaration(node) {
111168
+ var _a, _b, _c, _d, _e;
111148
111169
  emit(node.name);
111149
111170
  emit(node.exclamationToken);
111150
111171
  emitTypeAnnotation(node.type);
111151
- emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
111172
+ emitInitializer(node.initializer, (_e = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : (_d = (_c = node.name.emitNode) === null || _c === void 0 ? void 0 : _c.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
111152
111173
  }
111153
111174
  function emitVariableDeclarationList(node) {
111154
111175
  writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
@@ -113130,6 +113151,10 @@ var ts;
113130
113151
  commentsDisabled = false;
113131
113152
  }
113132
113153
  emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
113154
+ var typeNode = ts.getTypeNode(node);
113155
+ if (typeNode) {
113156
+ emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
113157
+ }
113133
113158
  }
113134
113159
  function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
113135
113160
  enterComment();
@@ -140054,6 +140079,8 @@ var ts;
140054
140079
  return spanForArrowFunction(n);
140055
140080
  case 207 /* CallExpression */:
140056
140081
  return spanForCallExpression(n);
140082
+ case 211 /* ParenthesizedExpression */:
140083
+ return spanForParenthesizedExpression(n);
140057
140084
  }
140058
140085
  function spanForCallExpression(node) {
140059
140086
  if (!node.arguments.length) {
@@ -140067,7 +140094,7 @@ var ts;
140067
140094
  return spanBetweenTokens(openToken, closeToken, node, sourceFile, /*autoCollapse*/ false, /*useFullStart*/ true);
140068
140095
  }
140069
140096
  function spanForArrowFunction(node) {
140070
- if (ts.isBlock(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
140097
+ if (ts.isBlock(node.body) || ts.isParenthesizedExpression(node.body) || ts.positionsAreOnSameLine(node.body.getFullStart(), node.body.getEnd(), sourceFile)) {
140071
140098
  return undefined;
140072
140099
  }
140073
140100
  var textSpan = ts.createTextSpanFromBounds(node.body.getFullStart(), node.body.getEnd());
@@ -140115,6 +140142,12 @@ var ts;
140115
140142
  function spanForNodeArray(nodeArray) {
140116
140143
  return nodeArray.length ? createOutliningSpan(ts.createTextSpanFromRange(nodeArray), "code" /* Code */) : undefined;
140117
140144
  }
140145
+ function spanForParenthesizedExpression(node) {
140146
+ if (ts.positionsAreOnSameLine(node.getStart(), node.getEnd(), sourceFile))
140147
+ return undefined;
140148
+ var textSpan = ts.createTextSpanFromBounds(node.getStart(), node.getEnd());
140149
+ return createOutliningSpan(textSpan, "code" /* Code */, ts.createTextSpanFromNode(node));
140150
+ }
140118
140151
  }
140119
140152
  function functionSpan(node, body, sourceFile) {
140120
140153
  var openToken = tryGetFunctionOpenToken(node, body, sourceFile);
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20220221";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220224";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -27179,6 +27179,19 @@ var ts;
27179
27179
  return node;
27180
27180
  }
27181
27181
  ts.ignoreSourceNewlines = ignoreSourceNewlines;
27182
+ /* @internal */
27183
+ function setTypeNode(node, type) {
27184
+ var emitNode = getOrCreateEmitNode(node);
27185
+ emitNode.typeNode = type;
27186
+ return node;
27187
+ }
27188
+ ts.setTypeNode = setTypeNode;
27189
+ /* @internal */
27190
+ function getTypeNode(node) {
27191
+ var _a;
27192
+ return (_a = node.emitNode) === null || _a === void 0 ? void 0 : _a.typeNode;
27193
+ }
27194
+ ts.getTypeNode = getTypeNode;
27182
27195
  })(ts || (ts = {}));
27183
27196
  /* @internal */
27184
27197
  var ts;
@@ -70113,6 +70126,9 @@ var ts;
70113
70126
  if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
70114
70127
  var pattern = declaration.parent;
70115
70128
  var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, /*flowContainer*/ undefined, location.flowNode);
70129
+ if (narrowedType.flags & 131072 /* Never */) {
70130
+ return neverType;
70131
+ }
70116
70132
  return getBindingElementTypeFromParentType(declaration, narrowedType);
70117
70133
  }
70118
70134
  }
@@ -91606,9 +91622,13 @@ var ts;
91606
91622
  }
91607
91623
  }
91608
91624
  function visitVariableDeclaration(node) {
91609
- return factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91625
+ var updated = factory.updateVariableDeclaration(node, ts.visitNode(node.name, visitor, ts.isBindingName),
91610
91626
  /*exclamationToken*/ undefined,
91611
91627
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
91628
+ if (node.type) {
91629
+ ts.setTypeNode(updated.name, node.type);
91630
+ }
91631
+ return updated;
91612
91632
  }
91613
91633
  function visitParenthesizedExpression(node) {
91614
91634
  var innerExpression = ts.skipOuterExpressions(node.expression, ~6 /* Assertions */);
@@ -110940,10 +110960,11 @@ var ts;
110940
110960
  // Declarations
110941
110961
  //
110942
110962
  function emitVariableDeclaration(node) {
110963
+ var _a, _b, _c, _d, _e;
110943
110964
  emit(node.name);
110944
110965
  emit(node.exclamationToken);
110945
110966
  emitTypeAnnotation(node.type);
110946
- emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
110967
+ emitInitializer(node.initializer, (_e = (_b = (_a = node.type) === null || _a === void 0 ? void 0 : _a.end) !== null && _b !== void 0 ? _b : (_d = (_c = node.name.emitNode) === null || _c === void 0 ? void 0 : _c.typeNode) === null || _d === void 0 ? void 0 : _d.end) !== null && _e !== void 0 ? _e : node.name.end, node, parenthesizer.parenthesizeExpressionForDisallowedComma);
110947
110968
  }
110948
110969
  function emitVariableDeclarationList(node) {
110949
110970
  writeKeyword(ts.isLet(node) ? "let" : ts.isVarConst(node) ? "const" : "var");
@@ -112925,6 +112946,10 @@ var ts;
112925
112946
  commentsDisabled = false;
112926
112947
  }
112927
112948
  emitTrailingCommentsOfNode(node, emitFlags, commentRange.pos, commentRange.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
112949
+ var typeNode = ts.getTypeNode(node);
112950
+ if (typeNode) {
112951
+ emitTrailingCommentsOfNode(node, emitFlags, typeNode.pos, typeNode.end, savedContainerPos, savedContainerEnd, savedDeclarationListContainerEnd);
112952
+ }
112928
112953
  }
112929
112954
  function emitLeadingCommentsOfNode(node, emitFlags, pos, end) {
112930
112955
  enterComment();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.7.0-dev.20220221",
5
+ "version": "4.7.0-dev.20220224",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [