typescript 4.8.0-dev.20220805 → 4.8.0-dev.20220806

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/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.8";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220805";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220806";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -61208,12 +61208,15 @@ var ts;
61208
61208
  if (contextualReturnType) {
61209
61209
  var functionFlags = ts.getFunctionFlags(func);
61210
61210
  if (functionFlags & 1) {
61211
- var use = functionFlags & 2 ? 2 : 1;
61212
- var iterationTypes = getIterationTypesOfIterable(contextualReturnType, use, undefined);
61213
- if (!iterationTypes) {
61211
+ var isAsyncGenerator_1 = (functionFlags & 2) !== 0;
61212
+ if (contextualReturnType.flags & 1048576) {
61213
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1, type, isAsyncGenerator_1); });
61214
+ }
61215
+ var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1, contextualReturnType, (functionFlags & 2) !== 0);
61216
+ if (!iterationReturnType) {
61214
61217
  return undefined;
61215
61218
  }
61216
- contextualReturnType = iterationTypes.returnType;
61219
+ contextualReturnType = iterationReturnType;
61217
61220
  }
61218
61221
  if (functionFlags & 2) {
61219
61222
  var contextualAwaitedType = mapType(contextualReturnType, getAwaitedTypeNoAlias);
@@ -61238,9 +61241,13 @@ var ts;
61238
61241
  var functionFlags = ts.getFunctionFlags(func);
61239
61242
  var contextualReturnType = getContextualReturnType(func, contextFlags);
61240
61243
  if (contextualReturnType) {
61244
+ var isAsyncGenerator_2 = (functionFlags & 2) !== 0;
61245
+ if (!node.asteriskToken && contextualReturnType.flags & 1048576) {
61246
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1, type, isAsyncGenerator_2); });
61247
+ }
61241
61248
  return node.asteriskToken
61242
61249
  ? contextualReturnType
61243
- : getIterationTypeOfGeneratorFunctionReturnType(0, contextualReturnType, (functionFlags & 2) !== 0);
61250
+ : getIterationTypeOfGeneratorFunctionReturnType(0, contextualReturnType, isAsyncGenerator_2);
61244
61251
  }
61245
61252
  }
61246
61253
  return undefined;
package/lib/tsserver.js CHANGED
@@ -109,7 +109,7 @@ var ts;
109
109
  // The following is baselined as a literal template type without intervention
110
110
  /** The version of the TypeScript compiler release */
111
111
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
112
- ts.version = ts.versionMajorMinor + ".0-dev.20220805";
112
+ ts.version = ts.versionMajorMinor + ".0-dev.20220806";
113
113
  /* @internal */
114
114
  var Comparison;
115
115
  (function (Comparison) {
@@ -73239,12 +73239,15 @@ var ts;
73239
73239
  if (contextualReturnType) {
73240
73240
  var functionFlags = ts.getFunctionFlags(func);
73241
73241
  if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function
73242
- var use = functionFlags & 2 /* Async */ ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */;
73243
- var iterationTypes = getIterationTypesOfIterable(contextualReturnType, use, /*errorNode*/ undefined);
73244
- if (!iterationTypes) {
73242
+ var isAsyncGenerator_1 = (functionFlags & 2 /* Async */) !== 0;
73243
+ if (contextualReturnType.flags & 1048576 /* Union */) {
73244
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_1); });
73245
+ }
73246
+ var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73247
+ if (!iterationReturnType) {
73245
73248
  return undefined;
73246
73249
  }
73247
- contextualReturnType = iterationTypes.returnType;
73250
+ contextualReturnType = iterationReturnType;
73248
73251
  // falls through to unwrap Promise for AsyncGenerators
73249
73252
  }
73250
73253
  if (functionFlags & 2 /* Async */) { // Async function or AsyncGenerator function
@@ -73271,9 +73274,13 @@ var ts;
73271
73274
  var functionFlags = ts.getFunctionFlags(func);
73272
73275
  var contextualReturnType = getContextualReturnType(func, contextFlags);
73273
73276
  if (contextualReturnType) {
73277
+ var isAsyncGenerator_2 = (functionFlags & 2 /* Async */) !== 0;
73278
+ if (!node.asteriskToken && contextualReturnType.flags & 1048576 /* Union */) {
73279
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_2); });
73280
+ }
73274
73281
  return node.asteriskToken
73275
73282
  ? contextualReturnType
73276
- : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73283
+ : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, isAsyncGenerator_2);
73277
73284
  }
73278
73285
  }
73279
73286
  return undefined;
@@ -303,7 +303,7 @@ var ts;
303
303
  // The following is baselined as a literal template type without intervention
304
304
  /** The version of the TypeScript compiler release */
305
305
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
306
- ts.version = ts.versionMajorMinor + ".0-dev.20220805";
306
+ ts.version = ts.versionMajorMinor + ".0-dev.20220806";
307
307
  /* @internal */
308
308
  var Comparison;
309
309
  (function (Comparison) {
@@ -73433,12 +73433,15 @@ var ts;
73433
73433
  if (contextualReturnType) {
73434
73434
  var functionFlags = ts.getFunctionFlags(func);
73435
73435
  if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function
73436
- var use = functionFlags & 2 /* Async */ ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */;
73437
- var iterationTypes = getIterationTypesOfIterable(contextualReturnType, use, /*errorNode*/ undefined);
73438
- if (!iterationTypes) {
73436
+ var isAsyncGenerator_1 = (functionFlags & 2 /* Async */) !== 0;
73437
+ if (contextualReturnType.flags & 1048576 /* Union */) {
73438
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_1); });
73439
+ }
73440
+ var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73441
+ if (!iterationReturnType) {
73439
73442
  return undefined;
73440
73443
  }
73441
- contextualReturnType = iterationTypes.returnType;
73444
+ contextualReturnType = iterationReturnType;
73442
73445
  // falls through to unwrap Promise for AsyncGenerators
73443
73446
  }
73444
73447
  if (functionFlags & 2 /* Async */) { // Async function or AsyncGenerator function
@@ -73465,9 +73468,13 @@ var ts;
73465
73468
  var functionFlags = ts.getFunctionFlags(func);
73466
73469
  var contextualReturnType = getContextualReturnType(func, contextFlags);
73467
73470
  if (contextualReturnType) {
73471
+ var isAsyncGenerator_2 = (functionFlags & 2 /* Async */) !== 0;
73472
+ if (!node.asteriskToken && contextualReturnType.flags & 1048576 /* Union */) {
73473
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_2); });
73474
+ }
73468
73475
  return node.asteriskToken
73469
73476
  ? contextualReturnType
73470
- : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73477
+ : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, isAsyncGenerator_2);
73471
73478
  }
73472
73479
  }
73473
73480
  return undefined;
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.20220805";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220806";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -73424,12 +73424,15 @@ var ts;
73424
73424
  if (contextualReturnType) {
73425
73425
  var functionFlags = ts.getFunctionFlags(func);
73426
73426
  if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function
73427
- var use = functionFlags & 2 /* Async */ ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */;
73428
- var iterationTypes = getIterationTypesOfIterable(contextualReturnType, use, /*errorNode*/ undefined);
73429
- if (!iterationTypes) {
73427
+ var isAsyncGenerator_1 = (functionFlags & 2 /* Async */) !== 0;
73428
+ if (contextualReturnType.flags & 1048576 /* Union */) {
73429
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_1); });
73430
+ }
73431
+ var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73432
+ if (!iterationReturnType) {
73430
73433
  return undefined;
73431
73434
  }
73432
- contextualReturnType = iterationTypes.returnType;
73435
+ contextualReturnType = iterationReturnType;
73433
73436
  // falls through to unwrap Promise for AsyncGenerators
73434
73437
  }
73435
73438
  if (functionFlags & 2 /* Async */) { // Async function or AsyncGenerator function
@@ -73456,9 +73459,13 @@ var ts;
73456
73459
  var functionFlags = ts.getFunctionFlags(func);
73457
73460
  var contextualReturnType = getContextualReturnType(func, contextFlags);
73458
73461
  if (contextualReturnType) {
73462
+ var isAsyncGenerator_2 = (functionFlags & 2 /* Async */) !== 0;
73463
+ if (!node.asteriskToken && contextualReturnType.flags & 1048576 /* Union */) {
73464
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_2); });
73465
+ }
73459
73466
  return node.asteriskToken
73460
73467
  ? contextualReturnType
73461
- : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73468
+ : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, isAsyncGenerator_2);
73462
73469
  }
73463
73470
  }
73464
73471
  return undefined;
@@ -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.20220805";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220806";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -73424,12 +73424,15 @@ var ts;
73424
73424
  if (contextualReturnType) {
73425
73425
  var functionFlags = ts.getFunctionFlags(func);
73426
73426
  if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function
73427
- var use = functionFlags & 2 /* Async */ ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */;
73428
- var iterationTypes = getIterationTypesOfIterable(contextualReturnType, use, /*errorNode*/ undefined);
73429
- if (!iterationTypes) {
73427
+ var isAsyncGenerator_1 = (functionFlags & 2 /* Async */) !== 0;
73428
+ if (contextualReturnType.flags & 1048576 /* Union */) {
73429
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_1); });
73430
+ }
73431
+ var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73432
+ if (!iterationReturnType) {
73430
73433
  return undefined;
73431
73434
  }
73432
- contextualReturnType = iterationTypes.returnType;
73435
+ contextualReturnType = iterationReturnType;
73433
73436
  // falls through to unwrap Promise for AsyncGenerators
73434
73437
  }
73435
73438
  if (functionFlags & 2 /* Async */) { // Async function or AsyncGenerator function
@@ -73456,9 +73459,13 @@ var ts;
73456
73459
  var functionFlags = ts.getFunctionFlags(func);
73457
73460
  var contextualReturnType = getContextualReturnType(func, contextFlags);
73458
73461
  if (contextualReturnType) {
73462
+ var isAsyncGenerator_2 = (functionFlags & 2 /* Async */) !== 0;
73463
+ if (!node.asteriskToken && contextualReturnType.flags & 1048576 /* Union */) {
73464
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_2); });
73465
+ }
73459
73466
  return node.asteriskToken
73460
73467
  ? contextualReturnType
73461
- : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73468
+ : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, isAsyncGenerator_2);
73462
73469
  }
73463
73470
  }
73464
73471
  return undefined;
@@ -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.20220805";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220806";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -73219,12 +73219,15 @@ var ts;
73219
73219
  if (contextualReturnType) {
73220
73220
  var functionFlags = ts.getFunctionFlags(func);
73221
73221
  if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function
73222
- var use = functionFlags & 2 /* Async */ ? 2 /* AsyncGeneratorReturnType */ : 1 /* GeneratorReturnType */;
73223
- var iterationTypes = getIterationTypesOfIterable(contextualReturnType, use, /*errorNode*/ undefined);
73224
- if (!iterationTypes) {
73222
+ var isAsyncGenerator_1 = (functionFlags & 2 /* Async */) !== 0;
73223
+ if (contextualReturnType.flags & 1048576 /* Union */) {
73224
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_1); });
73225
+ }
73226
+ var iterationReturnType = getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73227
+ if (!iterationReturnType) {
73225
73228
  return undefined;
73226
73229
  }
73227
- contextualReturnType = iterationTypes.returnType;
73230
+ contextualReturnType = iterationReturnType;
73228
73231
  // falls through to unwrap Promise for AsyncGenerators
73229
73232
  }
73230
73233
  if (functionFlags & 2 /* Async */) { // Async function or AsyncGenerator function
@@ -73251,9 +73254,13 @@ var ts;
73251
73254
  var functionFlags = ts.getFunctionFlags(func);
73252
73255
  var contextualReturnType = getContextualReturnType(func, contextFlags);
73253
73256
  if (contextualReturnType) {
73257
+ var isAsyncGenerator_2 = (functionFlags & 2 /* Async */) !== 0;
73258
+ if (!node.asteriskToken && contextualReturnType.flags & 1048576 /* Union */) {
73259
+ contextualReturnType = filterType(contextualReturnType, function (type) { return !!getIterationTypeOfGeneratorFunctionReturnType(1 /* Return */, type, isAsyncGenerator_2); });
73260
+ }
73254
73261
  return node.asteriskToken
73255
73262
  ? contextualReturnType
73256
- : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, (functionFlags & 2 /* Async */) !== 0);
73263
+ : getIterationTypeOfGeneratorFunctionReturnType(0 /* Yield */, contextualReturnType, isAsyncGenerator_2);
73257
73264
  }
73258
73265
  }
73259
73266
  return undefined;
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.8.0-dev.20220805",
5
+ "version": "4.8.0-dev.20220806",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [