-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf_hooks: make performance a global
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #37970 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
- Loading branch information
Showing
7 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,5 +331,6 @@ module.exports = { | |
globalThis: 'readable', | ||
btoa: 'readable', | ||
atob: 'readable', | ||
performance: 'readable', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
/* eslint-disable no-global-assign */ | ||
|
||
require('../common'); | ||
|
||
const perf_hooks = require('perf_hooks'); | ||
const { | ||
strictEqual | ||
} = require('assert'); | ||
|
||
const perf = performance; | ||
strictEqual(globalThis.performance, perf_hooks.performance); | ||
performance = undefined; | ||
strictEqual(globalThis.performance, undefined); | ||
strictEqual(typeof perf_hooks.performance.now, 'function'); | ||
|
||
// Restore the value of performance for the known globals check | ||
performance = perf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters