@typescript-deploys/pr-build 5.5.0-pr-57912-2 → 5.5.0-pr-57909-8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -2556,43 +2556,49 @@ function formatComparator(comparator) {
2556
2556
  }
2557
2557
 
2558
2558
  // src/compiler/performanceCore.ts
2559
- function hasRequiredAPI(performance2, PerformanceObserver2) {
2560
- return typeof performance2 === "object" && typeof performance2.timeOrigin === "number" && typeof performance2.mark === "function" && typeof performance2.measure === "function" && typeof performance2.now === "function" && typeof performance2.clearMarks === "function" && typeof performance2.clearMeasures === "function" && typeof PerformanceObserver2 === "function";
2561
- }
2562
- function tryGetWebPerformanceHooks() {
2563
- if (typeof performance === "object" && typeof PerformanceObserver === "function" && hasRequiredAPI(performance, PerformanceObserver)) {
2559
+ function tryGetPerformance() {
2560
+ if (isNodeLikeSystem()) {
2561
+ try {
2562
+ const { performance: performance2 } = require("perf_hooks");
2563
+ return {
2564
+ shouldWriteNativeEvents: false,
2565
+ performance: performance2
2566
+ };
2567
+ } catch {
2568
+ }
2569
+ }
2570
+ if (typeof performance === "object") {
2564
2571
  return {
2565
- // For now we always write native performance events when running in the browser. We may
2566
- // make this conditional in the future if we find that native web performance hooks
2567
- // in the browser also slow down compilation.
2568
2572
  shouldWriteNativeEvents: true,
2569
- performance,
2570
- PerformanceObserver
2573
+ performance
2571
2574
  };
2572
2575
  }
2576
+ return void 0;
2573
2577
  }
2574
- function tryGetNodePerformanceHooks() {
2575
- if (isNodeLikeSystem()) {
2576
- try {
2577
- const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
2578
- if (hasRequiredAPI(performance2, PerformanceObserver2)) {
2579
- return {
2580
- // By default, only write native events when generating a cpu profile or using the v8 profiler.
2581
- shouldWriteNativeEvents: false,
2582
- performance: performance2,
2583
- PerformanceObserver: PerformanceObserver2
2584
- };
2585
- }
2586
- } catch {
2587
- }
2578
+ function tryGetPerformanceHooks() {
2579
+ const p = tryGetPerformance();
2580
+ if (!p)
2581
+ return void 0;
2582
+ const { shouldWriteNativeEvents, performance: performance2 } = p;
2583
+ const hooks = {
2584
+ shouldWriteNativeEvents,
2585
+ performance: void 0,
2586
+ performanceTime: void 0
2587
+ };
2588
+ if (typeof performance2.timeOrigin === "number" && typeof performance2.now === "function") {
2589
+ hooks.performanceTime = performance2;
2590
+ }
2591
+ if (hooks.performanceTime && typeof performance2.mark === "function" && typeof performance2.measure === "function" && typeof performance2.clearMarks === "function" && typeof performance2.clearMeasures === "function") {
2592
+ hooks.performance = performance2;
2588
2593
  }
2594
+ return hooks;
2589
2595
  }
2590
- var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks();
2591
- var nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance;
2596
+ var nativePerformanceHooks = tryGetPerformanceHooks();
2597
+ var nativePerformanceTime = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performanceTime;
2592
2598
  function tryGetNativePerformanceHooks() {
2593
2599
  return nativePerformanceHooks;
2594
2600
  }
2595
- var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date();
2601
+ var timestamp = nativePerformanceTime ? () => nativePerformanceTime.now() : Date.now;
2596
2602
 
2597
2603
  // src/compiler/perfLogger.ts
2598
2604
  var etwModule;
@@ -2693,7 +2699,7 @@ function enable(system = sys) {
2693
2699
  if (!enabled) {
2694
2700
  enabled = true;
2695
2701
  perfHooks || (perfHooks = tryGetNativePerformanceHooks());
2696
- if (perfHooks) {
2702
+ if (perfHooks == null ? void 0 : perfHooks.performance) {
2697
2703
  timeorigin = perfHooks.performance.timeOrigin;
2698
2704
  if (perfHooks.shouldWriteNativeEvents || ((_a = system == null ? void 0 : system.cpuProfilingEnabled) == null ? void 0 : _a.call(system)) || (system == null ? void 0 : system.debugMode)) {
2699
2705
  performanceImpl = perfHooks.performance;
@@ -65035,7 +65041,7 @@ function createTypeChecker(host) {
65035
65041
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context.signature) : void 0;
65036
65042
  const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0;
65037
65043
  if (inferredCovariantType || inferredContravariantType) {
65038
- const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType))));
65044
+ const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
65039
65045
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
65040
65046
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
65041
65047
  } else if (context.flags & 1 /* NoDefault */) {
@@ -73898,7 +73904,7 @@ function createTypeChecker(host) {
73898
73904
  /*contextFlags*/
73899
73905
  void 0
73900
73906
  );
73901
- const returnType2 = contextualReturnType && someType(unwrapReturnType(contextualReturnType, functionFlags) || voidType, (t) => !!(t.flags & 32768 /* Undefined */)) ? undefinedType : voidType;
73907
+ const returnType2 = contextualReturnType && (unwrapReturnType(contextualReturnType, functionFlags) || voidType).flags & 32768 /* Undefined */ ? undefinedType : voidType;
73902
73908
  return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, returnType2) : (
73903
73909
  // Async function
73904
73910
  returnType2
package/lib/typescript.js CHANGED
@@ -5262,43 +5262,49 @@ function formatComparator(comparator) {
5262
5262
  }
5263
5263
 
5264
5264
  // src/compiler/performanceCore.ts
5265
- function hasRequiredAPI(performance2, PerformanceObserver2) {
5266
- return typeof performance2 === "object" && typeof performance2.timeOrigin === "number" && typeof performance2.mark === "function" && typeof performance2.measure === "function" && typeof performance2.now === "function" && typeof performance2.clearMarks === "function" && typeof performance2.clearMeasures === "function" && typeof PerformanceObserver2 === "function";
5267
- }
5268
- function tryGetWebPerformanceHooks() {
5269
- if (typeof performance === "object" && typeof PerformanceObserver === "function" && hasRequiredAPI(performance, PerformanceObserver)) {
5265
+ function tryGetPerformance() {
5266
+ if (isNodeLikeSystem()) {
5267
+ try {
5268
+ const { performance: performance2 } = require("perf_hooks");
5269
+ return {
5270
+ shouldWriteNativeEvents: false,
5271
+ performance: performance2
5272
+ };
5273
+ } catch {
5274
+ }
5275
+ }
5276
+ if (typeof performance === "object") {
5270
5277
  return {
5271
- // For now we always write native performance events when running in the browser. We may
5272
- // make this conditional in the future if we find that native web performance hooks
5273
- // in the browser also slow down compilation.
5274
5278
  shouldWriteNativeEvents: true,
5275
- performance,
5276
- PerformanceObserver
5279
+ performance
5277
5280
  };
5278
5281
  }
5282
+ return void 0;
5279
5283
  }
5280
- function tryGetNodePerformanceHooks() {
5281
- if (isNodeLikeSystem()) {
5282
- try {
5283
- const { performance: performance2, PerformanceObserver: PerformanceObserver2 } = require("perf_hooks");
5284
- if (hasRequiredAPI(performance2, PerformanceObserver2)) {
5285
- return {
5286
- // By default, only write native events when generating a cpu profile or using the v8 profiler.
5287
- shouldWriteNativeEvents: false,
5288
- performance: performance2,
5289
- PerformanceObserver: PerformanceObserver2
5290
- };
5291
- }
5292
- } catch {
5293
- }
5284
+ function tryGetPerformanceHooks() {
5285
+ const p = tryGetPerformance();
5286
+ if (!p)
5287
+ return void 0;
5288
+ const { shouldWriteNativeEvents, performance: performance2 } = p;
5289
+ const hooks = {
5290
+ shouldWriteNativeEvents,
5291
+ performance: void 0,
5292
+ performanceTime: void 0
5293
+ };
5294
+ if (typeof performance2.timeOrigin === "number" && typeof performance2.now === "function") {
5295
+ hooks.performanceTime = performance2;
5296
+ }
5297
+ if (hooks.performanceTime && typeof performance2.mark === "function" && typeof performance2.measure === "function" && typeof performance2.clearMarks === "function" && typeof performance2.clearMeasures === "function") {
5298
+ hooks.performance = performance2;
5294
5299
  }
5300
+ return hooks;
5295
5301
  }
5296
- var nativePerformanceHooks = tryGetWebPerformanceHooks() || tryGetNodePerformanceHooks();
5297
- var nativePerformance = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performance;
5302
+ var nativePerformanceHooks = tryGetPerformanceHooks();
5303
+ var nativePerformanceTime = nativePerformanceHooks == null ? void 0 : nativePerformanceHooks.performanceTime;
5298
5304
  function tryGetNativePerformanceHooks() {
5299
5305
  return nativePerformanceHooks;
5300
5306
  }
5301
- var timestamp = nativePerformance ? () => nativePerformance.now() : Date.now ? Date.now : () => +/* @__PURE__ */ new Date();
5307
+ var timestamp = nativePerformanceTime ? () => nativePerformanceTime.now() : Date.now;
5302
5308
 
5303
5309
  // src/compiler/perfLogger.ts
5304
5310
  var etwModule;
@@ -5418,7 +5424,7 @@ function enable(system = sys) {
5418
5424
  if (!enabled) {
5419
5425
  enabled = true;
5420
5426
  perfHooks || (perfHooks = tryGetNativePerformanceHooks());
5421
- if (perfHooks) {
5427
+ if (perfHooks == null ? void 0 : perfHooks.performance) {
5422
5428
  timeorigin = perfHooks.performance.timeOrigin;
5423
5429
  if (perfHooks.shouldWriteNativeEvents || ((_a = system == null ? void 0 : system.cpuProfilingEnabled) == null ? void 0 : _a.call(system)) || (system == null ? void 0 : system.debugMode)) {
5424
5430
  performanceImpl = perfHooks.performance;
@@ -69797,7 +69803,7 @@ function createTypeChecker(host) {
69797
69803
  const inferredCovariantType = inference.candidates ? getCovariantInference(inference, context.signature) : void 0;
69798
69804
  const inferredContravariantType = inference.contraCandidates ? getContravariantInference(inference) : void 0;
69799
69805
  if (inferredCovariantType || inferredContravariantType) {
69800
- const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeSubtypeOf(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeSubtypeOf(t, inferredCovariantType))));
69806
+ const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & 131072 /* Never */) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
69801
69807
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
69802
69808
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
69803
69809
  } else if (context.flags & 1 /* NoDefault */) {
@@ -78660,7 +78666,7 @@ function createTypeChecker(host) {
78660
78666
  /*contextFlags*/
78661
78667
  void 0
78662
78668
  );
78663
- const returnType2 = contextualReturnType && someType(unwrapReturnType(contextualReturnType, functionFlags) || voidType, (t) => !!(t.flags & 32768 /* Undefined */)) ? undefinedType : voidType;
78669
+ const returnType2 = contextualReturnType && (unwrapReturnType(contextualReturnType, functionFlags) || voidType).flags & 32768 /* Undefined */ ? undefinedType : voidType;
78664
78670
  return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, returnType2) : (
78665
78671
  // Async function
78666
78672
  returnType2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.5.0-pr-57912-2",
5
+ "version": "5.5.0-pr-57909-8",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "3b12172f2371bf65ec4109aef8e1ee43c9a2d076"
116
+ "gitHead": "9ec4eed05462d40e11f8f84b69735e6ab4471407"
117
117
  }