v8: move process.binding('v8') to internalBinding
PR-URL: https://github.com/nodejs/node/pull/22288 Refs: https://github.com/nodejs/node/issues/22160 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
1744205ff5
commit
892932f9bd
@ -344,7 +344,7 @@
|
||||
// that are whitelisted for access via process.binding()... this is used
|
||||
// to provide a transition path for modules that are being moved over to
|
||||
// internalBinding.
|
||||
const internalBindingWhitelist = new SafeSet(['uv', 'http_parser']);
|
||||
const internalBindingWhitelist = new SafeSet(['uv', 'http_parser', 'v8']);
|
||||
process.binding = function binding(name) {
|
||||
return internalBindingWhitelist.has(name) ?
|
||||
internalBinding(name) :
|
||||
|
@ -56,7 +56,7 @@ const {
|
||||
kSpaceUsedSizeIndex,
|
||||
kSpaceAvailableSizeIndex,
|
||||
kPhysicalSpaceSizeIndex
|
||||
} = process.binding('v8');
|
||||
} = internalBinding('v8');
|
||||
|
||||
const kNumberOfHeapSpaces = kHeapSpaces.length;
|
||||
|
||||
|
@ -200,4 +200,4 @@ void Initialize(Local<Object> target,
|
||||
|
||||
} // namespace node
|
||||
|
||||
NODE_BUILTIN_MODULE_CONTEXT_AWARE(v8, node::Initialize)
|
||||
NODE_MODULE_CONTEXT_AWARE_INTERNAL(v8, node::Initialize)
|
||||
|
@ -8,3 +8,4 @@ const assert = require('assert');
|
||||
// process.binding().
|
||||
assert(process.binding('uv'));
|
||||
assert(process.binding('http_parser'));
|
||||
assert(process.binding('v8'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user