Skip to content

Use var module to prevent emcc pollution - #518

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

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

Conversation

@xnuk

@xnuk xnuk commented Jun 13, 2022

Copy link
Copy Markdown

for make 'use strict' compatible

@lovasoa

lovasoa commented Jun 13, 2022

Copy link
Copy Markdown
Member

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

xnuk commented Jun 13, 2022

Copy link
Copy Markdown
Author

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

lovasoa commented Jun 13, 2022

Copy link
Copy Markdown
Member

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

@lovasoa lovasoa reopened this Jun 13, 2022
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

2 participants