Fix for #2018 - #2019
Conversation
| ); | ||
| if (systemBinding) { | ||
| code.prependRight(this.end - 1, ')'); | ||
| code.appendRight(code.original[this.end - 1] === '}' ? this.end : this.end - 1, ')'); |
There was a problem hiding this comment.
I do not think this is the proper fix. If in the entrypoint-facade test you change the default export to export default 42 without a semicolon, the system output becomes exports('default$1', 4)2. Instead I would suggest to check for the presence of a semicolon as the last character.
There was a problem hiding this comment.
Nice, that works, and makes me feel a lot better about the fix as well understanding the issue!
16f28a0 to
cd7bf17
Compare
| } | ||
| code.overwrite(expression.start, expression.end, | ||
| `(exports(${this.variable.exportName}, ${op}), ${name}${expression.operator})`); | ||
| `(exports('${this.variable.exportName}', ${op}), ${name}${expression.operator})`); |
There was a problem hiding this comment.
Good catch, but do you think we might reflect this in a test somewhere?
There was a problem hiding this comment.
Let me finally get around to adding system format expectations for the "form" folder in general, which would catch all these cases. Will aim to do this as a separate PR though. Otherwise I'm just going to be continuing to pollute the chunking-form tests to try and cover everything further.
Fixes the
export default { obj }case being output asexports('default', { obj )}instead ofexports('default', { obj }).