You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CommonJS model: Rule 2 misses unions with absent, loses reasons in union(), and treats depth cutoffs as complete #32
Found in the PR #29 round-14 review. Rule 2 bails a file when an unknown is reachable from its exports, but some incomplete answers are not unknowns:
Union with absent.function run(){} if (typeof window === 'undefined') exports.run = run; gives run = union[run, absent]. That member is not unknown, so the file stays modelled, the union select rejects it, and the pre-PR edge go → m.js:run is lost.
union() drops the reason.CommonJsValueGraph.union returns unknown('unknown alternative'). A conditional if (process.env.X) patch(exports) therefore bails to the pre-PR graph, with its wrong decoy edges, while the unconditional patch(exports) stays ruled no-edge. Whether the opaque-call ruling applies depends on the if.
Depth cutoffs count as complete.forwardsOutside (seen.size >= 8) and incomplete() (depth > 8) treat their cutoff as "inside the model". A chain f0→…→f10 of module.exports = require(...) ending in ESM loses go → f10.js:run.
Fix direction: count absent-in-union as incomplete; keep a blocking reason through union (e.g. a set of reasons); treat any cutoff as unmodelled.
Activity