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

An equivalent of emscripten's MODULARIZE #599

Closed
cpitclaudel opened this issue Jun 22, 2017 · 0 comments
Closed

An equivalent of emscripten's MODULARIZE #599

cpitclaudel opened this issue Jun 22, 2017 · 0 comments

Comments

@cpitclaudel
Copy link
Contributor

Hi there,

Following up on the mailing list thread: --wrap-in-func seems to be pretty close to what I need (thanks!), except for the fact that it doesn't export the function itself in the global namespace (so I guess it could be useful from eval, but not from e.g. importScripts in a web worker.

The idea of emscripten's modularize is that loading the script exports (in the node.js case) or adds to the global namespace (in the brwoser case) a single function, which when called returns an instance of the program. This is especially useful when the program has global state, since it gives you an easy way to reset it without reloading (and thus reparsing) the entire script.

Thanks!

hhugo added a commit that referenced this issue Jun 22, 2017
hhugo added a commit that referenced this issue Jun 22, 2017
@hhugo hhugo added this to the 3.1 milestone Jun 23, 2017
@hhugo hhugo closed this as completed in 64cbb0d Dec 1, 2017
hhugo added a commit that referenced this issue Dec 1, 2017
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

2 participants