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

url: move process.binding('url') to internalBinding #22204

Closed
wants to merge 2 commits 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
3 changes: 2 additions & 1 deletion lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@
'tcp_wrap',
'tls_wrap',
'util',
'async_wrap']);
'async_wrap',
'url']);
process.binding = function binding(name) {
return internalBindingWhitelist.has(name) ?
internalBinding(name) :
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let querystring;
const { platform } = process;
const isWindows = platform === 'win32';

const { internalBinding } = require('internal/bootstrap/loaders');
const {
domainToASCII: _domainToASCII,
domainToUnicode: _domainToUnicode,
Expand All @@ -60,7 +61,7 @@ const {
kPort,
kQuery,
kSchemeStart
} = process.binding('url');
} = internalBinding('url');

const context = Symbol('context');
const cannotBeBase = Symbol('cannot-be-base');
Expand Down
2 changes: 1 addition & 1 deletion src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2420,4 +2420,4 @@ static void Initialize(Local<Object> target,
} // namespace url
} // namespace node

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