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
254 B
JSON
8 lines
254 B
JSON
{
|
|
"name": "gtchunkshadow",
|
|
"version": "1.0.0",
|
|
"description": "esbuild's CommonJS bundle shape: a chunk calls a top-level function whose name a nested scope of the chunk also declares",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts"
|
|
}
|