@openclaw/diagnostics-otel 2026.7.1-beta.2 → 2026.7.1-beta.4
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/index.js +1 -2404
- package/dist/runtime-api-BUlvn2ET.js +2589 -0
- package/dist/runtime-api.js +2 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert/strict.d.ts +10 -1
- package/node_modules/@types/node/assert.d.ts +144 -17
- package/node_modules/@types/node/async_hooks.d.ts +9 -9
- package/node_modules/@types/node/buffer.d.ts +64 -30
- package/node_modules/@types/node/child_process.d.ts +17 -21
- package/node_modules/@types/node/cluster.d.ts +13 -13
- package/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +471 -575
- package/node_modules/@types/node/diagnostics_channel.d.ts +274 -32
- package/node_modules/@types/node/dns.d.ts +15 -15
- package/node_modules/@types/node/events.d.ts +3 -3
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +7 -4
- package/node_modules/@types/node/fs.d.ts +24 -18
- package/node_modules/@types/node/globals.d.ts +4 -4
- package/node_modules/@types/node/http.d.ts +30 -5
- package/node_modules/@types/node/http2.d.ts +5 -1
- package/node_modules/@types/node/index.d.ts +1 -3
- package/node_modules/@types/node/inspector.d.ts +1 -1
- package/node_modules/@types/node/module.d.ts +16 -45
- package/node_modules/@types/node/net.d.ts +1 -1
- package/node_modules/@types/node/os.d.ts +2 -2
- package/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/node/perf_hooks.d.ts +1 -9
- package/node_modules/@types/node/process.d.ts +25 -12
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/readline.d.ts +12 -11
- package/node_modules/@types/node/repl.d.ts +10 -10
- package/node_modules/@types/node/sqlite.d.ts +56 -1
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream/promises.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +1 -1
- package/node_modules/@types/node/stream.d.ts +37 -5
- package/node_modules/@types/node/test/reporters.d.ts +1 -1
- package/node_modules/@types/node/test.d.ts +120 -10
- package/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -4
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -3
- package/node_modules/@types/node/url.d.ts +3 -3
- package/node_modules/@types/node/util/types.d.ts +1 -1
- package/node_modules/@types/node/util.d.ts +22 -22
- package/node_modules/@types/node/v8.d.ts +85 -3
- package/node_modules/@types/node/vm.d.ts +9 -9
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/worker_threads.d.ts +10 -12
- package/node_modules/@types/node/zlib.d.ts +3 -3
- package/node_modules/acorn/CHANGELOG.md +14 -0
- package/node_modules/acorn/README.md +3 -0
- package/node_modules/acorn/dist/acorn.d.mts +6 -0
- package/node_modules/acorn/dist/acorn.d.ts +6 -0
- package/node_modules/acorn/dist/acorn.js +87 -49
- package/node_modules/acorn/dist/acorn.mjs +87 -49
- package/node_modules/acorn/package.json +2 -2
- package/node_modules/import-in-the-middle/CHANGELOG.md +21 -0
- package/node_modules/import-in-the-middle/README.md +60 -0
- package/node_modules/import-in-the-middle/create-hook.mjs +375 -146
- package/node_modules/import-in-the-middle/lib/get-exports.mjs +88 -52
- package/node_modules/import-in-the-middle/lib/io.mjs +78 -0
- package/node_modules/import-in-the-middle/package.json +1 -1
- package/node_modules/import-in-the-middle/register-hooks.d.ts +35 -0
- package/node_modules/import-in-the-middle/register-hooks.mjs +63 -0
- package/node_modules/undici-types/agent.d.ts +0 -2
- package/node_modules/undici-types/client.d.ts +25 -19
- package/node_modules/undici-types/dispatcher.d.ts +7 -33
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/fetch.d.ts +24 -4
- package/node_modules/undici-types/h2c-client.d.ts +6 -6
- package/node_modules/undici-types/handlers.d.ts +1 -2
- package/node_modules/undici-types/header.d.ts +5 -0
- package/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/undici-types/interceptors.d.ts +1 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +0 -2
- package/node_modules/undici-types/proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici-types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/webidl.d.ts +0 -1
- package/node_modules/yargs/CHANGELOG.md +330 -0
- package/node_modules/yargs/build/index.cjs +1 -1
- package/node_modules/yargs/package.json +6 -4
- package/node_modules/yargs/yargs +5 -9
- package/node_modules/yargs/yargs.cjs +15 -0
- package/npm-shrinkwrap.json +18 -18
- package/package.json +4 -4
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/yargs/browser.d.ts +0 -5
|
@@ -35,7 +35,7 @@ declare module "node:vm" {
|
|
|
35
35
|
/**
|
|
36
36
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
37
37
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
38
|
-
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-
|
|
38
|
+
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v26.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
39
39
|
* @experimental
|
|
40
40
|
*/
|
|
41
41
|
importModuleDynamically?:
|
|
@@ -81,7 +81,7 @@ declare module "node:vm" {
|
|
|
81
81
|
/**
|
|
82
82
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
83
83
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
84
|
-
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-
|
|
84
|
+
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v26.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
85
85
|
* @experimental
|
|
86
86
|
*/
|
|
87
87
|
importModuleDynamically?:
|
|
@@ -95,7 +95,7 @@ declare module "node:vm" {
|
|
|
95
95
|
/**
|
|
96
96
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
97
97
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
98
|
-
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-
|
|
98
|
+
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v26.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
99
99
|
* @experimental
|
|
100
100
|
*/
|
|
101
101
|
importModuleDynamically?:
|
|
@@ -115,7 +115,7 @@ declare module "node:vm" {
|
|
|
115
115
|
/**
|
|
116
116
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
117
117
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
118
|
-
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-
|
|
118
|
+
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v26.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
119
119
|
* @experimental
|
|
120
120
|
*/
|
|
121
121
|
importModuleDynamically?:
|
|
@@ -159,7 +159,7 @@ declare module "node:vm" {
|
|
|
159
159
|
/**
|
|
160
160
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
161
161
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
162
|
-
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-
|
|
162
|
+
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v26.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
163
163
|
* @experimental
|
|
164
164
|
*/
|
|
165
165
|
importModuleDynamically?:
|
|
@@ -363,9 +363,9 @@ declare module "node:vm" {
|
|
|
363
363
|
}
|
|
364
364
|
/**
|
|
365
365
|
* If the given `contextObject` is an object, the `vm.createContext()` method will
|
|
366
|
-
* [prepare that object](https://nodejs.org/docs/latest-
|
|
366
|
+
* [prepare that object](https://nodejs.org/docs/latest-v26.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
|
|
367
367
|
* and return a reference to it so that it can be used in calls to {@link runInContext} or
|
|
368
|
-
* [`script.runInContext()`](https://nodejs.org/docs/latest-
|
|
368
|
+
* [`script.runInContext()`](https://nodejs.org/docs/latest-v26.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
|
|
369
369
|
* Inside such scripts, the global object will be wrapped by the `contextObject`, retaining all of its
|
|
370
370
|
* existing properties but also having the built-in objects and functions any standard
|
|
371
371
|
* [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
|
|
@@ -837,7 +837,7 @@ declare module "node:vm" {
|
|
|
837
837
|
/**
|
|
838
838
|
* Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
|
|
839
839
|
* part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
|
|
840
|
-
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-
|
|
840
|
+
* [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v26.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
841
841
|
* @experimental
|
|
842
842
|
*/
|
|
843
843
|
importModuleDynamically?: DynamicModuleLoader<SourceTextModule> | undefined;
|
|
@@ -1112,7 +1112,7 @@ declare module "node:vm" {
|
|
|
1112
1112
|
* and `vm.compileFunction()` so that Node.js uses the default ESM loader from the main
|
|
1113
1113
|
* context to load the requested module.
|
|
1114
1114
|
*
|
|
1115
|
-
* For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-
|
|
1115
|
+
* For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v26.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
|
|
1116
1116
|
* @since v21.7.0, v20.12.0
|
|
1117
1117
|
*/
|
|
1118
1118
|
const USE_MAIN_CONTEXT_DEFAULT_LOADER: number;
|
|
@@ -65,4 +65,19 @@ declare global {
|
|
|
65
65
|
readonly INVALID_NODE_TYPE_ERR: 24;
|
|
66
66
|
readonly DATA_CLONE_ERR: 25;
|
|
67
67
|
};
|
|
68
|
+
|
|
69
|
+
// Not conditional, as this is not yet exposed by the DOM lib generator.
|
|
70
|
+
interface QuotaExceededError extends DOMException {
|
|
71
|
+
readonly quota: number | null;
|
|
72
|
+
readonly requested: number | null;
|
|
73
|
+
}
|
|
74
|
+
var QuotaExceededError: {
|
|
75
|
+
prototype: QuotaExceededError;
|
|
76
|
+
new(message?: string, options?: QuotaExceededErrorOptions): QuotaExceededError;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
interface QuotaExceededErrorOptions {
|
|
80
|
+
quota?: number;
|
|
81
|
+
requested?: number;
|
|
82
|
+
}
|
|
68
83
|
}
|
|
@@ -10,7 +10,7 @@ declare module "node:worker_threads" {
|
|
|
10
10
|
import { Readable, Writable } from "node:stream";
|
|
11
11
|
import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
|
|
12
12
|
import { URL } from "node:url";
|
|
13
|
-
import { CPUProfileHandle, HeapInfo, HeapProfileHandle } from "node:v8";
|
|
13
|
+
import { CPUProfileHandle, CPUProfileOptions, HeapInfo, HeapProfileHandle, HeapProfileOptions } from "node:v8";
|
|
14
14
|
import { Context } from "node:vm";
|
|
15
15
|
import { MessageEvent } from "undici-types";
|
|
16
16
|
const isInternalThread: boolean;
|
|
@@ -22,9 +22,6 @@ declare module "node:worker_threads" {
|
|
|
22
22
|
const threadName: string | null;
|
|
23
23
|
const workerData: any;
|
|
24
24
|
interface WorkerPerformance extends Pick<Performance, "eventLoopUtilization"> {}
|
|
25
|
-
/** @deprecated Use `import { Transferable } from "node:worker_threads"` instead. */
|
|
26
|
-
// TODO: remove in a future major @types/node version.
|
|
27
|
-
type TransferListItem = Transferable;
|
|
28
25
|
interface WorkerOptions {
|
|
29
26
|
/**
|
|
30
27
|
* List of arguments which would be stringified and appended to
|
|
@@ -262,7 +259,7 @@ declare module "node:worker_threads" {
|
|
|
262
259
|
* `, { eval: true });
|
|
263
260
|
*
|
|
264
261
|
* worker.on('online', async () => {
|
|
265
|
-
* const handle = await worker.startCpuProfile();
|
|
262
|
+
* const handle = await worker.startCpuProfile({ sampleInterval: 1 });
|
|
266
263
|
* const profile = await handle.stop();
|
|
267
264
|
* console.log(profile);
|
|
268
265
|
* worker.terminate();
|
|
@@ -286,16 +283,16 @@ declare module "node:worker_threads" {
|
|
|
286
283
|
* ```
|
|
287
284
|
* @since v24.8.0
|
|
288
285
|
*/
|
|
289
|
-
startCpuProfile(): Promise<CPUProfileHandle>;
|
|
286
|
+
startCpuProfile(options?: CPUProfileOptions): Promise<CPUProfileHandle>;
|
|
290
287
|
/**
|
|
291
288
|
* Starting a Heap profile then return a Promise that fulfills with an error
|
|
292
289
|
* or an `HeapProfileHandle` object. This API supports `await using` syntax.
|
|
293
290
|
*
|
|
294
291
|
* ```js
|
|
295
|
-
*
|
|
292
|
+
* import { Worker } from 'node:worker_threads';
|
|
296
293
|
*
|
|
297
294
|
* const worker = new Worker(`
|
|
298
|
-
* const { parentPort } = require('worker_threads');
|
|
295
|
+
* const { parentPort } = require('node:worker_threads');
|
|
299
296
|
* parentPort.on('message', () => {});
|
|
300
297
|
* `, { eval: true });
|
|
301
298
|
*
|
|
@@ -310,7 +307,7 @@ declare module "node:worker_threads" {
|
|
|
310
307
|
* `await using` example.
|
|
311
308
|
*
|
|
312
309
|
* ```js
|
|
313
|
-
*
|
|
310
|
+
* import { Worker } from 'node:worker_threads';
|
|
314
311
|
*
|
|
315
312
|
* const w = new Worker(`
|
|
316
313
|
* const { parentPort } = require('node:worker_threads');
|
|
@@ -322,8 +319,9 @@ declare module "node:worker_threads" {
|
|
|
322
319
|
* await using handle = await w.startHeapProfile();
|
|
323
320
|
* });
|
|
324
321
|
* ```
|
|
322
|
+
* @since v24.9.0
|
|
325
323
|
*/
|
|
326
|
-
startHeapProfile(): Promise<HeapProfileHandle>;
|
|
324
|
+
startHeapProfile(options?: HeapProfileOptions): Promise<HeapProfileHandle>;
|
|
327
325
|
/**
|
|
328
326
|
* Calls `worker.terminate()` when the dispose scope is exited.
|
|
329
327
|
*
|
|
@@ -340,13 +338,13 @@ declare module "node:worker_threads" {
|
|
|
340
338
|
interface Worker extends InternalEventEmitter<WorkerEventMap> {}
|
|
341
339
|
/**
|
|
342
340
|
* Mark an object as not transferable. If `object` occurs in the transfer list of
|
|
343
|
-
* a [`port.postMessage()`](https://nodejs.org/docs/latest-
|
|
341
|
+
* a [`port.postMessage()`](https://nodejs.org/docs/latest-v26.x/api/worker_threads.html#portpostmessagevalue-transferlist) call, an error is thrown. This is a no-op if
|
|
344
342
|
* `object` is a primitive value.
|
|
345
343
|
*
|
|
346
344
|
* In particular, this makes sense for objects that can be cloned, rather than
|
|
347
345
|
* transferred, and which are used by other objects on the sending side.
|
|
348
346
|
* For example, Node.js marks the `ArrayBuffer`s it uses for its
|
|
349
|
-
* [`Buffer` pool](https://nodejs.org/docs/latest-
|
|
347
|
+
* [`Buffer` pool](https://nodejs.org/docs/latest-v26.x/api/buffer.html#static-method-bufferallocunsafesize) with this.
|
|
350
348
|
* `ArrayBuffer.prototype.transfer()` is disallowed on such array buffer
|
|
351
349
|
* instances.
|
|
352
350
|
*
|
|
@@ -55,7 +55,7 @@ declare module "node:zlib" {
|
|
|
55
55
|
}
|
|
56
56
|
| undefined;
|
|
57
57
|
/**
|
|
58
|
-
* Limits output size when using [convenience methods](https://nodejs.org/docs/latest-
|
|
58
|
+
* Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v26.x/api/zlib.html#convenience-methods).
|
|
59
59
|
* @default buffer.kMaxLength
|
|
60
60
|
*/
|
|
61
61
|
maxOutputLength?: number | undefined;
|
|
@@ -79,12 +79,12 @@ declare module "node:zlib" {
|
|
|
79
79
|
chunkSize?: number | undefined;
|
|
80
80
|
/**
|
|
81
81
|
* Key-value object containing indexed
|
|
82
|
-
* [Zstd parameters](https://nodejs.org/docs/latest-
|
|
82
|
+
* [Zstd parameters](https://nodejs.org/docs/latest-v26.x/api/zlib.html#zstd-constants).
|
|
83
83
|
*/
|
|
84
84
|
params?: { [key: number]: number | boolean } | undefined;
|
|
85
85
|
/**
|
|
86
86
|
* Limits output size when using
|
|
87
|
-
* [convenience methods](https://nodejs.org/docs/latest-
|
|
87
|
+
* [convenience methods](https://nodejs.org/docs/latest-v26.x/api/zlib.html#convenience-methods).
|
|
88
88
|
* @default buffer.kMaxLength
|
|
89
89
|
*/
|
|
90
90
|
maxOutputLength?: number | undefined;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 8.17.0 (2026-06-11)
|
|
2
|
+
|
|
3
|
+
### New features
|
|
4
|
+
|
|
5
|
+
The new `strict` option can be used to start script sources in strict mode.
|
|
6
|
+
|
|
7
|
+
### Bug fixes
|
|
8
|
+
|
|
9
|
+
Fix a number of corner case bugs when `using` or `await using` appear in `for` loop specs.
|
|
10
|
+
|
|
11
|
+
Disallow `new super()` expressions.
|
|
12
|
+
|
|
13
|
+
Don't allow the conditional in a ternary expression to be a (naked) arrow function.
|
|
14
|
+
|
|
1
15
|
## 8.16.0 (2026-02-19)
|
|
2
16
|
|
|
3
17
|
### New features
|
|
@@ -86,6 +86,9 @@ required):
|
|
|
86
86
|
will be valid, even if `ecmaVersion` is less than 6. If set to `"commonjs"`,
|
|
87
87
|
it is the same as `"script"` except that the top-level scope behaves like a function.
|
|
88
88
|
|
|
89
|
+
- **strict**: When set to true, enable strict parsing mode even if
|
|
90
|
+
`sourceType` is `"script"`.
|
|
91
|
+
|
|
89
92
|
- **onInsertedSemicolon**: If given a callback, that callback will be
|
|
90
93
|
called whenever a missing semicolon is inserted by the parser. The
|
|
91
94
|
callback will be given the character offset of the point where the
|
|
@@ -619,6 +619,12 @@ export interface Options {
|
|
|
619
619
|
*/
|
|
620
620
|
sourceType?: "script" | "module" | "commonjs"
|
|
621
621
|
|
|
622
|
+
/**
|
|
623
|
+
* When set to true, enable strict parsing mode even if `sourceType`
|
|
624
|
+
* is `"script"`.
|
|
625
|
+
*/
|
|
626
|
+
strict?: boolean
|
|
627
|
+
|
|
622
628
|
/**
|
|
623
629
|
* a callback that will be called when a semicolon is automatically inserted.
|
|
624
630
|
* @param lastTokEnd the position of the comma as an offset
|
|
@@ -619,6 +619,12 @@ export interface Options {
|
|
|
619
619
|
*/
|
|
620
620
|
sourceType?: "script" | "module" | "commonjs"
|
|
621
621
|
|
|
622
|
+
/**
|
|
623
|
+
* When set to true, enable strict parsing mode even if `sourceType`
|
|
624
|
+
* is `"script"`.
|
|
625
|
+
*/
|
|
626
|
+
strict?: boolean
|
|
627
|
+
|
|
622
628
|
/**
|
|
623
629
|
* a callback that will be called when a semicolon is automatically inserted.
|
|
624
630
|
* @param lastTokEnd the position of the comma as an offset
|
|
@@ -342,6 +342,9 @@
|
|
|
342
342
|
// Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
|
|
343
343
|
// strict mode and parsing of `import` and `export` declarations.
|
|
344
344
|
sourceType: "script",
|
|
345
|
+
// When set to true, enable strict parsing mode even if `sourceType`
|
|
346
|
+
// is `"script"`.
|
|
347
|
+
strict: false,
|
|
345
348
|
// `onInsertedSemicolon` can be a callback that will be called when
|
|
346
349
|
// a semicolon is automatically inserted. It will be passed the
|
|
347
350
|
// position of the inserted semicolon as an offset, and if
|
|
@@ -568,7 +571,7 @@
|
|
|
568
571
|
|
|
569
572
|
// Figure out if it's a module code.
|
|
570
573
|
this.inModule = options.sourceType === "module";
|
|
571
|
-
this.strict = this.inModule || this.strictDirective(this.pos);
|
|
574
|
+
this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);
|
|
572
575
|
|
|
573
576
|
// Used to signify the start of a potential arrow function
|
|
574
577
|
this.potentialArrowAt = -1;
|
|
@@ -606,9 +609,11 @@
|
|
|
606
609
|
var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowReturn: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },allowUsing: { configurable: true },inClassStaticBlock: { configurable: true } };
|
|
607
610
|
|
|
608
611
|
Parser.prototype.parse = function parse () {
|
|
612
|
+
var this$1$1 = this;
|
|
613
|
+
|
|
609
614
|
var node = this.options.program || this.startNode();
|
|
610
615
|
this.nextToken();
|
|
611
|
-
return this.parseTopLevel(node)
|
|
616
|
+
return this.catchStackOverflow(function () { return this$1$1.parseTopLevel(node); })
|
|
612
617
|
};
|
|
613
618
|
|
|
614
619
|
prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };
|
|
@@ -747,6 +752,17 @@
|
|
|
747
752
|
return true
|
|
748
753
|
};
|
|
749
754
|
|
|
755
|
+
pp$9.catchStackOverflow = function(f) {
|
|
756
|
+
try {
|
|
757
|
+
return f()
|
|
758
|
+
} catch (e) {
|
|
759
|
+
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message)))
|
|
760
|
+
{ this.raise(this.start, "Not enough stack space to parse input"); }
|
|
761
|
+
else
|
|
762
|
+
{ throw e }
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
|
|
750
766
|
// Asserts that following token is given contextual keyword.
|
|
751
767
|
|
|
752
768
|
pp$9.expectContextual = function(name) {
|
|
@@ -850,10 +866,10 @@
|
|
|
850
866
|
// to its body instead of creating a new node.
|
|
851
867
|
|
|
852
868
|
pp$8.parseTopLevel = function(node) {
|
|
853
|
-
var exports = Object.create(null);
|
|
869
|
+
var exports$1 = Object.create(null);
|
|
854
870
|
if (!node.body) { node.body = []; }
|
|
855
871
|
while (this.type !== types$1.eof) {
|
|
856
|
-
var stmt = this.parseStatement(null, true, exports);
|
|
872
|
+
var stmt = this.parseStatement(null, true, exports$1);
|
|
857
873
|
node.body.push(stmt);
|
|
858
874
|
}
|
|
859
875
|
if (this.inModule)
|
|
@@ -942,7 +958,18 @@
|
|
|
942
958
|
while (isIdentifierChar(ch = this.fullCharCodeAt(next)))
|
|
943
959
|
if (ch === 92) { return true }
|
|
944
960
|
var id = this.input.slice(idStart, next);
|
|
945
|
-
if (keywordRelationalOperator.test(id)
|
|
961
|
+
if (keywordRelationalOperator.test(id)) { return false }
|
|
962
|
+
if (isFor && !isAwaitUsing && id === "of") {
|
|
963
|
+
// Look ahead for using declaration with initializer, i.e., `for (using of = ...)`
|
|
964
|
+
skipWhiteSpace.lastIndex = next;
|
|
965
|
+
var skipAfterOf = skipWhiteSpace.exec(this.input);
|
|
966
|
+
next = next + skipAfterOf[0].length;
|
|
967
|
+
if (this.input.charCodeAt(next) !== 61 /* '=' */ ||
|
|
968
|
+
// Check for ==, === and => operators
|
|
969
|
+
(ch = this.input.charCodeAt(next + 1)) === 61 /* '=' */ || ch === 62 /* '>' */) {
|
|
970
|
+
return false
|
|
971
|
+
}
|
|
972
|
+
}
|
|
946
973
|
return true
|
|
947
974
|
};
|
|
948
975
|
|
|
@@ -961,7 +988,7 @@
|
|
|
961
988
|
// `if (foo) /blah/.exec(foo)`, where looking at the previous token
|
|
962
989
|
// does not help.
|
|
963
990
|
|
|
964
|
-
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
991
|
+
pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
965
992
|
var starttype = this.type, node = this.startNode(), kind;
|
|
966
993
|
|
|
967
994
|
if (this.isLet(context)) {
|
|
@@ -1016,7 +1043,7 @@
|
|
|
1016
1043
|
if (!this.inModule)
|
|
1017
1044
|
{ this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
|
|
1018
1045
|
}
|
|
1019
|
-
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)
|
|
1046
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1)
|
|
1020
1047
|
|
|
1021
1048
|
// If the statement does not start with a statement keyword or a
|
|
1022
1049
|
// brace, it's an ExpressionStatement or LabeledStatement. We
|
|
@@ -1035,6 +1062,10 @@
|
|
|
1035
1062
|
if (!this.allowUsing) {
|
|
1036
1063
|
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
|
|
1037
1064
|
}
|
|
1065
|
+
if (context) {
|
|
1066
|
+
// Cases like `for (;;) using x = ...;`, `if (true) await using x = ...;`, etc. are not allowed.
|
|
1067
|
+
this.raise(this.start, "Using declaration is not allowed in single-statement positions");
|
|
1068
|
+
}
|
|
1038
1069
|
if (usingKind === "await using") {
|
|
1039
1070
|
if (!this.canAwait) {
|
|
1040
1071
|
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
@@ -1168,11 +1199,12 @@
|
|
|
1168
1199
|
// Helper method to parse for loop after variable initialization
|
|
1169
1200
|
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
1170
1201
|
if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) {
|
|
1171
|
-
if (this.
|
|
1172
|
-
if (
|
|
1173
|
-
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1202
|
+
if (this.type === types$1._in) {
|
|
1203
|
+
if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) {
|
|
1204
|
+
this.raise(this.start, "Using declaration is not allowed in for-in loops");
|
|
1205
|
+
}
|
|
1206
|
+
if (this.options.ecmaVersion >= 9 && awaitAt > -1) { this.unexpected(awaitAt); }
|
|
1207
|
+
} else if (this.options.ecmaVersion >= 9) { node.await = awaitAt > -1; }
|
|
1176
1208
|
return this.parseForIn(node, init)
|
|
1177
1209
|
}
|
|
1178
1210
|
if (awaitAt > -1) { this.unexpected(awaitAt); }
|
|
@@ -1777,11 +1809,11 @@
|
|
|
1777
1809
|
|
|
1778
1810
|
// Parses module export declaration.
|
|
1779
1811
|
|
|
1780
|
-
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
1812
|
+
pp$8.parseExportAllDeclaration = function(node, exports$1) {
|
|
1781
1813
|
if (this.options.ecmaVersion >= 11) {
|
|
1782
1814
|
if (this.eatContextual("as")) {
|
|
1783
1815
|
node.exported = this.parseModuleExportName();
|
|
1784
|
-
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
1816
|
+
this.checkExport(exports$1, node.exported, this.lastTokStart);
|
|
1785
1817
|
} else {
|
|
1786
1818
|
node.exported = null;
|
|
1787
1819
|
}
|
|
@@ -1795,14 +1827,14 @@
|
|
|
1795
1827
|
return this.finishNode(node, "ExportAllDeclaration")
|
|
1796
1828
|
};
|
|
1797
1829
|
|
|
1798
|
-
pp$8.parseExport = function(node, exports) {
|
|
1830
|
+
pp$8.parseExport = function(node, exports$1) {
|
|
1799
1831
|
this.next();
|
|
1800
1832
|
// export * from '...'
|
|
1801
1833
|
if (this.eat(types$1.star)) {
|
|
1802
|
-
return this.parseExportAllDeclaration(node, exports)
|
|
1834
|
+
return this.parseExportAllDeclaration(node, exports$1)
|
|
1803
1835
|
}
|
|
1804
1836
|
if (this.eat(types$1._default)) { // export default ...
|
|
1805
|
-
this.checkExport(exports, "default", this.lastTokStart);
|
|
1837
|
+
this.checkExport(exports$1, "default", this.lastTokStart);
|
|
1806
1838
|
node.declaration = this.parseExportDefaultDeclaration();
|
|
1807
1839
|
return this.finishNode(node, "ExportDefaultDeclaration")
|
|
1808
1840
|
}
|
|
@@ -1810,16 +1842,16 @@
|
|
|
1810
1842
|
if (this.shouldParseExportStatement()) {
|
|
1811
1843
|
node.declaration = this.parseExportDeclaration(node);
|
|
1812
1844
|
if (node.declaration.type === "VariableDeclaration")
|
|
1813
|
-
{ this.checkVariableExport(exports, node.declaration.declarations); }
|
|
1845
|
+
{ this.checkVariableExport(exports$1, node.declaration.declarations); }
|
|
1814
1846
|
else
|
|
1815
|
-
{ this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
|
|
1847
|
+
{ this.checkExport(exports$1, node.declaration.id, node.declaration.id.start); }
|
|
1816
1848
|
node.specifiers = [];
|
|
1817
1849
|
node.source = null;
|
|
1818
1850
|
if (this.options.ecmaVersion >= 16)
|
|
1819
1851
|
{ node.attributes = []; }
|
|
1820
1852
|
} else { // export { x, y as z } [from '...']
|
|
1821
1853
|
node.declaration = null;
|
|
1822
|
-
node.specifiers = this.parseExportSpecifiers(exports);
|
|
1854
|
+
node.specifiers = this.parseExportSpecifiers(exports$1);
|
|
1823
1855
|
if (this.eatContextual("from")) {
|
|
1824
1856
|
if (this.type !== types$1.string) { this.unexpected(); }
|
|
1825
1857
|
node.source = this.parseExprAtom();
|
|
@@ -1869,47 +1901,47 @@
|
|
|
1869
1901
|
}
|
|
1870
1902
|
};
|
|
1871
1903
|
|
|
1872
|
-
pp$8.checkExport = function(exports, name, pos) {
|
|
1873
|
-
if (!exports) { return }
|
|
1904
|
+
pp$8.checkExport = function(exports$1, name, pos) {
|
|
1905
|
+
if (!exports$1) { return }
|
|
1874
1906
|
if (typeof name !== "string")
|
|
1875
1907
|
{ name = name.type === "Identifier" ? name.name : name.value; }
|
|
1876
|
-
if (hasOwn(exports, name))
|
|
1908
|
+
if (hasOwn(exports$1, name))
|
|
1877
1909
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
1878
|
-
exports[name] = true;
|
|
1910
|
+
exports$1[name] = true;
|
|
1879
1911
|
};
|
|
1880
1912
|
|
|
1881
|
-
pp$8.checkPatternExport = function(exports, pat) {
|
|
1913
|
+
pp$8.checkPatternExport = function(exports$1, pat) {
|
|
1882
1914
|
var type = pat.type;
|
|
1883
1915
|
if (type === "Identifier")
|
|
1884
|
-
{ this.checkExport(exports, pat, pat.start); }
|
|
1916
|
+
{ this.checkExport(exports$1, pat, pat.start); }
|
|
1885
1917
|
else if (type === "ObjectPattern")
|
|
1886
1918
|
{ for (var i = 0, list = pat.properties; i < list.length; i += 1)
|
|
1887
1919
|
{
|
|
1888
1920
|
var prop = list[i];
|
|
1889
1921
|
|
|
1890
|
-
this.checkPatternExport(exports, prop);
|
|
1922
|
+
this.checkPatternExport(exports$1, prop);
|
|
1891
1923
|
} }
|
|
1892
1924
|
else if (type === "ArrayPattern")
|
|
1893
1925
|
{ for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
|
|
1894
1926
|
var elt = list$1[i$1];
|
|
1895
1927
|
|
|
1896
|
-
if (elt) { this.checkPatternExport(exports, elt); }
|
|
1928
|
+
if (elt) { this.checkPatternExport(exports$1, elt); }
|
|
1897
1929
|
} }
|
|
1898
1930
|
else if (type === "Property")
|
|
1899
|
-
{ this.checkPatternExport(exports, pat.value); }
|
|
1931
|
+
{ this.checkPatternExport(exports$1, pat.value); }
|
|
1900
1932
|
else if (type === "AssignmentPattern")
|
|
1901
|
-
{ this.checkPatternExport(exports, pat.left); }
|
|
1933
|
+
{ this.checkPatternExport(exports$1, pat.left); }
|
|
1902
1934
|
else if (type === "RestElement")
|
|
1903
|
-
{ this.checkPatternExport(exports, pat.argument); }
|
|
1935
|
+
{ this.checkPatternExport(exports$1, pat.argument); }
|
|
1904
1936
|
};
|
|
1905
1937
|
|
|
1906
|
-
pp$8.checkVariableExport = function(exports, decls) {
|
|
1907
|
-
if (!exports) { return }
|
|
1938
|
+
pp$8.checkVariableExport = function(exports$1, decls) {
|
|
1939
|
+
if (!exports$1) { return }
|
|
1908
1940
|
for (var i = 0, list = decls; i < list.length; i += 1)
|
|
1909
1941
|
{
|
|
1910
1942
|
var decl = list[i];
|
|
1911
1943
|
|
|
1912
|
-
this.checkPatternExport(exports, decl.id);
|
|
1944
|
+
this.checkPatternExport(exports$1, decl.id);
|
|
1913
1945
|
}
|
|
1914
1946
|
};
|
|
1915
1947
|
|
|
@@ -1924,13 +1956,13 @@
|
|
|
1924
1956
|
|
|
1925
1957
|
// Parses a comma-separated list of module exports.
|
|
1926
1958
|
|
|
1927
|
-
pp$8.parseExportSpecifier = function(exports) {
|
|
1959
|
+
pp$8.parseExportSpecifier = function(exports$1) {
|
|
1928
1960
|
var node = this.startNode();
|
|
1929
1961
|
node.local = this.parseModuleExportName();
|
|
1930
1962
|
|
|
1931
1963
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
1932
1964
|
this.checkExport(
|
|
1933
|
-
exports,
|
|
1965
|
+
exports$1,
|
|
1934
1966
|
node.exported,
|
|
1935
1967
|
node.exported.start
|
|
1936
1968
|
);
|
|
@@ -1938,7 +1970,7 @@
|
|
|
1938
1970
|
return this.finishNode(node, "ExportSpecifier")
|
|
1939
1971
|
};
|
|
1940
1972
|
|
|
1941
|
-
pp$8.parseExportSpecifiers = function(exports) {
|
|
1973
|
+
pp$8.parseExportSpecifiers = function(exports$1) {
|
|
1942
1974
|
var nodes = [], first = true;
|
|
1943
1975
|
// export { x, y as z } [from '...']
|
|
1944
1976
|
this.expect(types$1.braceL);
|
|
@@ -1948,7 +1980,7 @@
|
|
|
1948
1980
|
if (this.afterTrailingComma(types$1.braceR)) { break }
|
|
1949
1981
|
} else { first = false; }
|
|
1950
1982
|
|
|
1951
|
-
nodes.push(this.parseExportSpecifier(exports));
|
|
1983
|
+
nodes.push(this.parseExportSpecifier(exports$1));
|
|
1952
1984
|
}
|
|
1953
1985
|
return nodes
|
|
1954
1986
|
};
|
|
@@ -2679,15 +2711,19 @@
|
|
|
2679
2711
|
// delayed syntax error at correct position).
|
|
2680
2712
|
|
|
2681
2713
|
pp$5.parseExpression = function(forInit, refDestructuringErrors) {
|
|
2682
|
-
var
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
var
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2714
|
+
var this$1$1 = this;
|
|
2715
|
+
|
|
2716
|
+
return this.catchStackOverflow(function () {
|
|
2717
|
+
var startPos = this$1$1.start, startLoc = this$1$1.startLoc;
|
|
2718
|
+
var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
|
|
2719
|
+
if (this$1$1.type === types$1.comma) {
|
|
2720
|
+
var node = this$1$1.startNodeAt(startPos, startLoc);
|
|
2721
|
+
node.expressions = [expr];
|
|
2722
|
+
while (this$1$1.eat(types$1.comma)) { node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors)); }
|
|
2723
|
+
return this$1$1.finishNode(node, "SequenceExpression")
|
|
2724
|
+
}
|
|
2725
|
+
return expr
|
|
2726
|
+
})
|
|
2691
2727
|
};
|
|
2692
2728
|
|
|
2693
2729
|
// Parse an assignment expression. This includes applications of
|
|
@@ -2752,7 +2788,7 @@
|
|
|
2752
2788
|
var startPos = this.start, startLoc = this.startLoc;
|
|
2753
2789
|
var expr = this.parseExprOps(forInit, refDestructuringErrors);
|
|
2754
2790
|
if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
|
|
2755
|
-
if (this.eat(types$1.question)) {
|
|
2791
|
+
if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
|
|
2756
2792
|
var node = this.startNodeAt(startPos, startLoc);
|
|
2757
2793
|
node.test = expr;
|
|
2758
2794
|
node.consequent = this.parseMaybeAssign();
|
|
@@ -3304,6 +3340,8 @@
|
|
|
3304
3340
|
}
|
|
3305
3341
|
var startPos = this.start, startLoc = this.startLoc;
|
|
3306
3342
|
node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
|
|
3343
|
+
if (node.callee.type === "Super")
|
|
3344
|
+
{ this.raiseRecoverable(startPos, "Invalid use of 'super'"); }
|
|
3307
3345
|
if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
|
|
3308
3346
|
else { node.arguments = empty; }
|
|
3309
3347
|
return this.finishNode(node, "NewExpression")
|
|
@@ -6220,7 +6258,7 @@
|
|
|
6220
6258
|
// [ghbt]: https://github.com/acornjs/acorn/issues
|
|
6221
6259
|
|
|
6222
6260
|
|
|
6223
|
-
var version = "8.
|
|
6261
|
+
var version = "8.17.0";
|
|
6224
6262
|
|
|
6225
6263
|
Parser.acorn = {
|
|
6226
6264
|
Parser: Parser,
|