Skip to content

Commit

Permalink
url: move process.binding('url') to internalBinding
Browse files Browse the repository at this point in the history
PR-URL: #22204
Refs: #22160
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
  • Loading branch information
starkwang committed Sep 7, 2018
1 parent 83c1ba3 commit e917a23
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
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'));

0 comments on commit e917a23

Please sign in to comment.