diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 86b2164bb0d74a..d673d7dffc7e60 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -185,6 +185,10 @@ if (!config.noBrowserGlobals) { // https://encoding.spec.whatwg.org/#textdecoder exposeInterface(global, 'TextDecoder', TextDecoder); + // https://w3c.github.io/performance-timeline/ + const { performance } = require('perf_hooks'); + exposeInterface(global, 'performance', performance); + // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope const timers = require('timers'); defineOperation(global, 'clearInterval', timers.clearInterval); diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js index 69aae7f9b7044d..cdc3b6b44010fa 100644 --- a/test/parallel/test-bootstrap-modules.js +++ b/test/parallel/test-bootstrap-modules.js @@ -9,18 +9,19 @@ const common = require('../common'); const assert = require('assert'); const expectedModules = new Set([ - 'Internal Binding errors', 'Internal Binding async_wrap', 'Internal Binding buffer', 'Internal Binding config', 'Internal Binding constants', 'Internal Binding contextify', 'Internal Binding credentials', + 'Internal Binding errors', 'Internal Binding fs', 'Internal Binding inspector', 'Internal Binding module_wrap', 'Internal Binding native_module', 'Internal Binding options', + 'Internal Binding performance', 'Internal Binding process_methods', 'Internal Binding string_decoder', 'Internal Binding task_queue', @@ -29,6 +30,7 @@ const expectedModules = new Set([ 'Internal Binding types', 'Internal Binding url', 'Internal Binding util', + 'NativeModule async_hooks', 'NativeModule buffer', 'NativeModule events', 'NativeModule fs', @@ -63,6 +65,7 @@ const expectedModules = new Set([ 'NativeModule internal/util/types', 'NativeModule internal/validators', 'NativeModule path', + 'NativeModule perf_hooks', 'NativeModule timers', 'NativeModule url', 'NativeModule vm',