mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-25 06:24:27 +08:00
markAsUncloneable(value) marks a plain object, a record, an error or a class instance (scr_json.c); structuredClone and postMessage then throw DataCloneError "Cannot clone object of unsupported type." for it, also where it is nested. As in Node, the mark has no effect on primitives, arrays, typed arrays and ArrayBuffers. Marked values are retained until the thread exits; with nothing marked, the clone paths add one branch. worker[Symbol.asyncDispose]() terminates the worker and resolves with undefined after its 'exit' event, so `await using` disposes a Worker at the end of its block. The Worker handle's symbol_get op answers the well-known symbol: the symbol unit registers Symbol.asyncDispose with the dyn core when the program names it, and scr_dyn_is_async_dispose_symbol tells the worker unit, so worker programs that never name the symbol do not link the symbol unit. static-support.json adds rows for markAsUncloneable, isInternalThread (already lowered as false and declared) and worker[Symbol.asyncDispose](). Corpus 5990-5991 match Node v24.22.0; corpus-costs.json records their costs.