@volter/tabnode 0.5.16 → 0.5.17
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/assets/{runtime-worker-Bw8vbYik.js → runtime-worker-DCIwIWHJ.js} +3764 -251
- package/dist/code-transforms.d.ts +2 -1
- package/dist/index.mjs +3764 -244
- package/dist/node-lib/binding/zlib.d.ts +14 -1
- package/dist/shims/perf_hooks.d.ts +0 -4
- package/dist/shims/tls.d.ts +3 -1
- package/dist/shims/worker_threads.d.ts +4 -0
- package/package.json +1 -1
- package/src/code-transforms.ts +28 -13
- package/src/node-lib/binding/zlib.ts +80 -3
- package/src/node-lib/internals/runtime.ts +6 -2
- package/src/runtime.ts +59 -4
- package/src/shims/child_process.ts +26 -6
- package/src/shims/esbuild.ts +12 -1
- package/src/shims/perf_hooks.ts +18 -0
- package/src/shims/string_decoder.ts +5 -0
- package/src/shims/tls.ts +13 -1
- package/src/shims/worker_threads.ts +19 -0
|
@@ -88,6 +88,23 @@ export function markAsUntransferable(object: unknown): void {
|
|
|
88
88
|
// No-op
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Node 22's `markAsUncloneable` and its query: an object so marked is refused
|
|
93
|
+
* by `structuredClone` and `postMessage`. undici's WebIDL layer marks every
|
|
94
|
+
* `CacheStorage`, `Request` and `Response` it makes, at construction, so a
|
|
95
|
+
* program that loads undici 7.x+ or 8.x died on `markAsUncloneable is not a
|
|
96
|
+
* function` before its first line. The mark is kept; this engine's message
|
|
97
|
+
* channels do not yet read it, so a marked object that is posted is copied
|
|
98
|
+
* rather than refused.
|
|
99
|
+
*/
|
|
100
|
+
const uncloneable = new WeakSet<object>();
|
|
101
|
+
export function markAsUncloneable(object: unknown): void {
|
|
102
|
+
if (object !== null && (typeof object === 'object' || typeof object === 'function')) uncloneable.add(object as object);
|
|
103
|
+
}
|
|
104
|
+
export function isMarkedAsUncloneable(object: unknown): boolean {
|
|
105
|
+
return object !== null && (typeof object === 'object' || typeof object === 'function') && uncloneable.has(object as object);
|
|
106
|
+
}
|
|
107
|
+
|
|
91
108
|
export function getEnvironmentData(key: unknown): unknown {
|
|
92
109
|
return undefined;
|
|
93
110
|
}
|
|
@@ -109,6 +126,8 @@ export default {
|
|
|
109
126
|
receiveMessageOnPort,
|
|
110
127
|
SHARE_ENV,
|
|
111
128
|
markAsUntransferable,
|
|
129
|
+
markAsUncloneable,
|
|
130
|
+
isMarkedAsUncloneable,
|
|
112
131
|
getEnvironmentData,
|
|
113
132
|
setEnvironmentData,
|
|
114
133
|
};
|