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:
James M Snell 2018-08-12 15:27:01 -07:00
parent 1744205ff5
commit 892932f9bd
No known key found for this signature in database
GPG Key ID: 7341B15C070877AC
4 changed files with 4 additions and 3 deletions

View File

@ -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) :

View File

@ -56,7 +56,7 @@ const {
kSpaceUsedSizeIndex,
kSpaceAvailableSizeIndex,
kPhysicalSpaceSizeIndex
} = process.binding('v8');
} = internalBinding('v8');
const kNumberOfHeapSpaces = kHeapSpaces.length;

View File

@ -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)

View File

@ -8,3 +8,4 @@ const assert = require('assert');
// process.binding().
assert(process.binding('uv'));
assert(process.binding('http_parser'));
assert(process.binding('v8'));