From 1da28fe5145f804fb27fbed155c0680c8e5957fa Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 29 Mar 2021 14:09:59 -0700 Subject: [PATCH] perf_hooks: make performance a global Signed-off-by: James M Snell --- .eslintrc.js | 1 + doc/api/globals.md | 5 +++++ lib/internal/bootstrap/node.js | 23 +++++++++++++++++++++++ test/common/index.js | 4 ++++ test/parallel/test-global.js | 1 + test/parallel/test-performance-global.js | 18 ++++++++++++++++++ test/wpt/test-hr-time.js | 3 +-- 7 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 test/parallel/test-performance-global.js diff --git a/.eslintrc.js b/.eslintrc.js index 3f47ddf45d0534..9579162dcf868c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -331,5 +331,6 @@ module.exports = { globalThis: 'readable', btoa: 'readable', atob: 'readable', + performance: 'readable', }, }; diff --git a/doc/api/globals.md b/doc/api/globals.md index 831ef06bec6094..13e7f63d01b713 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -279,6 +279,10 @@ The `MessagePort` class. See [`MessagePort`][] for more details. This variable may appear to be global but is not. See [`module`][]. +## `performance` + +The [`perf_hooks.performance`][] object. + ## `process`