typescript 4.9.0-dev.20220811 → 4.9.0-dev.20220814

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.
@@ -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.20220811";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220814";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -3543,6 +3543,8 @@ var ts;
3543
3543
  typeof performance.mark === "function" &&
3544
3544
  typeof performance.measure === "function" &&
3545
3545
  typeof performance.now === "function" &&
3546
+ typeof performance.clearMarks === "function" &&
3547
+ typeof performance.clearMeasures === "function" &&
3546
3548
  typeof PerformanceObserver === "function";
3547
3549
  }
3548
3550
  function tryGetWebPerformanceHooks() {
@@ -3587,7 +3589,9 @@ var ts;
3587
3589
  if (end === "__performance.measure-fix__") {
3588
3590
  nodePerformance_1.clearMarks("__performance.measure-fix__");
3589
3591
  }
3590
- }
3592
+ },
3593
+ clearMarks: function (name) { return nodePerformance_1.clearMarks(name); },
3594
+ clearMeasures: function (name) { return nodePerformance_1.clearMeasures(name); },
3591
3595
  };
3592
3596
  }
3593
3597
  return {
@@ -3720,6 +3724,30 @@ var ts;
3720
3724
  durations.forEach(function (duration, measureName) { return cb(measureName, duration); });
3721
3725
  }
3722
3726
  performance.forEachMeasure = forEachMeasure;
3727
+ function forEachMark(cb) {
3728
+ marks.forEach(function (_time, markName) { return cb(markName); });
3729
+ }
3730
+ performance.forEachMark = forEachMark;
3731
+ function clearMeasures(name) {
3732
+ if (name !== undefined)
3733
+ durations.delete(name);
3734
+ else
3735
+ durations.clear();
3736
+ performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.clearMeasures(name);
3737
+ }
3738
+ performance.clearMeasures = clearMeasures;
3739
+ function clearMarks(name) {
3740
+ if (name !== undefined) {
3741
+ counts.delete(name);
3742
+ marks.delete(name);
3743
+ }
3744
+ else {
3745
+ counts.clear();
3746
+ marks.clear();
3747
+ }
3748
+ performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.clearMarks(name);
3749
+ }
3750
+ performance.clearMarks = clearMarks;
3723
3751
  /**
3724
3752
  * Indicates whether the performance API is enabled.
3725
3753
  */
@@ -73522,25 +73550,7 @@ var ts;
73522
73550
  }
73523
73551
  function getTypeOfPropertyOfContextualType(type, name, nameType) {
73524
73552
  return mapType(type, function (t) {
73525
- if (t.flags & 2097152 /* Intersection */) {
73526
- var intersection = t;
73527
- var newTypes = ts.mapDefined(intersection.types, getTypeOfConcretePropertyOfContextualType);
73528
- if (newTypes.length > 0) {
73529
- return getIntersectionType(newTypes);
73530
- }
73531
- newTypes = ts.mapDefined(intersection.types, getTypeOfApplicableIndexInfoOfContextualType);
73532
- if (newTypes.length > 0) {
73533
- return getIntersectionType(newTypes);
73534
- }
73535
- return undefined;
73536
- }
73537
- var concretePropertyType = getTypeOfConcretePropertyOfContextualType(t);
73538
- if (concretePropertyType) {
73539
- return concretePropertyType;
73540
- }
73541
- return getTypeOfApplicableIndexInfoOfContextualType(t);
73542
- }, /*noReductions*/ true);
73543
- function getTypeOfConcretePropertyOfContextualType(t) {
73553
+ var _a;
73544
73554
  if (isGenericMappedType(t) && !t.declaration.nameType) {
73545
73555
  var constraint = getConstraintTypeFromMappedType(t);
73546
73556
  var constraintOfConstraint = getBaseConstraintOfType(constraint) || constraint;
@@ -73548,9 +73558,8 @@ var ts;
73548
73558
  if (isTypeAssignableTo(propertyNameType, constraintOfConstraint)) {
73549
73559
  return substituteIndexedMappedType(t, propertyNameType);
73550
73560
  }
73551
- return undefined;
73552
73561
  }
73553
- if (t.flags & 3670016 /* StructuredType */) {
73562
+ else if (t.flags & 3670016 /* StructuredType */) {
73554
73563
  var prop = getPropertyOfType(t, name);
73555
73564
  if (prop) {
73556
73565
  return isCircularMappedProperty(prop) ? undefined : getTypeOfSymbol(prop);
@@ -73561,16 +73570,10 @@ var ts;
73561
73570
  return restType;
73562
73571
  }
73563
73572
  }
73573
+ return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
73564
73574
  }
73565
73575
  return undefined;
73566
- }
73567
- function getTypeOfApplicableIndexInfoOfContextualType(t) {
73568
- var _a;
73569
- if (!(t.flags & 3670016 /* StructuredType */)) {
73570
- return undefined;
73571
- }
73572
- return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType || getStringLiteralType(ts.unescapeLeadingUnderscores(name)))) === null || _a === void 0 ? void 0 : _a.type;
73573
- }
73576
+ }, /*noReductions*/ true);
73574
73577
  }
73575
73578
  // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of
73576
73579
  // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one
@@ -73952,17 +73955,15 @@ var ts;
73952
73955
  var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
73953
73956
  var hostClassType = getReturnTypeOfSignature(sig);
73954
73957
  var libraryManagedAttributeType = void 0;
73955
- if (typeParams && typeParams.length === 1) {
73958
+ if (typeParams) {
73959
+ // apply JSX.IntrinsicClassElements<hostClassType, ...>
73956
73960
  var inferredArgs = fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), ts.isInJSFile(context));
73957
73961
  libraryManagedAttributeType = instantiateType(intrinsicClassAttribs, createTypeMapper(typeParams, inferredArgs));
73958
73962
  }
73959
- else if (typeParams)
73960
- libraryManagedAttributeType = undefined;
73963
+ // or JSX.IntrinsicClassElements has no generics.
73961
73964
  else
73962
73965
  libraryManagedAttributeType = intrinsicClassAttribs;
73963
- if (libraryManagedAttributeType) {
73964
- apparentAttributesType = intersectTypes(libraryManagedAttributeType, apparentAttributesType);
73965
- }
73966
+ apparentAttributesType = intersectTypes(libraryManagedAttributeType, apparentAttributesType);
73966
73967
  }
73967
73968
  var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
73968
73969
  if (!isErrorType(intrinsicAttribs)) {
@@ -126044,6 +126045,7 @@ var ts;
126044
126045
  if (value) {
126045
126046
  return isParsedCommandLine(value) ? value : undefined;
126046
126047
  }
126048
+ ts.performance.mark("SolutionBuilder::beforeConfigFileParsing");
126047
126049
  var diagnostic;
126048
126050
  var parseConfigFileHost = state.parseConfigFileHost, baseCompilerOptions = state.baseCompilerOptions, baseWatchOptions = state.baseWatchOptions, extendedConfigCache = state.extendedConfigCache, host = state.host;
126049
126051
  var parsed;
@@ -126058,6 +126060,8 @@ var ts;
126058
126060
  parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts.noop;
126059
126061
  }
126060
126062
  configFileCache.set(configFilePath, parsed || diagnostic);
126063
+ ts.performance.mark("SolutionBuilder::afterConfigFileParsing");
126064
+ ts.performance.measure("SolutionBuilder::Config file parsing", "SolutionBuilder::beforeConfigFileParsing", "SolutionBuilder::afterConfigFileParsing");
126061
126065
  return parsed;
126062
126066
  }
126063
126067
  function resolveProjectName(state, name) {
@@ -126257,6 +126261,7 @@ var ts;
126257
126261
  if (updateOutputFileStampsPending) {
126258
126262
  updateOutputTimestamps(state, config, projectPath);
126259
126263
  }
126264
+ ts.performance.mark("SolutionBuilder::Timestamps only updates");
126260
126265
  return doneInvalidatedProject(state, projectPath);
126261
126266
  }
126262
126267
  };
@@ -126350,6 +126355,10 @@ var ts;
126350
126355
  };
126351
126356
  function done(cancellationToken, writeFile, customTransformers) {
126352
126357
  executeSteps(BuildStep.Done, cancellationToken, writeFile, customTransformers);
126358
+ if (kind === InvalidatedProjectKind.Build)
126359
+ ts.performance.mark("SolutionBuilder::Projects built");
126360
+ else
126361
+ ts.performance.mark("SolutionBuilder::Bundles updated");
126353
126362
  return doneInvalidatedProject(state, projectPath);
126354
126363
  }
126355
126364
  function withProgramOrUndefined(action) {
@@ -127122,7 +127131,10 @@ var ts;
127122
127131
  if (prior !== undefined) {
127123
127132
  return prior;
127124
127133
  }
127134
+ ts.performance.mark("SolutionBuilder::beforeUpToDateCheck");
127125
127135
  var actual = getUpToDateStatusWorker(state, project, resolvedPath);
127136
+ ts.performance.mark("SolutionBuilder::afterUpToDateCheck");
127137
+ ts.performance.measure("SolutionBuilder::Up-to-date check", "SolutionBuilder::beforeUpToDateCheck", "SolutionBuilder::afterUpToDateCheck");
127126
127138
  state.projectStatus.set(resolvedPath, actual);
127127
127139
  return actual;
127128
127140
  }
@@ -127260,6 +127272,13 @@ var ts;
127260
127272
  }
127261
127273
  }
127262
127274
  function build(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences) {
127275
+ ts.performance.mark("SolutionBuilder::beforeBuild");
127276
+ var result = buildWorker(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences);
127277
+ ts.performance.mark("SolutionBuilder::afterBuild");
127278
+ ts.performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild");
127279
+ return result;
127280
+ }
127281
+ function buildWorker(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences) {
127263
127282
  var buildOrder = getBuildOrderFor(state, project, onlyReferences);
127264
127283
  if (!buildOrder)
127265
127284
  return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -127287,6 +127306,13 @@ var ts;
127287
127306
  : ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
127288
127307
  }
127289
127308
  function clean(state, project, onlyReferences) {
127309
+ ts.performance.mark("SolutionBuilder::beforeClean");
127310
+ var result = cleanWorker(state, project, onlyReferences);
127311
+ ts.performance.mark("SolutionBuilder::afterClean");
127312
+ ts.performance.measure("SolutionBuilder::Clean", "SolutionBuilder::beforeClean", "SolutionBuilder::afterClean");
127313
+ return result;
127314
+ }
127315
+ function cleanWorker(state, project, onlyReferences) {
127290
127316
  var buildOrder = getBuildOrderFor(state, project, onlyReferences);
127291
127317
  if (!buildOrder)
127292
127318
  return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -127360,6 +127386,14 @@ var ts;
127360
127386
  state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, state, changeDetected);
127361
127387
  }
127362
127388
  function buildNextInvalidatedProject(state, changeDetected) {
127389
+ ts.performance.mark("SolutionBuilder::beforeBuild");
127390
+ var buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected);
127391
+ ts.performance.mark("SolutionBuilder::afterBuild");
127392
+ ts.performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild");
127393
+ if (buildOrder)
127394
+ reportErrorSummary(state, buildOrder);
127395
+ }
127396
+ function buildNextInvalidatedProjectWorker(state, changeDetected) {
127363
127397
  state.timerToBuildInvalidatedProject = undefined;
127364
127398
  if (state.reportFileChangeDetected) {
127365
127399
  state.reportFileChangeDetected = false;
@@ -127392,7 +127426,7 @@ var ts;
127392
127426
  }
127393
127427
  }
127394
127428
  disableCache(state);
127395
- reportErrorSummary(state, buildOrder);
127429
+ return buildOrder;
127396
127430
  }
127397
127431
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
127398
127432
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
@@ -127447,6 +127481,7 @@ var ts;
127447
127481
  function startWatching(state, buildOrder) {
127448
127482
  if (!state.watchAllProjectsPending)
127449
127483
  return;
127484
+ ts.performance.mark("SolutionBuilder::beforeWatcherCreation");
127450
127485
  state.watchAllProjectsPending = false;
127451
127486
  for (var _i = 0, _a = getBuildOrderFromAnyBuildOrder(buildOrder); _i < _a.length; _i++) {
127452
127487
  var resolved = _a[_i];
@@ -127464,6 +127499,8 @@ var ts;
127464
127499
  watchPackageJsonFiles(state, resolved, resolvedPath, cfg);
127465
127500
  }
127466
127501
  }
127502
+ ts.performance.mark("SolutionBuilder::afterWatcherCreation");
127503
+ ts.performance.measure("SolutionBuilder::Watcher creation", "SolutionBuilder::beforeWatcherCreation", "SolutionBuilder::afterWatcherCreation");
127467
127504
  }
127468
127505
  function stopWatching(state) {
127469
127506
  ts.clearMap(state.allWatchedConfigFiles, ts.closeFileWatcher);
@@ -1103,6 +1103,7 @@
1103
1103
  "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "项目“{0}”已过期,因为输出文件“{1}”不存在",
1104
1104
  "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381": "项目 \"{0}\" 已过期,因为其输出是使用与当前版本 \"{2}\" 不同的版本 \"{1}\" 生成的",
1105
1105
  "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372": "项目 \"{0}\" 已过期,因为其依赖项 \"{1}\" 的输出已更改",
1106
+ "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401": "项目“{0}”已过期,因为读取文件“{1}”时出错",
1106
1107
  "Project_0_is_up_to_date_6361": "“{0}”项目已是最新",
1107
1108
  "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351": "项目“{0}”是最新的,因为最新的输入“{1}”早于输出“{2}”",
1108
1109
  "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400": "项目“{0}”是最新的,但需要更新早于输入文件的输出文件的时间戳",
@@ -1103,6 +1103,7 @@
1103
1103
  "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "因為輸出檔案 '{1}' 不存在,所以專案 '{0}' 已過期",
1104
1104
  "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381": "因為專案 '{0}' 的輸出使用版本 '{1}' 產生而成,與目前的版本 '{2}' 不同,所以該專案已過期",
1105
1105
  "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372": "因為專案 '{0}' 的相依性 '{1}' 輸出已變更,所以該專案已過期",
1106
+ "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401": "專案 '{0}' 已過期,因為讀取檔案 '{1}' 時發生錯誤",
1106
1107
  "Project_0_is_up_to_date_6361": "專案 '{0}' 為最新狀態",
1107
1108
  "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351": "因為最新的輸入 '{1}' 早於最舊的輸出 '{2}',所以專案 '{0}' 為最新狀態",
1108
1109
  "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400": "專案 '{0}' 為最新狀態,但需要更新比輸入檔案還舊的輸出檔案時間戳記",
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.9.0-dev.20220811",
5
+ "version": "4.9.0-dev.20220814",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [