Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 445ba9f

Browse filesBrowse files
BeniCheniaddaleax
authored andcommitted
inspector: move process.binding to internalBinding
In places of process.binding('inspector'), migrate code to adapt internalBinding. PR-URL: #24931 Refs: #22160 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Backport-PR-URL: #25446
1 parent d8ba520 commit 445ba9f
Copy full SHA for 445ba9f

File tree

Expand file treeCollapse file tree

12 files changed

+12
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

12 files changed

+12
-10
lines changed
Open diff view settings
Collapse file

‎lib/inspector.js‎

Copy file name to clipboardExpand all lines: lib/inspector.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const {
1111
} = require('internal/errors').codes;
1212
const { validateString } = require('internal/validators');
1313
const util = require('util');
14-
const { Connection, open, url } = process.binding('inspector');
14+
const { Connection, open, url } = internalBinding('inspector');
1515

1616
if (!Connection)
1717
throw new ERR_INSPECTOR_NOT_AVAILABLE();
Collapse file

‎lib/internal/bootstrap/loaders.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/loaders.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ const internalBindingWhitelist = [
9090
'fs_event_wrap',
9191
'http_parser',
9292
'icu',
93+
'inspector',
9394
'js_stream',
9495
'natives',
9596
'pipe_wrap',
Collapse file

‎lib/internal/console/inspector.js‎

Copy file name to clipboardExpand all lines: lib/internal/console/inspector.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const path = require('path');
44
const CJSModule = require('internal/modules/cjs/loader');
55
const { makeRequireFunction } = require('internal/modules/cjs/helpers');
66
const { tryGetCwd } = require('internal/util');
7-
const { addCommandLineAPI, consoleCall } = process.binding('inspector');
7+
const { addCommandLineAPI, consoleCall } = internalBinding('inspector');
88

99
// Wrap a console implemented by Node.js with features from the VM inspector
1010
function addInspectorApis(consoleFromNode, consoleFromVM) {
Collapse file

‎lib/internal/inspector_async_hook.js‎

Copy file name to clipboardExpand all lines: lib/internal/inspector_async_hook.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const inspector = process.binding('inspector');
3+
const inspector = internalBinding('inspector');
44

55
if (!inspector || !inspector.asyncTaskScheduled) {
66
exports.setup = function() {};
Collapse file

‎lib/internal/modules/cjs/helpers.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/helpers.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ if (getOptionValue('--experimental-worker')) {
108108
builtinLibs.sort();
109109
}
110110

111-
if (typeof process.binding('inspector').open === 'function') {
111+
if (typeof internalBinding('inspector').open === 'function') {
112112
builtinLibs.push('inspector');
113113
builtinLibs.sort();
114114
}
Collapse file

‎lib/internal/modules/cjs/loader.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ Module.prototype._compile = function(content, filename) {
706706
// Set breakpoint on module start
707707
if (filename === resolvedArgv) {
708708
delete process._breakFirstLine;
709-
inspectorWrapper = process.binding('inspector').callAndPauseOnStart;
709+
inspectorWrapper = internalBinding('inspector').callAndPauseOnStart;
710710
}
711711
}
712712
var dirname = path.dirname(filename);
Collapse file

‎lib/internal/modules/esm/module_job.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/module_job.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ModuleJob {
7373
try {
7474
if (this.isMain && process._breakFirstLine) {
7575
delete process._breakFirstLine;
76-
const initWrapper = process.binding('inspector').callAndPauseOnStart;
76+
const initWrapper = internalBinding('inspector').callAndPauseOnStart;
7777
initWrapper(this.module.instantiate, this.module);
7878
} else {
7979
this.module.instantiate();
Collapse file

‎lib/internal/process/coverage.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/coverage.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function disableAllAsyncHooks() {
5151
exports.writeCoverage = writeCoverage;
5252

5353
function setup() {
54-
const { Connection } = process.binding('inspector');
54+
const { Connection } = internalBinding('inspector');
5555
if (!Connection) {
5656
console.warn('inspector not enabled');
5757
return;
Collapse file

‎src/inspector_js_api.cc‎

Copy file name to clipboardExpand all lines: src/inspector_js_api.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,5 +315,5 @@ void Initialize(Local<Object> target, Local<Value> unused,
315315
} // namespace inspector
316316
} // namespace node
317317

318-
NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector,
318+
NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector,
319319
node::inspector::Initialize);
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,5 +2138,5 @@ int Start(int argc, char** argv) {
21382138
#if !HAVE_INSPECTOR
21392139
void Initialize() {}
21402140

2141-
NODE_BUILTIN_MODULE_CONTEXT_AWARE(inspector, Initialize)
2141+
NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, Initialize)
21422142
#endif // !HAVE_INSPECTOR

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.