Skip to content

Commit

Permalink
vm: move process.binding('contextify') to internalBinding
Browse files Browse the repository at this point in the history
PR-URL: #22419
Refs: #22160
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell committed Aug 23, 2018
1 parent 3b5c992 commit 4963a04
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
};
}

const { ContextifyScript } = process.binding('contextify');
const { ContextifyScript } = internalBinding('contextify');

// Set up NativeModule
function NativeModule(id) {
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@
'v8',
'stream_wrap',
'signal_wrap',
'crypto']);
'crypto',
'contextify']);
process.binding = function binding(name) {
return internalBindingWhitelist.has(name) ?
internalBinding(name) :
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/vm/source_text_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { internalBinding } = require('internal/bootstrap/loaders');
const { URL } = require('internal/url');
const { isContext } = process.binding('contextify');
const { isContext } = internalBinding('contextify');
const {
ERR_INVALID_ARG_TYPE,
ERR_VM_MODULE_ALREADY_LINKED,
Expand Down
3 changes: 2 additions & 1 deletion lib/vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@

'use strict';

const { internalBinding } = require('internal/bootstrap/loaders');
const {
ContextifyScript,
makeContext,
isContext: _isContext,
} = process.binding('contextify');
} = internalBinding('contextify');
const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes;
const { isUint8Array } = require('internal/util/types');
const { validateInt32, validateUint32 } = require('internal/validators');
Expand Down
2 changes: 1 addition & 1 deletion src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -958,4 +958,4 @@ void Initialize(Local<Object> target,
} // namespace contextify
} // namespace node

NODE_BUILTIN_MODULE_CONTEXT_AWARE(contextify, node::contextify::Initialize)
NODE_MODULE_CONTEXT_AWARE_INTERNAL(contextify, node::contextify::Initialize)
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ assert(process.binding('http_parser'));
assert(process.binding('v8'));
assert(process.binding('stream_wrap'));
assert(process.binding('signal_wrap'));
assert(process.binding('contextify'));

0 comments on commit 4963a04

Please sign in to comment.