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

Sometimes wrong callback parameters when using module.exports #77

Open
herrernst opened this issue Jan 10, 2015 · 1 comment
Open

Sometimes wrong callback parameters when using module.exports #77

herrernst opened this issue Jan 10, 2015 · 1 comment

Comments

@herrernst
Copy link

I have wrapped all my AMD modules in the simplified CommonJS wrapper. Sometimes I set properties on exports, but if I only want to export one object, I'm assigning it to module.exports. I found a case where amdclean generates invalid code, I've made an example: https://github.com/herrernst/amdclean-module_exports-testcase. It works when using requirejs dynamically and also optimized with r.js, but processing it with amdclean, it doesn't (second console.log prints undefined). In line 24, when setting the main module, the callback function parameters are exports and _config_, but in line 32, the parameters passed for execution of the function are exports and animal, the latter being wrong (causing config being assigned to animal in the body of the function).
It would be great if you could look into that, thank you. I'm loving this project, by the way!

@sprat
Copy link

sprat commented Dec 7, 2015

I've also found some problems with wrapped CJS modules. See #104

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