sql.js icon indicating copy to clipboard operation
sql.js copied to clipboard

Use `var module` to prevent emcc pollution

Open xnuk opened this issue 3 years ago • 3 comments

for make 'use strict' compatible

xnuk avatar Jun 13 '22 06:06 xnuk

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 avatar Jun 13 '22 07:06 lovasoa

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.

xnuk avatar Jun 13 '22 08:06 xnuk

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

lovasoa avatar Jun 13 '22 09:06 lovasoa