Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iitm wrappers copy exported primitives #118

Closed
timfish opened this issue Jun 28, 2024 · 1 comment
Closed

iitm wrappers copy exported primitives #118

timfish opened this issue Jun 28, 2024 · 1 comment

Comments

@timfish
Copy link
Contributor

timfish commented Jun 28, 2024

When you export primitives in ESM, they are exposed as references which means they can be written to from elsewhere within the module. A reproduction of this behaviour can be seen in #113.

Because the iitm wrappers assign each export to a variable before re-exporting, primitive exports have their original value copied and the reference is lost.

This is where the code generation does that:

let $${n} = _.${n}
export { $${n} as ${n} }

@timfish
Copy link
Contributor Author

timfish commented Jun 28, 2024

Ah, just realised this is a duplicate of #38

@timfish timfish closed this as completed Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant