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

vm: move process.binding('contextify') to internalBinding #22419

Closed
wants to merge 1 commit into from
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
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'));