mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
Three fixes for the bundled-chunk splitter and the CommonJS cycle check: - A reference counts as local only when a scope between it and the chunk factory (or the copied helper) declares its name. A nested function, block, loop or catch binding with the name of a top-level helper no longer hides the chunk's read of that helper. Before, the helper was not copied and the chunk failed at runtime on the unresolved reference. - A top-level function is copied into a chunk only when the bundle calls it and uses it in no other way. Each chunk gets its own copy, so a function that is exported, compared, constructed, or given properties would lose its shared identity. Such a chunk now keeps the package refused. - During a cycle's initialization, a read of a partner's exported function is safe only as a plain value read. A call through esbuild's `(0, binding.fn)()` spelling, `new`, a tagged template, a member of the function, or passing it to a call can run the function, so these uses keep SC1016 (Node throws when the function reads a binding in its temporal dead zone).
8 lines
309 B
JSON
8 lines
309 B
JSON
{
|
|
"name": "gtcyclecall",
|
|
"version": "1.0.0",
|
|
"description": "esbuild 0.25.10 per-file CommonJS output shape of a cycle whose partner calls an exported function through (0, binding.fn)() while that function's const binding is uninitialized",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
}
|