typescript 5.5.0-dev.20240322 → 5.5.0-dev.20240324

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.5";
21
- var version = `${versionMajorMinor}.0-dev.20240322`;
21
+ var version = `${versionMajorMinor}.0-dev.20240324`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -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;
package/lib/typescript.js CHANGED
@@ -2326,7 +2326,7 @@ module.exports = __toCommonJS(typescript_exports);
2326
2326
 
2327
2327
  // src/compiler/corePublic.ts
2328
2328
  var versionMajorMinor = "5.5";
2329
- var version = `${versionMajorMinor}.0-dev.20240322`;
2329
+ var version = `${versionMajorMinor}.0-dev.20240324`;
2330
2330
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2331
2331
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2332
2332
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -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;
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": "5.5.0-dev.20240322",
5
+ "version": "5.5.0-dev.20240324",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -112,5 +112,5 @@
112
112
  "node": "20.1.0",
113
113
  "npm": "8.19.4"
114
114
  },
115
- "gitHead": "b75261df74b01dbcb1be1499d66ec3b5647ff40e"
115
+ "gitHead": "3c637400da679883f720894e16c5625b9668f932"
116
116
  }