iobroker.javascript 8.9.2 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/admin/assets/{createSvgIcon-BdRvDw53.js → createSvgIcon-BQT-7-GS.js} +1 -1
- package/admin/assets/{docs-6na4NFtj.js → docs-BrInh2Pn.js} +2 -2
- package/admin/assets/index-BzKS5vx-.js +1329 -0
- package/admin/assets/index-CfuHVX2B.js +193 -0
- package/admin/assets/index-CuCs5aLs.js +5 -0
- package/admin/assets/index-tExaxF69.js +930 -0
- package/admin/assets/inheritsLoose--KnFDOw1.js +36 -0
- package/admin/assets/{useTheme-Cl1QmYFL.js → useTheme-DF6qfrtI.js} +1 -1
- package/admin/custom/assets/{Components-ChpTW7sE.js → Components-D9kRsHNY.js} +1 -1
- package/admin/custom/assets/{DefaultPropsProvider-CHpMCMgA.js → DefaultPropsProvider-9qubdy-V.js} +2 -2
- package/admin/custom/assets/{FilledInput-CtcQVKyj.js → FilledInput-BpuM_GyB.js} +1 -1
- package/admin/custom/assets/Tabs-CvEv0KOT.js +138 -0
- package/admin/custom/assets/ThemeProvider-DZTpMR8n.js +29 -0
- package/admin/custom/assets/{createSvgIcon-C_vAELFU.js → createSvgIcon-BQThUM-f.js} +1 -1
- package/admin/custom/assets/hostInit-CrAs5YZS.js +1 -1
- package/admin/custom/assets/index-BXmu6lpn.js +904 -0
- package/admin/custom/assets/{index-DwsbskQy.js → index-DIWNdd4a.js} +1 -1
- package/admin/custom/assets/index-DZqbj5K4.js +55 -0
- package/admin/custom/assets/{index-D5apCzjJ.js → index-Dbe-II7_.js} +6 -6
- package/admin/custom/assets/index-sawv1cUe.js +1399 -0
- package/admin/custom/assets/{virtualExposes-BPncCdUy.js → virtualExposes-BMKIjWrE.js} +2 -2
- package/admin/custom/customComponents.js +2 -2
- package/admin/custom/i18n/de.json +29 -29
- package/admin/custom/i18n/es.json +29 -29
- package/admin/custom/i18n/fr.json +29 -29
- package/admin/custom/i18n/it.json +29 -29
- package/admin/custom/i18n/nl.json +29 -29
- package/admin/custom/i18n/pl.json +29 -29
- package/admin/custom/i18n/pt.json +29 -29
- package/admin/custom/i18n/ru.json +29 -29
- package/admin/custom/i18n/uk.json +29 -29
- package/admin/custom/i18n/zh-cn.json +29 -29
- package/admin/google-blockly/blockly_compressed.js +875 -887
- package/admin/google-blockly/blocks_compressed.js +38 -41
- package/admin/google-blockly/javascript_compressed.js +19 -54
- package/admin/google-blockly/media/delete-icon.svg +1 -0
- package/admin/google-blockly/media/foldout-icon.svg +1 -0
- package/admin/google-blockly/media/resize-handle.svg +3 -0
- package/admin/i18n/de.json +61 -0
- package/admin/i18n/en.json +61 -0
- package/admin/i18n/es.json +61 -0
- package/admin/i18n/fr.json +61 -0
- package/admin/i18n/it.json +61 -0
- package/admin/i18n/nl.json +61 -0
- package/admin/i18n/pl.json +61 -0
- package/admin/i18n/pt.json +61 -0
- package/admin/i18n/ru.json +61 -0
- package/admin/i18n/uk.json +61 -0
- package/admin/i18n/zh-cn.json +61 -0
- package/admin/jsonConfig.json +2 -0
- package/admin/mf-manifest.json +1 -1
- package/admin/remoteEntry.js +2 -2
- package/admin/tab.html +4 -4
- package/admin/vsFont/README.md +1 -1
- package/admin/vsFont/createJson.js +1 -1
- package/build-backend/lib/consts.js +346 -0
- package/build-backend/lib/consts.js.map +1 -0
- package/build-backend/lib/convert.js +120 -0
- package/build-backend/lib/convert.js.map +1 -0
- package/build-backend/lib/debug.js +163 -0
- package/build-backend/lib/debug.js.map +1 -0
- package/{lib → build-backend/lib}/debugger.js +261 -232
- package/build-backend/lib/debugger.js.map +1 -0
- package/build-backend/lib/eventObj.js +177 -0
- package/build-backend/lib/eventObj.js.map +1 -0
- package/build-backend/lib/inspect.js +728 -0
- package/build-backend/lib/inspect.js.map +1 -0
- package/build-backend/lib/javascript.d.ts +1972 -0
- package/{lib → build-backend/lib}/mirror.js +185 -182
- package/build-backend/lib/mirror.js.map +1 -0
- package/build-backend/lib/nodeModulesManagement.js +25 -0
- package/build-backend/lib/nodeModulesManagement.js.map +1 -0
- package/build-backend/lib/patternCompareFunctions.js +321 -0
- package/build-backend/lib/patternCompareFunctions.js.map +1 -0
- package/build-backend/lib/protectFs.js +477 -0
- package/build-backend/lib/protectFs.js.map +1 -0
- package/build-backend/lib/request.js +89 -0
- package/build-backend/lib/request.js.map +1 -0
- package/{lib → build-backend/lib}/sandbox.js +2046 -1852
- package/build-backend/lib/sandbox.js.map +1 -0
- package/build-backend/lib/scheduler.js +553 -0
- package/build-backend/lib/scheduler.js.map +1 -0
- package/build-backend/lib/tools.js +183 -0
- package/build-backend/lib/tools.js.map +1 -0
- package/build-backend/lib/typescriptSettings.js +39 -0
- package/build-backend/lib/typescriptSettings.js.map +1 -0
- package/build-backend/lib/typescriptTools.js +435 -0
- package/build-backend/lib/typescriptTools.js.map +1 -0
- package/build-backend/lib/utils.js +66 -0
- package/build-backend/lib/utils.js.map +1 -0
- package/{lib → build-backend/lib}/words.js +23 -30
- package/build-backend/lib/words.js.map +1 -0
- package/build-backend/main.js +2671 -0
- package/build-backend/main.js.map +1 -0
- package/build-backend/types.d.ts +742 -0
- package/docs/de/README.md +1 -1
- package/docs/en/README.md +1 -1
- package/docs/en/javascript.md +10 -6
- package/docs/en/upgrade-guide.md +5 -2
- package/docs/ru/README.md +1 -1
- package/install/installTypings.js +34 -47
- package/io-package.json +14 -14
- package/package.json +14 -14
- package/admin/assets/index-DCkkMRRa.js +0 -1335
- package/admin/assets/index-DJfSBoBB.js +0 -192
- package/admin/assets/index-DTiA4WdK.js +0 -930
- package/admin/assets/index-qABB1JVe.js +0 -5
- package/admin/assets/inheritsLoose-BW-3V39H.js +0 -36
- package/admin/custom/assets/Tabs-C1KOyWRi.js +0 -137
- package/admin/custom/assets/ThemeProvider-Buvx5nSd.js +0 -29
- package/admin/custom/assets/index-BGCRznKh.js +0 -904
- package/admin/custom/assets/index-DfBPYXqA.js +0 -55
- package/admin/custom/assets/index-jIr6kOLK.js +0 -1398
- package/admin/i18n/de/flat.txt +0 -427
- package/admin/i18n/de/translations.json +0 -429
- package/admin/i18n/en/flat.txt +0 -427
- package/admin/i18n/en/translations.json +0 -429
- package/admin/i18n/es/flat.txt +0 -427
- package/admin/i18n/es/translations.json +0 -429
- package/admin/i18n/flat.txt +0 -427
- package/admin/i18n/fr/flat.txt +0 -427
- package/admin/i18n/fr/translations.json +0 -429
- package/admin/i18n/it/flat.txt +0 -427
- package/admin/i18n/it/translations.json +0 -429
- package/admin/i18n/nl/flat.txt +0 -427
- package/admin/i18n/nl/translations.json +0 -429
- package/admin/i18n/pl/flat.txt +0 -427
- package/admin/i18n/pl/translations.json +0 -429
- package/admin/i18n/pt/flat.txt +0 -427
- package/admin/i18n/pt/translations.json +0 -429
- package/admin/i18n/ru/flat.txt +0 -427
- package/admin/i18n/ru/translations.json +0 -429
- package/admin/i18n/uk/flat.txt +0 -427
- package/admin/i18n/uk/translations.json +0 -429
- package/admin/i18n/zh-cn/flat.txt +0 -427
- package/admin/i18n/zh-cn/translations.json +0 -429
- package/lib/adapter-config.d.ts +0 -16
- package/lib/consts.js +0 -83
- package/lib/convert.js +0 -106
- package/lib/debug.js +0 -154
- package/lib/eventObj.js +0 -201
- package/lib/inspect.js +0 -688
- package/lib/javascript.d.ts +0 -1858
- package/lib/nodeModulesManagement.js +0 -26
- package/lib/patternCompareFunctions.js +0 -391
- package/lib/protectFs.js +0 -401
- package/lib/request.js +0 -72
- package/lib/scheduler.js +0 -447
- package/lib/tools.js +0 -192
- package/lib/typescriptSettings.js +0 -44
- package/lib/typescriptTools.js +0 -529
- package/lib/utils.js +0 -87
- package/main.js +0 -2653
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NodeInspector = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Node.js contributors. All rights reserved.
|
|
9
|
+
*
|
|
10
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
* of this software and associated documentation files (the "Software"), to
|
|
12
|
+
* deal in the Software without restriction, including without limitation the
|
|
13
|
+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
14
|
+
* sell copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
* furnished to do so, subject to the following conditions:
|
|
16
|
+
*
|
|
17
|
+
* The above copyright notice and this permission notice shall be included in
|
|
18
|
+
* all copies or substantial portions of the Software.
|
|
19
|
+
*
|
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
25
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
26
|
+
* IN THE SOFTWARE.
|
|
27
|
+
*/
|
|
28
|
+
const node_child_process_1 = require("node:child_process");
|
|
29
|
+
const node_events_1 = require("node:events");
|
|
30
|
+
const node_net_1 = require("node:net");
|
|
31
|
+
const node_util_1 = require("node:util");
|
|
32
|
+
const node_path_1 = require("node:path");
|
|
33
|
+
const node_fs_1 = require("node:fs");
|
|
34
|
+
// @ts-expect-error no types available
|
|
35
|
+
const inspect_client_1 = __importDefault(require("node-inspect/lib/internal/inspect_client"));
|
|
36
|
+
const debugger_1 = __importDefault(require("./debugger"));
|
|
37
|
+
const breakOnStart = process.argv.includes('--breakOnStart');
|
|
38
|
+
const debuglog = (0, node_util_1.debuglog)('inspect');
|
|
39
|
+
let inspector;
|
|
40
|
+
let scriptToDebug = ''; // script.js.yy
|
|
41
|
+
let instanceToDebug = ''; // adapter.X
|
|
42
|
+
let alreadyPausedOnFirstLine = false;
|
|
43
|
+
class StartupError extends Error {
|
|
44
|
+
constructor(message) {
|
|
45
|
+
super(message);
|
|
46
|
+
this.name = 'StartupError';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function portIsFree(host, port, timeout = 9999) {
|
|
50
|
+
if (port === 0) {
|
|
51
|
+
// Binding to a random port.
|
|
52
|
+
return Promise.resolve();
|
|
53
|
+
}
|
|
54
|
+
const retryDelay = 150;
|
|
55
|
+
let didTimeOut = false;
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
didTimeOut = true;
|
|
59
|
+
reject(new StartupError(`Timeout (${timeout}) waiting for ${host}:${port} to be free`));
|
|
60
|
+
}, timeout);
|
|
61
|
+
function pingPort() {
|
|
62
|
+
if (didTimeOut) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const socket = (0, node_net_1.connect)(port, host);
|
|
66
|
+
let didRetry = false;
|
|
67
|
+
function retry() {
|
|
68
|
+
if (!didRetry && !didTimeOut) {
|
|
69
|
+
didRetry = true;
|
|
70
|
+
setTimeout(pingPort, retryDelay);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
socket.on('error', (error) => {
|
|
74
|
+
if (error.code === 'ECONNREFUSED') {
|
|
75
|
+
resolve();
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
retry();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
socket.on('connect', () => {
|
|
82
|
+
socket.destroy();
|
|
83
|
+
retry();
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
pingPort();
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function runScript(script, scriptArgs, inspectHost, inspectPort, childPrint) {
|
|
90
|
+
script = (0, node_path_1.normalize)(script);
|
|
91
|
+
return portIsFree(inspectHost, inspectPort).then(() => {
|
|
92
|
+
return new Promise(resolve => {
|
|
93
|
+
const args = [breakOnStart ? `--inspect-brk=${inspectPort}` : `--inspect=${inspectPort}`].concat([script], scriptArgs || []);
|
|
94
|
+
const child = (0, node_child_process_1.spawn)(process.execPath, args);
|
|
95
|
+
child.stdout.setEncoding('utf8');
|
|
96
|
+
child.stderr.setEncoding('utf8');
|
|
97
|
+
child.stdout.on('data', childPrint);
|
|
98
|
+
child.stderr.on('data', text => childPrint(text, true));
|
|
99
|
+
let output = '';
|
|
100
|
+
function waitForListenHint(text) {
|
|
101
|
+
output += text;
|
|
102
|
+
const res = /Debugger listening on ws:\/\/\[?(.+?)]?:(\d+)\//.exec(output);
|
|
103
|
+
if (res) {
|
|
104
|
+
const host = res[1];
|
|
105
|
+
const port = Number.parseInt(res[2]);
|
|
106
|
+
child.stderr.removeListener('data', waitForListenHint);
|
|
107
|
+
resolve([child, port, host]);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
child.stderr.on('data', waitForListenHint);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function createAgentProxy(domain, client) {
|
|
115
|
+
const agent = new node_events_1.EventEmitter();
|
|
116
|
+
agent.then = (...args) => {
|
|
117
|
+
// TODO: potentially fetch the protocol and pretty-print it here.
|
|
118
|
+
const descriptor = {
|
|
119
|
+
[node_util_1.inspect.custom](_depth, { stylize }) {
|
|
120
|
+
return stylize(`[Agent ${domain}]`, 'special');
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
return Promise.resolve(descriptor).then(...args);
|
|
124
|
+
};
|
|
125
|
+
return new Proxy(agent, {
|
|
126
|
+
get(target, name) {
|
|
127
|
+
if (name in target) {
|
|
128
|
+
return target[name];
|
|
129
|
+
}
|
|
130
|
+
return function callVirtualMethod(params) {
|
|
131
|
+
return client.callMethod(`${domain}.${name}`, params);
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
class NodeInspector {
|
|
137
|
+
options;
|
|
138
|
+
stdin;
|
|
139
|
+
stdout;
|
|
140
|
+
scripts;
|
|
141
|
+
delayedContext;
|
|
142
|
+
paused;
|
|
143
|
+
child;
|
|
144
|
+
_runScript;
|
|
145
|
+
client;
|
|
146
|
+
Debugger;
|
|
147
|
+
HeapProfiler;
|
|
148
|
+
Profiler;
|
|
149
|
+
Runtime;
|
|
150
|
+
handleDebugEvent;
|
|
151
|
+
mainScriptId;
|
|
152
|
+
mainFile;
|
|
153
|
+
repl;
|
|
154
|
+
constructor(options, stdin, stdout) {
|
|
155
|
+
this.options = options;
|
|
156
|
+
this.stdin = stdin;
|
|
157
|
+
this.stdout = stdout;
|
|
158
|
+
this.scripts = {};
|
|
159
|
+
this.delayedContext = null;
|
|
160
|
+
this.paused = true;
|
|
161
|
+
this.child = null;
|
|
162
|
+
if (options.script) {
|
|
163
|
+
this._runScript = runScript.bind(null, options.script, options.scriptArgs, options.host, options.port, this.childPrint.bind(this));
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this._runScript = () => Promise.resolve([null, options.port, options.host]);
|
|
167
|
+
}
|
|
168
|
+
this.client = new inspect_client_1.default();
|
|
169
|
+
this.Debugger = createAgentProxy('Debugger', this.client);
|
|
170
|
+
this.HeapProfiler = createAgentProxy('HeapProfiler', this.client);
|
|
171
|
+
this.Profiler = createAgentProxy('Profiler', this.client);
|
|
172
|
+
this.Runtime = createAgentProxy('Runtime', this.client);
|
|
173
|
+
this.handleDebugEvent = (fullName, params) => {
|
|
174
|
+
const [domain, name] = fullName.split('.');
|
|
175
|
+
if (domain === 'Debugger' && name === 'scriptParsed') {
|
|
176
|
+
// console.log(`Parsed: ${params.url}`);
|
|
177
|
+
if ((scriptToDebug && params.url.includes(scriptToDebug)) ||
|
|
178
|
+
(instanceToDebug && params.url.includes(instanceToDebug))) {
|
|
179
|
+
console.log(`My scriptID: ${params.scriptId}`);
|
|
180
|
+
this.mainScriptId = params.scriptId;
|
|
181
|
+
this.mainFile = params.url.replace('file:///', '');
|
|
182
|
+
// load text of a script
|
|
183
|
+
this.scripts[this.mainScriptId] = this.Debugger.getScriptSource({
|
|
184
|
+
scriptId: this.mainScriptId,
|
|
185
|
+
}).then((script) => ({
|
|
186
|
+
script: script.scriptSource,
|
|
187
|
+
scriptId: this.mainScriptId,
|
|
188
|
+
}));
|
|
189
|
+
// sometimes the pause event comes before scriptParsed
|
|
190
|
+
if (this.delayedContext) {
|
|
191
|
+
console.log('Send to debugger: readyToDebug');
|
|
192
|
+
void this.scripts[this.mainScriptId]?.then(data => {
|
|
193
|
+
// console.log('Send to debugger: readyToDebug ' + JSON.stringify(data));
|
|
194
|
+
sendToHost({
|
|
195
|
+
cmd: 'readyToDebug',
|
|
196
|
+
scriptId: this.mainScriptId,
|
|
197
|
+
script: data.script,
|
|
198
|
+
context: this.delayedContext,
|
|
199
|
+
url: this.mainFile,
|
|
200
|
+
});
|
|
201
|
+
this.delayedContext = null;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
else if (domain === 'Debugger' && name === 'resumed') {
|
|
208
|
+
this.Debugger.emit(name, params);
|
|
209
|
+
sendToHost({ cmd: 'resumed', context: params });
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
else if (domain === 'Debugger' && name === 'paused') {
|
|
213
|
+
console.log(`PAUSED!! ${alreadyPausedOnFirstLine}`);
|
|
214
|
+
if (!alreadyPausedOnFirstLine && params.reason === 'exception') {
|
|
215
|
+
// ignore all exceptions by start
|
|
216
|
+
this.Debugger.resume();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
//console.warn(fullName + ': => \n' + JSON.stringify(params, null, 2));
|
|
220
|
+
this.Debugger.emit(name, params);
|
|
221
|
+
if (!alreadyPausedOnFirstLine) {
|
|
222
|
+
alreadyPausedOnFirstLine = true;
|
|
223
|
+
// sometimes the pause event comes before scriptParsed
|
|
224
|
+
if (this.mainScriptId && this.scripts[this.mainScriptId]) {
|
|
225
|
+
void this.scripts[this.mainScriptId]?.then(data => sendToHost({
|
|
226
|
+
cmd: 'readyToDebug',
|
|
227
|
+
scriptId: data.scriptId,
|
|
228
|
+
script: data.script,
|
|
229
|
+
context: params,
|
|
230
|
+
url: this.mainFile,
|
|
231
|
+
}));
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
// store context to send it later when script ID will be known
|
|
235
|
+
this.delayedContext = params;
|
|
236
|
+
console.log('PAUSED, but no scriptId');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
// this.scripts[params.loca]
|
|
241
|
+
// .then(data =>
|
|
242
|
+
sendToHost({ cmd: 'paused', context: params });
|
|
243
|
+
}
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (domain === 'Runtime') {
|
|
247
|
+
//console.warn(fullName + ': => \n' + JSON.stringify(params, null, 2));
|
|
248
|
+
}
|
|
249
|
+
if (domain === 'Runtime' && name === 'consoleAPICalled') {
|
|
250
|
+
const text = params.args[0].value;
|
|
251
|
+
if (instanceToDebug) {
|
|
252
|
+
sendToHost({
|
|
253
|
+
cmd: 'log',
|
|
254
|
+
severity: params.type === 'warning' ? 'warn' : 'error',
|
|
255
|
+
text,
|
|
256
|
+
ts: Date.now(),
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
else if (text.includes(`$$${scriptToDebug}$$`)) {
|
|
260
|
+
console.log(`${fullName} [${params.executionContextId}]: => ${text}`);
|
|
261
|
+
const [severity, _text] = text.split(`$$${scriptToDebug}$$`);
|
|
262
|
+
sendToHost({
|
|
263
|
+
cmd: 'log',
|
|
264
|
+
severity: severity,
|
|
265
|
+
text: _text,
|
|
266
|
+
ts: params.args[1] && params.args[1].value ? params.args[1].value : Date.now(),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
else if (params.type === 'warning' || params.type === 'error') {
|
|
270
|
+
sendToHost({
|
|
271
|
+
cmd: 'log',
|
|
272
|
+
severity: params.type === 'warning' ? 'warn' : 'error',
|
|
273
|
+
text,
|
|
274
|
+
ts: Date.now(),
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
else if (domain === 'Runtime' && (params.id === 2 || params.executionContextId === 2)) {
|
|
280
|
+
if (name === 'executionContextCreated') {
|
|
281
|
+
console.warn(`${fullName}: =>\n${JSON.stringify(params, null, 2)}`);
|
|
282
|
+
}
|
|
283
|
+
else if (name === 'executionContextDestroyed') {
|
|
284
|
+
console.warn(`${fullName}: =>\n${JSON.stringify(params, null, 2)}`);
|
|
285
|
+
sendToHost({ cmd: 'finished', context: params });
|
|
286
|
+
}
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
else if (domain === 'Runtime' &&
|
|
290
|
+
name === 'executionContextDestroyed' &&
|
|
291
|
+
params.executionContextId === 1) {
|
|
292
|
+
sendToHost({ cmd: 'finished', context: params });
|
|
293
|
+
console.log('Exited!');
|
|
294
|
+
setTimeout(() => process.exit(125), 200);
|
|
295
|
+
}
|
|
296
|
+
else if (domain === 'Debugger' && name === 'scriptFailedToParse') {
|
|
297
|
+
// ignore
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
console.warn(`${fullName}: =>\n${JSON.stringify(params, null, 2)}`);
|
|
301
|
+
/*if (domain in this) {
|
|
302
|
+
this[domain].emit(name, params);
|
|
303
|
+
}*/
|
|
304
|
+
};
|
|
305
|
+
this.client.on('debugEvent', this.handleDebugEvent);
|
|
306
|
+
const startRepl = (0, debugger_1.default)(this);
|
|
307
|
+
// Handle all possible exits
|
|
308
|
+
process.on('exit', () => this.killChild());
|
|
309
|
+
process.once('SIGTERM', process.exit.bind(process, 0));
|
|
310
|
+
process.once('SIGHUP', process.exit.bind(process, 0));
|
|
311
|
+
this.run()
|
|
312
|
+
.then(() => startRepl())
|
|
313
|
+
.then(repl => {
|
|
314
|
+
this.repl = repl;
|
|
315
|
+
this.repl.on('exit', () => process.exit(0));
|
|
316
|
+
this.paused = false;
|
|
317
|
+
})
|
|
318
|
+
.then(null, error => process.nextTick(() => {
|
|
319
|
+
throw error;
|
|
320
|
+
}));
|
|
321
|
+
}
|
|
322
|
+
suspendReplWhile(fn) {
|
|
323
|
+
if (this.repl) {
|
|
324
|
+
this.repl.pause();
|
|
325
|
+
}
|
|
326
|
+
this.stdin.pause();
|
|
327
|
+
this.paused = true;
|
|
328
|
+
return new Promise(resolve => resolve(fn()))
|
|
329
|
+
.then(() => {
|
|
330
|
+
this.paused = false;
|
|
331
|
+
if (this.repl) {
|
|
332
|
+
this.repl.resume();
|
|
333
|
+
this.repl.displayPrompt();
|
|
334
|
+
}
|
|
335
|
+
this.stdin.resume();
|
|
336
|
+
})
|
|
337
|
+
.then(null, error => process.nextTick(() => {
|
|
338
|
+
throw error;
|
|
339
|
+
}));
|
|
340
|
+
}
|
|
341
|
+
killChild() {
|
|
342
|
+
this.client.reset();
|
|
343
|
+
if (this.child) {
|
|
344
|
+
this.child.kill();
|
|
345
|
+
this.child = null;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
run() {
|
|
349
|
+
this.killChild();
|
|
350
|
+
return this._runScript().then(([child, port, host]) => {
|
|
351
|
+
this.child = child;
|
|
352
|
+
let connectionAttempts = 0;
|
|
353
|
+
const attemptConnect = () => {
|
|
354
|
+
++connectionAttempts;
|
|
355
|
+
debuglog('connection attempt #%d', connectionAttempts);
|
|
356
|
+
this.stdout.write('.');
|
|
357
|
+
return this.client.connect(port, host).then(() => {
|
|
358
|
+
debuglog('connection established');
|
|
359
|
+
this.stdout.write(' ok');
|
|
360
|
+
}, (error) => {
|
|
361
|
+
debuglog('connect failed', error);
|
|
362
|
+
// If it's failed to connect 10 times, then print a failed message
|
|
363
|
+
if (connectionAttempts >= 10) {
|
|
364
|
+
this.stdout.write(' failed to connect, please retry\n');
|
|
365
|
+
process.exit(1);
|
|
366
|
+
}
|
|
367
|
+
return new Promise(resolve => setTimeout(resolve, 500)).then(attemptConnect);
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
this.print(`connecting to ${host}:${port} ..`, true);
|
|
371
|
+
return attemptConnect();
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
clearLine() {
|
|
375
|
+
if (this.stdout.isTTY) {
|
|
376
|
+
this.stdout.cursorTo(0);
|
|
377
|
+
this.stdout.clearLine(1);
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
this.stdout.write('\b');
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
print(text, oneLine = false) {
|
|
384
|
+
this.clearLine();
|
|
385
|
+
this.stdout.write(oneLine ? text : `${text}\n`);
|
|
386
|
+
}
|
|
387
|
+
childPrint(text, isError) {
|
|
388
|
+
isError &&
|
|
389
|
+
this.print(text
|
|
390
|
+
.toString()
|
|
391
|
+
.split(/\r\n|\r|\n/g)
|
|
392
|
+
.filter((chunk) => !!chunk)
|
|
393
|
+
.map((chunk) => `< ${chunk}`)
|
|
394
|
+
.join('\n'));
|
|
395
|
+
if (!this.paused) {
|
|
396
|
+
this.repl?.displayPrompt(true);
|
|
397
|
+
}
|
|
398
|
+
if (/Waiting for the debugger to disconnect\.\.\.\n$/.test(text)) {
|
|
399
|
+
this.killChild();
|
|
400
|
+
sendToHost({ cmd: 'finished', text });
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
exports.NodeInspector = NodeInspector;
|
|
405
|
+
function parseArgv([target, ...args]) {
|
|
406
|
+
let host = '127.0.0.1';
|
|
407
|
+
let port = 9229;
|
|
408
|
+
let isRemote = false;
|
|
409
|
+
let script = target;
|
|
410
|
+
let scriptArgs = args;
|
|
411
|
+
const hostMatch = target.match(/^([^:]+):(\d+)$/);
|
|
412
|
+
const portMatch = target.match(/^--port=(\d+)$/);
|
|
413
|
+
if (hostMatch) {
|
|
414
|
+
// Connecting to remote debugger
|
|
415
|
+
// `node-inspect localhost:9229`
|
|
416
|
+
host = hostMatch[1];
|
|
417
|
+
port = parseInt(hostMatch[2], 10);
|
|
418
|
+
isRemote = true;
|
|
419
|
+
script = null;
|
|
420
|
+
}
|
|
421
|
+
else if (portMatch) {
|
|
422
|
+
// start debugee on custom port
|
|
423
|
+
// `node inspect --port=9230 script.js`
|
|
424
|
+
port = parseInt(portMatch[1], 10);
|
|
425
|
+
script = args[0];
|
|
426
|
+
scriptArgs = args.slice(1);
|
|
427
|
+
}
|
|
428
|
+
else if (args.length === 1 && /^\d+$/.test(args[0]) && target === '-p') {
|
|
429
|
+
// Start debugger against a given pid
|
|
430
|
+
const pid = parseInt(args[0], 10);
|
|
431
|
+
try {
|
|
432
|
+
// Windows does not support UNIX signals. To enable debugging, you can use an undocumented API function
|
|
433
|
+
// https://github.com/node-inspector/node-inspector?tab=readme-ov-file#windows
|
|
434
|
+
// @ts-expect-error undocumented function
|
|
435
|
+
process._debugProcess(pid);
|
|
436
|
+
}
|
|
437
|
+
catch (e) {
|
|
438
|
+
if (e && e.code === 'ESRCH') {
|
|
439
|
+
console.error(`Target process: ${pid} doesn't exist.`);
|
|
440
|
+
process.exit(1);
|
|
441
|
+
}
|
|
442
|
+
throw e;
|
|
443
|
+
}
|
|
444
|
+
script = null;
|
|
445
|
+
isRemote = true;
|
|
446
|
+
}
|
|
447
|
+
return {
|
|
448
|
+
host,
|
|
449
|
+
port,
|
|
450
|
+
isRemote,
|
|
451
|
+
script,
|
|
452
|
+
scriptArgs,
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
function startInspect(argv = process.argv.slice(2), stdin = process.stdin, stdout = process.stdout) {
|
|
456
|
+
/*
|
|
457
|
+
if (argv.length < 1) {
|
|
458
|
+
const invokedAs = runAsStandalone ? 'node-inspect' : `${process.argv0} ${process.argv[1]}`;
|
|
459
|
+
|
|
460
|
+
console.error(`Usage: ${invokedAs} script.js`);
|
|
461
|
+
console.error(` ${invokedAs} <host>:<port>`);
|
|
462
|
+
console.error(` ${invokedAs} -p <pid>`);
|
|
463
|
+
process.exit(1);
|
|
464
|
+
}
|
|
465
|
+
*/
|
|
466
|
+
const options = parseArgv(argv);
|
|
467
|
+
inspector = new NodeInspector(options, stdin, stdout);
|
|
468
|
+
stdin.resume();
|
|
469
|
+
function handleUnexpectedError(e) {
|
|
470
|
+
if (!(e instanceof StartupError)) {
|
|
471
|
+
console.error('There was an internal error in node-inspect. Please report this bug.');
|
|
472
|
+
console.error(e.message);
|
|
473
|
+
console.error(e.stack);
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
console.error(e.message);
|
|
477
|
+
}
|
|
478
|
+
inspector.child?.kill();
|
|
479
|
+
process.exit(1);
|
|
480
|
+
}
|
|
481
|
+
process.on('uncaughtException', handleUnexpectedError);
|
|
482
|
+
}
|
|
483
|
+
function extractErrorMessage(stack) {
|
|
484
|
+
if (!stack) {
|
|
485
|
+
return '<unknown>';
|
|
486
|
+
}
|
|
487
|
+
const m = stack.match(/^\w+: ([^\n]+)/);
|
|
488
|
+
return m ? m[1] : stack;
|
|
489
|
+
}
|
|
490
|
+
function convertResultToError(result) {
|
|
491
|
+
const { className, description } = result;
|
|
492
|
+
const err = new Error(extractErrorMessage(description));
|
|
493
|
+
err.stack = description;
|
|
494
|
+
Object.defineProperty(err, 'name', { value: className });
|
|
495
|
+
return err;
|
|
496
|
+
}
|
|
497
|
+
process.on('message', (message) => {
|
|
498
|
+
if (typeof message === 'string') {
|
|
499
|
+
try {
|
|
500
|
+
message = JSON.parse(message);
|
|
501
|
+
}
|
|
502
|
+
catch {
|
|
503
|
+
return console.error(`Cannot parse: ${JSON.stringify(message)}`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
processCommand(message);
|
|
507
|
+
});
|
|
508
|
+
sendToHost({ cmd: 'ready' });
|
|
509
|
+
function processCommand(data) {
|
|
510
|
+
console.log(`[DEBUGGER]: processCommand: ${JSON.stringify(data)}`);
|
|
511
|
+
if (data.cmd === 'start') {
|
|
512
|
+
scriptToDebug = data.scriptName;
|
|
513
|
+
// we can request the script by name or iobroker instance to debug
|
|
514
|
+
if (scriptToDebug) {
|
|
515
|
+
startInspect([
|
|
516
|
+
`${__dirname}/../main.js`,
|
|
517
|
+
(data.instance || 0).toString(),
|
|
518
|
+
'--debug',
|
|
519
|
+
'--debugScript',
|
|
520
|
+
scriptToDebug,
|
|
521
|
+
]);
|
|
522
|
+
}
|
|
523
|
+
else {
|
|
524
|
+
instanceToDebug = data.adapterInstance;
|
|
525
|
+
const [adapter, instance] = instanceToDebug.split('.');
|
|
526
|
+
let file;
|
|
527
|
+
try {
|
|
528
|
+
file = require.resolve(`iobroker.${adapter}`);
|
|
529
|
+
}
|
|
530
|
+
catch (e) {
|
|
531
|
+
// try to locate in the same dir
|
|
532
|
+
const dir = (0, node_path_1.normalize)((0, node_path_1.join)(__dirname, '..', `iobroker.${adapter}`));
|
|
533
|
+
if ((0, node_fs_1.existsSync)(dir)) {
|
|
534
|
+
const pack = require((0, node_path_1.join)(dir, 'package.json'));
|
|
535
|
+
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(dir, pack.main || `${adapter}.js`))) {
|
|
536
|
+
file = (0, node_path_1.join)(dir, pack.main || `${adapter}.js`);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
if (!file) {
|
|
540
|
+
sendToHost({ cmd: 'error', error: `Cannot locate iobroker.${adapter}`, errorContext: e });
|
|
541
|
+
setTimeout(() => {
|
|
542
|
+
sendToHost({ cmd: 'finished', context: `Cannot locate iobroker.${adapter}` });
|
|
543
|
+
setTimeout(() => process.exit(124), 500);
|
|
544
|
+
}, 200);
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
file = file.replace(/\\/g, '/');
|
|
549
|
+
instanceToDebug = file;
|
|
550
|
+
console.log(`Start ${file} ${instance} --debug`);
|
|
551
|
+
startInspect([file, instance, '--debug']);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
else if (data.cmd === 'end') {
|
|
555
|
+
process.exit();
|
|
556
|
+
}
|
|
557
|
+
else if (data.cmd === 'source') {
|
|
558
|
+
inspector.Debugger.getScriptSource({ scriptId: data.scriptId }).then((script) => sendToHost({ cmd: 'script', scriptId: data.scriptId, text: script.scriptSource }));
|
|
559
|
+
}
|
|
560
|
+
else if (data.cmd === 'cont') {
|
|
561
|
+
inspector.Debugger.resume().catch((e) => sendToHost({ cmd: 'error', error: e }));
|
|
562
|
+
}
|
|
563
|
+
else if (data.cmd === 'next') {
|
|
564
|
+
inspector.Debugger.stepOver().catch((e) => sendToHost({ cmd: 'error', error: e }));
|
|
565
|
+
}
|
|
566
|
+
else if (data.cmd === 'pause') {
|
|
567
|
+
inspector.Debugger.pause().catch((e) => sendToHost({ cmd: 'error', error: e }));
|
|
568
|
+
}
|
|
569
|
+
else if (data.cmd === 'step') {
|
|
570
|
+
inspector.Debugger.stepInto().catch((e) => sendToHost({ cmd: 'error', error: e }));
|
|
571
|
+
}
|
|
572
|
+
else if (data.cmd === 'out') {
|
|
573
|
+
inspector.Debugger.stepOut().catch((e) => sendToHost({ cmd: 'error', error: e }));
|
|
574
|
+
}
|
|
575
|
+
else if (data.cmd === 'sb') {
|
|
576
|
+
console.log(JSON.stringify(data));
|
|
577
|
+
void Promise.all(data.breakpoints?.map((bp) => inspector.Debugger.setBreakpoint({
|
|
578
|
+
location: {
|
|
579
|
+
scriptId: bp.scriptId,
|
|
580
|
+
lineNumber: bp.lineNumber,
|
|
581
|
+
columnNumber: bp.columnNumber,
|
|
582
|
+
},
|
|
583
|
+
})
|
|
584
|
+
.then((result) => ({
|
|
585
|
+
id: result.breakpointId,
|
|
586
|
+
location: result.actualLocation,
|
|
587
|
+
}))
|
|
588
|
+
.catch((e) => sendToHost({
|
|
589
|
+
cmd: 'error',
|
|
590
|
+
error: `Cannot set breakpoint: ${e}`,
|
|
591
|
+
errorContext: e,
|
|
592
|
+
bp,
|
|
593
|
+
}))) || []).then(breakpoints => sendToHost({ cmd: 'sb', breakpoints }));
|
|
594
|
+
}
|
|
595
|
+
else if (data.cmd === 'cb') {
|
|
596
|
+
void Promise.all(data.breakpoints?.map(breakpointId => inspector.Debugger.removeBreakpoint({ breakpointId })
|
|
597
|
+
.then(() => breakpointId)
|
|
598
|
+
.catch((e) => {
|
|
599
|
+
console.error(`[DEBUGGER]: Cannot clear breakpoint: ${e}`);
|
|
600
|
+
sendToHost({
|
|
601
|
+
cmd: 'error',
|
|
602
|
+
error: `Cannot clear breakpoint: ${e}`,
|
|
603
|
+
errorContext: e,
|
|
604
|
+
id: breakpointId,
|
|
605
|
+
});
|
|
606
|
+
})) || []).then(breakpoints => {
|
|
607
|
+
console.error(`[DEBUGGER]: sent breakpoints ${JSON.stringify(breakpoints)}`);
|
|
608
|
+
sendToHost({ cmd: 'cb', breakpoints });
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
else if (data.cmd === 'watch') {
|
|
612
|
+
void Promise.all(data.expressions?.map(expr => inspector.Debugger.watch(expr).catch((e) => sendToHost({
|
|
613
|
+
cmd: 'error',
|
|
614
|
+
error: `Cannot watch expr: ${e}`,
|
|
615
|
+
errorContext: e,
|
|
616
|
+
expr,
|
|
617
|
+
}))) || []).then(() => console.log('Watch done'));
|
|
618
|
+
}
|
|
619
|
+
else if (data.cmd === 'unwatch') {
|
|
620
|
+
void Promise.all(data.expressions?.map(expr => inspector.Debugger.unwatch(expr).catch((e) => sendToHost({
|
|
621
|
+
cmd: 'error',
|
|
622
|
+
error: `Cannot unwatch expr: ${e}`,
|
|
623
|
+
errorContext: e,
|
|
624
|
+
expr,
|
|
625
|
+
}))) || []).then(() => console.log('Watch done'));
|
|
626
|
+
}
|
|
627
|
+
else if (data.cmd === 'scope') {
|
|
628
|
+
void Promise.all(data.scopes
|
|
629
|
+
?.filter(scope => scope?.object?.objectId)
|
|
630
|
+
.map(scope => inspector.Runtime.getProperties({
|
|
631
|
+
objectId: scope.object.objectId,
|
|
632
|
+
generatePreview: true,
|
|
633
|
+
})
|
|
634
|
+
.then((result) => {
|
|
635
|
+
return { type: scope.type, properties: result };
|
|
636
|
+
})
|
|
637
|
+
.catch((e) => sendToHost({
|
|
638
|
+
cmd: 'error',
|
|
639
|
+
error: `Cannot get scopes expr: ${e}`,
|
|
640
|
+
errorContext: e,
|
|
641
|
+
}))) || []).then(scopes => sendToHost({ cmd: 'scope', scopes }));
|
|
642
|
+
}
|
|
643
|
+
else if (data.cmd === 'setValue') {
|
|
644
|
+
inspector.Debugger.setVariableValue({
|
|
645
|
+
variableName: data.variableName,
|
|
646
|
+
scopeNumber: data.scopeNumber,
|
|
647
|
+
newValue: data.newValue,
|
|
648
|
+
callFrameId: data.callFrameId,
|
|
649
|
+
})
|
|
650
|
+
.catch((e) => {
|
|
651
|
+
console.error(`Cannot setValue "${data.variableName}": ${e}`);
|
|
652
|
+
sendToHost({
|
|
653
|
+
cmd: 'setValue',
|
|
654
|
+
variableName: `Cannot setValue: ${e}`,
|
|
655
|
+
errorContext: e,
|
|
656
|
+
});
|
|
657
|
+
})
|
|
658
|
+
.then(() => {
|
|
659
|
+
console.log(`setValue "${data.variableName}" successful`);
|
|
660
|
+
sendToHost({
|
|
661
|
+
cmd: 'setValue',
|
|
662
|
+
variableName: data.variableName,
|
|
663
|
+
scopeNumber: data.scopeNumber,
|
|
664
|
+
newValue: data.newValue,
|
|
665
|
+
callFrameId: data.callFrameId,
|
|
666
|
+
});
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
else if (data.cmd === 'expressions') {
|
|
670
|
+
void Promise.all(data.expressions?.map(item => inspector.Debugger.evaluateOnCallFrame({
|
|
671
|
+
callFrameId: data.callFrameId,
|
|
672
|
+
expression: item.name,
|
|
673
|
+
objectGroup: 'node-inspect',
|
|
674
|
+
returnByValue: true,
|
|
675
|
+
generatePreview: true,
|
|
676
|
+
})
|
|
677
|
+
// @ts-expect-error fix later
|
|
678
|
+
.then(({ result, wasThrown }) => {
|
|
679
|
+
if (wasThrown) {
|
|
680
|
+
return { name: item.name, result: convertResultToError(result) };
|
|
681
|
+
}
|
|
682
|
+
return { name: item.name, result };
|
|
683
|
+
})
|
|
684
|
+
.catch((e) => sendToHost({
|
|
685
|
+
cmd: 'expressions',
|
|
686
|
+
variableName: `Cannot setValue: ${e}`,
|
|
687
|
+
errorContext: e,
|
|
688
|
+
}))) || []).then(expressions => {
|
|
689
|
+
sendToHost({ cmd: 'expressions', expressions });
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
else if (data.cmd === 'stopOnException') {
|
|
693
|
+
inspector.Debugger.setPauseOnExceptions({
|
|
694
|
+
state: data.state ? 'all' : 'none',
|
|
695
|
+
}).catch((e) => sendToHost({
|
|
696
|
+
cmd: 'stopOnException',
|
|
697
|
+
variableName: `Cannot stopOnException: ${e}`,
|
|
698
|
+
errorContext: e,
|
|
699
|
+
}));
|
|
700
|
+
}
|
|
701
|
+
else if (data.cmd === 'getPossibleBreakpoints') {
|
|
702
|
+
inspector.Debugger.getPossibleBreakpoints({ start: data.start, end: data.end })
|
|
703
|
+
.then((breakpoints) => sendToHost({ cmd: 'getPossibleBreakpoints', breakpoints: breakpoints.locations }))
|
|
704
|
+
.catch((e) => sendToHost({
|
|
705
|
+
cmd: 'getPossibleBreakpoints',
|
|
706
|
+
variableName: `Cannot getPossibleBreakpoints: ${e}`,
|
|
707
|
+
errorContext: e,
|
|
708
|
+
}));
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
console.error(`Unknown command: ${JSON.stringify(data)}`);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
function sendToHost(data) {
|
|
715
|
+
if (data.cmd === 'error') {
|
|
716
|
+
console.error(data.text);
|
|
717
|
+
if (data.expr) {
|
|
718
|
+
console.error(`[EXPRESSION] ${JSON.stringify(data.expr)}`);
|
|
719
|
+
}
|
|
720
|
+
if (data.bp) {
|
|
721
|
+
console.error(`[BP] ${JSON.stringify(data.bp)}`);
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if (process.send) {
|
|
725
|
+
process.send(JSON.stringify(data));
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
//# sourceMappingURL=inspect.js.map
|