/** * Worker-side entry point. Spawned by the host as a Bun `Worker`; from here on * we live in our own JSC VM with our own heap. We never `import` anything that * touches the host's filesystem / network beyond `bun:jsc` (debug primitives: * `heapSize`). * * Hardening (T2.1): user-script `globalThis` is *not* the worker's `globalThis`. * We delete deletable host-capability globals (fetch, process, Worker, etc.) * from the worker's globalThis, save references to the things our own * infrastructure needs (postMessage, addEventListener, setInterval, etc.) * BEFORE deletion, and run user code in a `with(sandbox)` block whose sandbox * inherits from a frozen prototype carrying safe globals (Math, JSON, Promise, * URL, crypto, …) and `undefined` for everything dangerous. User code's * `globalThis` is the sandbox itself, so `globalThis.fetch`, `this.fetch`, * and bare `fetch` all resolve to `undefined`. * * Documented residual: `(0, eval)('Bun')` and `new Function('return Bun')()` * still escape because indirect eval / Function-constructor runs in the real * global scope and we can't take away `Function` without breaking everything * (async functions, class generators, etc.). That's v3 (FFI) territory. */ export {};