Skip to content

Use var module to prevent emcc pollution#518

Open
xnuk wants to merge 1 commit intosql-js:masterfrom
xnuk:patch-1
Open

Use var module to prevent emcc pollution#518
xnuk wants to merge 1 commit intosql-js:masterfrom
xnuk:patch-1

Conversation

@xnuk
Copy link

@xnuk xnuk commented Jun 13, 2022

for make 'use strict' compatible

@lovasoa
Copy link
Member

lovasoa commented Jun 13, 2022

Looking at the comment above, it looks like the variable is referencing the global module on purpose.

https://nodejs.org/api/modules.html#module

@lovasoa lovasoa closed this Jun 13, 2022
@xnuk
Copy link
Author

xnuk commented Jun 13, 2022

I think it's okay, because its purpose is removing if (typeof module !== 'undefined') { module['exports'] = Module } in the emcc output. Currently emcc output does not use globalThis.module, window.module, or something else.

@lovasoa
Copy link
Member

lovasoa commented Jun 13, 2022

Ok ! Can you add a comment about that above, then ?

@lovasoa lovasoa reopened this Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants