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: destructuring and for-in/of targets that write exports are not seen #31
Found in the PR #29 round-14 review. Rule 1's write detection only recognises = / compound assignment and ++/--, and write() ignores a non-member LHS. Destructuring and for-in/for-of targets that write an exports member are therefore read as no write: the file stays modelled and the member answers absent.
Repros (each loses the pre-PR edge run → m.js:b):
exports.a=a; [exports.b]=[b];
({x: exports.b} = {x: b});
for (exports.b of [b]); and for (exports[k] in o);
nested: function init(){ [exports.b]=[b]; } init();
Fix direction: treat any binding/assignment-pattern or for-in/of initializer target rooted at exports (or an exported value) as a write; at top level model it or bail, and when nested, bail.
Activity