src: move process.binding('performance') to internalBinding
PR-URL: https://github.com/nodejs/node/pull/22029 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
4253e5583b
commit
9f5cc1fc92
@ -84,7 +84,7 @@
|
|||||||
workerThreadSetup.setupStdio();
|
workerThreadSetup.setupStdio();
|
||||||
}
|
}
|
||||||
|
|
||||||
const perf = process.binding('performance');
|
const perf = internalBinding('performance');
|
||||||
const {
|
const {
|
||||||
NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE,
|
NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE,
|
||||||
} = perf.constants;
|
} = perf.constants;
|
||||||
|
@ -5,10 +5,5 @@ process.emitWarning(
|
|||||||
'tracked by any versioning system or deprecation process.',
|
'tracked by any versioning system or deprecation process.',
|
||||||
'internal/test/binding');
|
'internal/test/binding');
|
||||||
|
|
||||||
// These exports should be scoped as specifically as possible
|
|
||||||
// to avoid exposing APIs because even with that warning and
|
|
||||||
// this file being internal people will still try to abuse it.
|
|
||||||
const { internalBinding } = require('internal/bootstrap/loaders');
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
module.exports = {
|
module.exports = { internalBinding };
|
||||||
ModuleWrap: internalBinding('module_wrap').ModuleWrap,
|
|
||||||
};
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const { internalBinding } = require('internal/bootstrap/loaders');
|
||||||
const {
|
const {
|
||||||
PerformanceEntry,
|
PerformanceEntry,
|
||||||
mark: _mark,
|
mark: _mark,
|
||||||
@ -12,7 +13,7 @@ const {
|
|||||||
timeOriginTimestamp,
|
timeOriginTimestamp,
|
||||||
timerify,
|
timerify,
|
||||||
constants
|
constants
|
||||||
} = process.binding('performance');
|
} = internalBinding('performance');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
NODE_PERFORMANCE_ENTRY_TYPE_NODE,
|
NODE_PERFORMANCE_ENTRY_TYPE_NODE,
|
||||||
|
@ -454,4 +454,4 @@ void Initialize(Local<Object> target,
|
|||||||
} // namespace performance
|
} // namespace performance
|
||||||
} // namespace node
|
} // namespace node
|
||||||
|
|
||||||
NODE_BUILTIN_MODULE_CONTEXT_AWARE(performance, node::performance::Initialize)
|
NODE_MODULE_CONTEXT_AWARE_INTERNAL(performance, node::performance::Initialize)
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
require('../common');
|
require('../common');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
|
||||||
const { ModuleWrap } = require('internal/test/binding');
|
const { internalBinding } = require('internal/test/binding');
|
||||||
|
const { ModuleWrap } = internalBinding('module_wrap');
|
||||||
const { getPromiseDetails, isPromise } = process.binding('util');
|
const { getPromiseDetails, isPromise } = process.binding('util');
|
||||||
const setTimeoutAsync = require('util').promisify(setTimeout);
|
const setTimeoutAsync = require('util').promisify(setTimeout);
|
||||||
|
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const {
|
const {
|
||||||
PerformanceObserver
|
PerformanceObserver,
|
||||||
|
constants
|
||||||
} = require('perf_hooks');
|
} = require('perf_hooks');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -12,7 +13,7 @@ const {
|
|||||||
NODE_PERFORMANCE_GC_MINOR,
|
NODE_PERFORMANCE_GC_MINOR,
|
||||||
NODE_PERFORMANCE_GC_INCREMENTAL,
|
NODE_PERFORMANCE_GC_INCREMENTAL,
|
||||||
NODE_PERFORMANCE_GC_WEAKCB
|
NODE_PERFORMANCE_GC_WEAKCB
|
||||||
} = process.binding('performance').constants;
|
} = constants;
|
||||||
|
|
||||||
const kinds = [
|
const kinds = [
|
||||||
NODE_PERFORMANCE_GC_MAJOR,
|
NODE_PERFORMANCE_GC_MAJOR,
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
|
// Flags: --expose-internals
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const Countdown = require('../common/countdown');
|
const Countdown = require('../common/countdown');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
const { internalBinding } = require('internal/test/binding');
|
||||||
const {
|
const {
|
||||||
observerCounts: counts
|
observerCounts: counts
|
||||||
} = process.binding('performance');
|
} = internalBinding('performance');
|
||||||
const {
|
const {
|
||||||
performance,
|
performance,
|
||||||
PerformanceObserver,
|
PerformanceObserver,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user