Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: expose performance interface to global #32790

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ if (!config.noBrowserGlobals) {
// https://url.spec.whatwg.org/#urlsearchparams
exposeInterface(global, 'URLSearchParams', URLSearchParams);

const { performance } = require('perf_hooks');
// https://www.w3.org/TR/performance-timeline/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// https://www.w3.org/TR/performance-timeline/
// https://www.w3.org/TR/performance-timeline/
// https://www.w3.org/TR/hr-time-2/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exposeInterface(global, 'performance', performance);

const {
TextEncoder, TextDecoder
} = require('internal/encoding');
Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-bootstrap-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const expectedModules = new Set([
'Internal Binding module_wrap',
'Internal Binding native_module',
'Internal Binding options',
'Internal Binding performance',
'Internal Binding process_methods',
'Internal Binding report',
'Internal Binding string_decoder',
Expand All @@ -30,6 +31,7 @@ const expectedModules = new Set([
'Internal Binding types',
'Internal Binding url',
'Internal Binding util',
'NativeModule async_hooks',
'NativeModule buffer',
'NativeModule events',
'NativeModule fs',
Expand All @@ -45,6 +47,7 @@ const expectedModules = new Set([
'NativeModule internal/fixed_queue',
'NativeModule internal/fs/dir',
'NativeModule internal/fs/utils',
'NativeModule internal/histogram',
'NativeModule internal/idna',
'NativeModule internal/linkedlist',
'NativeModule internal/modules/run_main',
Expand Down Expand Up @@ -80,8 +83,10 @@ const expectedModules = new Set([
'NativeModule internal/validators',
'NativeModule internal/vm/module',
'NativeModule path',
'NativeModule perf_hooks',
'NativeModule timers',
'NativeModule url',
'NativeModule util',
'NativeModule vm',
]);

Expand Down