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

How to prevent Module clobbering with Aubio.js another Emscripten lib? #22

Closed
theronic opened this issue Jun 6, 2018 · 1 comment
Closed

Comments

@theronic
Copy link

theronic commented Jun 6, 2018

When I link to both QuietJS and Aubio.js, regardless of <script> tag order, the last loaded library seems to clobber each other's Module var, throwing exception "Module is not a function call"

Is there a trick to get them to work together, or do I need to compile from scratch in a parent project that links both?

@theronic
Copy link
Author

theronic commented Jun 6, 2018

Nevermined, resolved by renaming Module in aubio.js to AubioModule.

However, could there be performance gains by "linking" two libraries?

Before:

var Module = function(Module) {
  Module = Module || {};

...
}
if (typeof module === "object" && module.exports) {
  module['exports'] = Module;
};

After:

var AubioModule = function(Module) {
  Module = Module || {};
   ...
}

if (typeof module === "object" && module.exports) {
  module['exports'] = AubioModule;
};

@theronic theronic closed this as completed Jun 6, 2018
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