@tsplc/compiler 0.5.0 → 0.5.2
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/dist/bun-runtime.js +1345 -0
- package/dist/bun-runtime.js.map +25 -0
- package/dist/cli.js +251 -46
- package/dist/cli.js.map +8 -6
- package/dist/codesys.js +11 -6
- package/dist/codesys.js.map +3 -3
- package/dist/elaborate-capture.js +5 -5
- package/dist/elaborate-capture.js.map +4 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +4 -4
- package/dist/project.js +45 -20
- package/dist/project.js.map +5 -4
- package/package.json +13 -9
- package/src/codesys/manifest.ts +8 -1
- package/src/frontend/elaborate/capture-protocol.ts +18 -0
- package/src/frontend/elaborate/capture.ts +3 -11
- package/src/frontend/elaborate/graph.ts +3 -2
- package/src/project/cli.ts +5 -0
- package/src/project/project-commands.ts +60 -6
- package/src/project/project.ts +4 -0
- package/src/runtime/async.ts +200 -0
- package/src/runtime/launch.ts +49 -0
- package/src/runtime/main.ts +54 -0
- package/src/runtime/process.ts +172 -0
- package/src/runtime/program.ts +142 -0
- package/src/runtime/retain.ts +100 -0
- package/src/runtime/runtime.ts +329 -0
- package/src/runtime/storage.ts +481 -0
- package/src/runtime/symbols.ts +153 -0
- package/src/runtime/telemetry.ts +123 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { dirname } from "node:path";
|
|
4
|
+
import type {
|
|
5
|
+
PublishedGlobal,
|
|
6
|
+
PublishedScalar,
|
|
7
|
+
PublishedValue,
|
|
8
|
+
} from "@tsplc/opcua/server";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { scalarPaths } from "./symbols.ts";
|
|
11
|
+
|
|
12
|
+
const retainedValue = z.union([
|
|
13
|
+
z.boolean(),
|
|
14
|
+
z.number(),
|
|
15
|
+
z.string(),
|
|
16
|
+
z.strictObject({ bigint: z.string().regex(/^-?\d+$/) }),
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
/** The values of the retained globals when the runtime last stopped, and the layout they had. */
|
|
20
|
+
const retainedSchema = z.strictObject({
|
|
21
|
+
layout: z.string(),
|
|
22
|
+
values: z.record(z.string(), retainedValue),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const parsedJson = (text: string): unknown => {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(text);
|
|
28
|
+
} catch {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const stored = (value: PublishedValue): z.infer<typeof retainedValue> =>
|
|
34
|
+
typeof value === "bigint" ? { bigint: String(value) } : value;
|
|
35
|
+
|
|
36
|
+
const restored = (value: z.infer<typeof retainedValue>): PublishedValue =>
|
|
37
|
+
typeof value === "object" ? BigInt(value.bigint) : value;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The program's `VAR_GLOBAL RETAIN` globals across restarts of the runtime, as CODESYS keeps its
|
|
41
|
+
* retain area across a restart of its runtime: written when the runtime stops, and loaded before
|
|
42
|
+
* the first scan only when every retained global has the layout it was saved with. A changed
|
|
43
|
+
* layout starts them all from the program's initial values, as a retain mismatch does.
|
|
44
|
+
*/
|
|
45
|
+
export const createRetention = (
|
|
46
|
+
globals: readonly PublishedGlobal[],
|
|
47
|
+
scalar: (path: string) => PublishedScalar | undefined,
|
|
48
|
+
file: string,
|
|
49
|
+
) => {
|
|
50
|
+
const scalars = globals.flatMap(scalarPaths).flatMap(({ path, type }) => {
|
|
51
|
+
const bound = scalar(path);
|
|
52
|
+
return bound ? [{ path, type, bound }] : [];
|
|
53
|
+
});
|
|
54
|
+
const layout = createHash("sha256")
|
|
55
|
+
.update(JSON.stringify(scalars.map(({ path, type }) => [path, type])))
|
|
56
|
+
.digest("hex");
|
|
57
|
+
return {
|
|
58
|
+
/** Loads the saved values: how many, or why none were. */
|
|
59
|
+
restore: async (): Promise<
|
|
60
|
+
{ restored: number } | { discarded: string } | { none: true }
|
|
61
|
+
> => {
|
|
62
|
+
if (!scalars.length) {
|
|
63
|
+
return { none: true };
|
|
64
|
+
}
|
|
65
|
+
const text = await readFile(file, "utf8").catch(() => undefined);
|
|
66
|
+
if (text === undefined) {
|
|
67
|
+
return { none: true };
|
|
68
|
+
}
|
|
69
|
+
const saved = retainedSchema.safeParse(parsedJson(text));
|
|
70
|
+
if (!saved.success) {
|
|
71
|
+
return { discarded: `${file} is not a retain file` };
|
|
72
|
+
}
|
|
73
|
+
if (saved.data.layout !== layout) {
|
|
74
|
+
return { discarded: "the retained globals' layout changed" };
|
|
75
|
+
}
|
|
76
|
+
for (const { path, bound } of scalars) {
|
|
77
|
+
const value = saved.data.values[path];
|
|
78
|
+
if (value !== undefined) {
|
|
79
|
+
bound.write(restored(value));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return { restored: scalars.length };
|
|
83
|
+
},
|
|
84
|
+
save: async () => {
|
|
85
|
+
if (!scalars.length) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
await mkdir(dirname(file), { recursive: true });
|
|
89
|
+
await writeFile(
|
|
90
|
+
file,
|
|
91
|
+
`${JSON.stringify({
|
|
92
|
+
layout,
|
|
93
|
+
values: Object.fromEntries(
|
|
94
|
+
scalars.map(({ path, bound }) => [path, stored(bound.read())]),
|
|
95
|
+
),
|
|
96
|
+
} satisfies z.input<typeof retainedSchema>)}\n`,
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
};
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
3
|
+
import { errorName } from "@tsplc/compiler/ir";
|
|
4
|
+
import { controllerDeviceName, loadTsplcConfig } from "@tsplc/config";
|
|
5
|
+
import { emittedStDirectory } from "@tsplc/config/project-files";
|
|
6
|
+
import { debugManifest, debugManifestFile } from "@tsplc/debug/manifest";
|
|
7
|
+
import {
|
|
8
|
+
type PublishedScalar,
|
|
9
|
+
servePublishedGlobals,
|
|
10
|
+
} from "@tsplc/opcua/server";
|
|
11
|
+
import { readDeclarations } from "@tsplc/typegen/declarations";
|
|
12
|
+
import { now } from "../../stdlib/clock.ts";
|
|
13
|
+
import { clamp, max, min } from "../../stdlib/math.ts";
|
|
14
|
+
import { retain } from "../../stdlib/retain.ts";
|
|
15
|
+
import { onTelemetry, telemetry } from "../../stdlib/telemetry.ts";
|
|
16
|
+
import {
|
|
17
|
+
createAsync,
|
|
18
|
+
httpCall,
|
|
19
|
+
oneLaunchAtATime,
|
|
20
|
+
unsupported,
|
|
21
|
+
} from "./async.ts";
|
|
22
|
+
import { type Launch, runtimeDirectory, runtimeFiles } from "./launch.ts";
|
|
23
|
+
import { loadProgram } from "./program.ts";
|
|
24
|
+
import { createRetention } from "./retain.ts";
|
|
25
|
+
import { createStorage } from "./storage.ts";
|
|
26
|
+
import { plcGlobals, scalarPaths } from "./symbols.ts";
|
|
27
|
+
import { createTelemetry } from "./telemetry.ts";
|
|
28
|
+
|
|
29
|
+
/** Where the runtime publishes OPC UA: the local CODESYS runtime's address and port. */
|
|
30
|
+
export const runtimeEndpoint = { host: "127.0.0.1", port: 4840 } as const;
|
|
31
|
+
|
|
32
|
+
export interface RuntimeOptions {
|
|
33
|
+
launch: Launch;
|
|
34
|
+
/** The environment the config's variables resolve in, before the launch's target's values. */
|
|
35
|
+
environment: Readonly<Record<string, string | undefined>>;
|
|
36
|
+
/** Where OPC UA listens; `runtimeEndpoint` unless a test picks a free port. */
|
|
37
|
+
port: number;
|
|
38
|
+
log: (line: string) => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** What an exception record calls a failure: a job error's meaning, or a thrown Error's message. */
|
|
42
|
+
const failureName = (reason: unknown) => {
|
|
43
|
+
if (typeof reason === "number") {
|
|
44
|
+
return errorName(reason);
|
|
45
|
+
}
|
|
46
|
+
return reason instanceof Error ? reason.message : String(reason);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** A telemetry record's `file:line`, relative to the project rather than to this process's directory. */
|
|
50
|
+
const projectSource = (root: string, source: unknown) => {
|
|
51
|
+
if (typeof source !== "string" || !source) {
|
|
52
|
+
return "";
|
|
53
|
+
}
|
|
54
|
+
const separator = source.lastIndexOf(":");
|
|
55
|
+
const file = resolve(source.slice(0, separator));
|
|
56
|
+
const path = relative(root, file);
|
|
57
|
+
return `${isAbsolute(path) ? file : path.replaceAll("\\", "/")}${source.slice(separator)}`;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Runs a project's PLC program in this Bun process, as `tsplc run --bun` does: each task's programs
|
|
62
|
+
* scan to completion on the task's cycle, services and telemetry go to the project's server over
|
|
63
|
+
* HTTP as the compiled program sends them, and the development publication is served over OPC UA
|
|
64
|
+
* as the local CODESYS runtime serves it. Reads the last build's artifacts.
|
|
65
|
+
*/
|
|
66
|
+
export const startRuntime = async (options: RuntimeOptions) => {
|
|
67
|
+
const { launch, log } = options;
|
|
68
|
+
const { config, root, env } = await loadTsplcConfig(launch.config, {
|
|
69
|
+
env: options.environment,
|
|
70
|
+
target: launch.target ?? undefined,
|
|
71
|
+
forAgent: false,
|
|
72
|
+
});
|
|
73
|
+
const { compiler, tasks } = config;
|
|
74
|
+
if (!compiler || !tasks) {
|
|
75
|
+
throw new Error("The Bun runtime runs a TypeScript program.");
|
|
76
|
+
}
|
|
77
|
+
if (config.server?.transport === "opcua") {
|
|
78
|
+
throw new Error(
|
|
79
|
+
"The Bun runtime calls services over HTTP; this program calls them through the OPC UA gateway.",
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const st = resolve(root, emittedStDirectory);
|
|
83
|
+
const manifest = debugManifest.parse(
|
|
84
|
+
JSON.parse(await readFile(join(st, debugManifestFile), "utf8")),
|
|
85
|
+
);
|
|
86
|
+
const globals = plcGlobals(await readDeclarations(st));
|
|
87
|
+
|
|
88
|
+
const baseUrlEnv = config.server?.baseUrlEnv;
|
|
89
|
+
const baseUrl = (baseUrlEnv && env[baseUrlEnv]?.replace(/\/+$/, "")) || null;
|
|
90
|
+
const http = {
|
|
91
|
+
baseUrl,
|
|
92
|
+
routes: launch.services,
|
|
93
|
+
tokens: new Map(
|
|
94
|
+
(config.codesys?.http?.credentials ?? []).flatMap(
|
|
95
|
+
({ originEnv, bearerTokenEnv }) => {
|
|
96
|
+
const origin = URL.parse(env[originEnv] ?? "")?.origin;
|
|
97
|
+
const token = env[bearerTokenEnv];
|
|
98
|
+
return origin && token ? [[origin, token] as const] : [];
|
|
99
|
+
},
|
|
100
|
+
),
|
|
101
|
+
),
|
|
102
|
+
timeoutMs: config.codesys?.http?.timeoutMs ?? 2000,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** The task whose scan runs, or last ran: continuations run in their caller's task. */
|
|
106
|
+
const current = { task: tasks[0]?.name ?? "", scan: 0, scanning: false };
|
|
107
|
+
const diagnostics = { count: 0, lastError: 0 };
|
|
108
|
+
const records = createTelemetry({
|
|
109
|
+
build: manifest.build.id,
|
|
110
|
+
capacity: config.telemetry?.capacity ?? 64,
|
|
111
|
+
post:
|
|
112
|
+
baseUrl === null
|
|
113
|
+
? null
|
|
114
|
+
: (body) =>
|
|
115
|
+
httpCall(http, `${baseUrl}/tsplc/telemetry`, {
|
|
116
|
+
method: "POST",
|
|
117
|
+
body,
|
|
118
|
+
}),
|
|
119
|
+
clock: now,
|
|
120
|
+
});
|
|
121
|
+
const stopTelemetry = onTelemetry((record) =>
|
|
122
|
+
records.record(current.task, {
|
|
123
|
+
...record,
|
|
124
|
+
scan: current.scan,
|
|
125
|
+
source: projectSource(root, record.source),
|
|
126
|
+
}),
|
|
127
|
+
);
|
|
128
|
+
const failed = new WeakMap<Promise<unknown>, string>();
|
|
129
|
+
const unhandled = (reason: unknown, promise: Promise<unknown>) => {
|
|
130
|
+
const code = typeof reason === "number" ? reason : 0;
|
|
131
|
+
// A cancelled job is not a failure.
|
|
132
|
+
if (code === 1) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
diagnostics.count += 1;
|
|
136
|
+
diagnostics.lastError = code;
|
|
137
|
+
const name = failureName(reason);
|
|
138
|
+
const fn = failed.get(promise);
|
|
139
|
+
records.record(current.task, {
|
|
140
|
+
kind: "exception",
|
|
141
|
+
code,
|
|
142
|
+
...(name && { name }),
|
|
143
|
+
handled: false,
|
|
144
|
+
...(fn && { function: fn }),
|
|
145
|
+
properties: {},
|
|
146
|
+
source: "",
|
|
147
|
+
scan: current.scan,
|
|
148
|
+
time: Math.max(0, now()),
|
|
149
|
+
});
|
|
150
|
+
if (typeof reason !== "number") {
|
|
151
|
+
log(`An async call failed and nothing caught it: ${String(reason)}`);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
process.on("unhandledRejection", unhandled);
|
|
155
|
+
|
|
156
|
+
const program = await loadProgram({
|
|
157
|
+
sources: manifest.sources.map((source) => resolve(root, source)),
|
|
158
|
+
entries: Object.fromEntries(
|
|
159
|
+
Object.entries(compiler.programs).map(([key, entry]) => [
|
|
160
|
+
key,
|
|
161
|
+
{ module: resolve(root, entry.module), export: entry.export },
|
|
162
|
+
]),
|
|
163
|
+
),
|
|
164
|
+
sdk: {
|
|
165
|
+
"@tsplc/compiler/clock": { now },
|
|
166
|
+
"@tsplc/compiler/retain": { retain },
|
|
167
|
+
"@tsplc/compiler/telemetry": { telemetry, onTelemetry },
|
|
168
|
+
"@tsplc/compiler/math": { min, max, clamp },
|
|
169
|
+
"@tsplc/compiler/async": createAsync(http, diagnostics),
|
|
170
|
+
"@tsplc/compiler/config": {
|
|
171
|
+
env: (name: string) => {
|
|
172
|
+
const value = env[name];
|
|
173
|
+
if (value === undefined) {
|
|
174
|
+
throw new Error(`${name} is not set.`);
|
|
175
|
+
}
|
|
176
|
+
return value;
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
"@tsplc/compiler/plc": { expose: unsupported("expose") },
|
|
180
|
+
},
|
|
181
|
+
}).catch((cause: unknown) => {
|
|
182
|
+
throw new Error(
|
|
183
|
+
"The program failed to load in Bun. The Bun runtime runs plain TypeScript programs (docs/language/plain-typescript.md); the tsPLC dialect's SDK has no Bun implementation.",
|
|
184
|
+
{ cause },
|
|
185
|
+
);
|
|
186
|
+
});
|
|
187
|
+
oneLaunchAtATime(program.classes, {
|
|
188
|
+
scanning: () => current.scanning,
|
|
189
|
+
diagnostics,
|
|
190
|
+
failed,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
const storage = createStorage(manifest, program.binding);
|
|
194
|
+
storage.keepStoredValues();
|
|
195
|
+
const scalars = new Map<string, PublishedScalar>();
|
|
196
|
+
const bound = (global: (typeof globals.published)[number]) =>
|
|
197
|
+
scalarPaths(global).every(({ path }) => {
|
|
198
|
+
const scalar = storage.scalar(path);
|
|
199
|
+
if (scalar) {
|
|
200
|
+
scalars.set(path, scalar);
|
|
201
|
+
}
|
|
202
|
+
return scalar !== undefined;
|
|
203
|
+
});
|
|
204
|
+
const published = globals.published.filter(bound);
|
|
205
|
+
const unbound = globals.published.filter(
|
|
206
|
+
(global) => !published.includes(global),
|
|
207
|
+
);
|
|
208
|
+
const retention = createRetention(
|
|
209
|
+
globals.retained,
|
|
210
|
+
storage.scalar,
|
|
211
|
+
join(root, runtimeDirectory, runtimeFiles.retain),
|
|
212
|
+
);
|
|
213
|
+
const restored = await retention.restore();
|
|
214
|
+
if ("restored" in restored) {
|
|
215
|
+
log(`Restored ${restored.restored} retained values.`);
|
|
216
|
+
} else if ("discarded" in restored) {
|
|
217
|
+
log(
|
|
218
|
+
`Retained values start from their initial values: ${restored.discarded}.`,
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const server = await servePublishedGlobals({
|
|
223
|
+
host: runtimeEndpoint.host,
|
|
224
|
+
port: options.port,
|
|
225
|
+
device: controllerDeviceName(config, "run"),
|
|
226
|
+
globals: published,
|
|
227
|
+
scalar: (path) => {
|
|
228
|
+
const scalar = scalars.get(path);
|
|
229
|
+
if (!scalar) {
|
|
230
|
+
throw new Error(`${path} has no storage in the program.`);
|
|
231
|
+
}
|
|
232
|
+
return scalar;
|
|
233
|
+
},
|
|
234
|
+
certificateDirectory: join(
|
|
235
|
+
root,
|
|
236
|
+
runtimeDirectory,
|
|
237
|
+
runtimeFiles.certificates,
|
|
238
|
+
),
|
|
239
|
+
}).catch((cause: unknown) => {
|
|
240
|
+
throw cause instanceof Error &&
|
|
241
|
+
"code" in cause &&
|
|
242
|
+
cause.code === "EADDRINUSE"
|
|
243
|
+
? new Error(
|
|
244
|
+
`Port ${options.port} is taken: stop the other PLC first, such as the CODESYS runtime \`tsplc run\` starts.`,
|
|
245
|
+
)
|
|
246
|
+
: cause;
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
const timers = new Map<string, Timer>();
|
|
250
|
+
const stopped = { value: false };
|
|
251
|
+
const stopTasks = () => {
|
|
252
|
+
stopped.value = true;
|
|
253
|
+
for (const timer of timers.values()) {
|
|
254
|
+
clearTimeout(timer);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
for (const task of tasks) {
|
|
258
|
+
const intervalMs = Number(task.schedule.interval.nanoseconds) / 1_000_000;
|
|
259
|
+
const entries = task.programs.flatMap((key) => {
|
|
260
|
+
const entry = program.programs.get(key);
|
|
261
|
+
return entry ? [entry] : [];
|
|
262
|
+
});
|
|
263
|
+
const state = { scan: 0, due: performance.now() };
|
|
264
|
+
const schedule = () => {
|
|
265
|
+
timers.set(
|
|
266
|
+
task.name,
|
|
267
|
+
setTimeout(scan, Math.max(0, state.due - performance.now())),
|
|
268
|
+
);
|
|
269
|
+
};
|
|
270
|
+
const scan = () => {
|
|
271
|
+
if (stopped.value) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
state.scan += 1;
|
|
275
|
+
Object.assign(current, {
|
|
276
|
+
task: task.name,
|
|
277
|
+
scan: state.scan,
|
|
278
|
+
scanning: true,
|
|
279
|
+
});
|
|
280
|
+
try {
|
|
281
|
+
records.send(task.name, state.scan);
|
|
282
|
+
for (const entry of entries) {
|
|
283
|
+
entry();
|
|
284
|
+
}
|
|
285
|
+
} catch (error) {
|
|
286
|
+
stopTasks();
|
|
287
|
+
log(
|
|
288
|
+
`${task.name} stopped in scan ${state.scan}: the program threw, which stops the application as an exception stops it on CODESYS. Restart the runtime.\n${error instanceof Error ? (error.stack ?? error.message) : String(error)}`,
|
|
289
|
+
);
|
|
290
|
+
return;
|
|
291
|
+
} finally {
|
|
292
|
+
current.scanning = false;
|
|
293
|
+
}
|
|
294
|
+
// A late scan starts the next cycle at once rather than running the missed ones.
|
|
295
|
+
state.due = Math.max(state.due + intervalMs, performance.now());
|
|
296
|
+
schedule();
|
|
297
|
+
};
|
|
298
|
+
schedule();
|
|
299
|
+
log(
|
|
300
|
+
`${task.name} scans ${task.programs.join(", ")} every ${intervalMs} ms.`,
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
if (unbound.length) {
|
|
304
|
+
log(
|
|
305
|
+
`Not published, because the program has no storage for them: ${unbound
|
|
306
|
+
.map(({ list, name }) => `${list}.${name}`)
|
|
307
|
+
.join(", ")}.`,
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
log(
|
|
311
|
+
`${config.name} runs in Bun. OPC UA: ${server.endpoint} (${server.scalars} published values).`,
|
|
312
|
+
);
|
|
313
|
+
return {
|
|
314
|
+
endpoint: server.endpoint,
|
|
315
|
+
/** Stops the tasks and saves the retained globals, then stops serving, whatever the server's sessions do. */
|
|
316
|
+
stop: async () => {
|
|
317
|
+
stopTasks();
|
|
318
|
+
stopTelemetry();
|
|
319
|
+
try {
|
|
320
|
+
await retention.save();
|
|
321
|
+
} finally {
|
|
322
|
+
await server.stop().catch((cause: unknown) => {
|
|
323
|
+
log(`The OPC UA server failed to stop cleanly: ${String(cause)}`);
|
|
324
|
+
});
|
|
325
|
+
process.off("unhandledRejection", unhandled);
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
};
|
|
329
|
+
};
|