acorn-import-attributes
acorn-import-attributes copied to clipboard
fix: keys for nodes should be something or null
Currently, the assertions key of a node can get an object value, or null, or undefined. The latter case should not happen: the value should either be something or null.
Why does it matter?
Third party tools, e.g. rollup, assume that if no value exists, it should be null (e.g. here). If it encounters undefined instead, the code will break with an error.
Is it not an issue with those third party tools instead?
No. Even if it could be argued tools depending on acorn should be written in a more robust manner, acorn has consistently used null when there was no value available. This behaviour should remain.
@xtuc any feedback on this one?
@swiing the change is conflicting now. I'm happy to merge it once fixed.