-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
Fix check for a global variable "module" #49
Conversation
…sts, which is not the case if the browser just has an global exports variable and not a global module variable
I have pushed changes to master that should make running the tests less dependent on your npm globals, and we're now also testing in both nodejs 0.8 and 0.10 on Travis. I would suggest rebasing against master for a better experience :) JSLint rejected your changes
If you fix that, then I think all the tests should pass and we can merge your fix (thank you for contributing!) |
they fail because jshint expects module to be a global variable that is always available (which is not the case) and thus asks me to compare it directly with undefined. but i cant since it doesnt exist :) |
This project uses JSLint, not JSHint. The pubsub.js file has instructions for JSLint to ignore You can run JSLint with
|
same thing, you dont just tell JSLint to "ignore" the If you still dont like it or dont understand what i'm trying to say here, just close it. This is getting too much of an effort. |
Not exactly, JSLint tells you to use === to compare with This code fails (on JSLint.com) var module;
var exists = typeof module !== "undefined"; This code passes (on JSLint.com) var module;
var exists = module !== undefined; |
I'm seriously not sure if you are trolling me. you define module and then OF COURSE you can do but in your code you cant just do I give up, let your code break. |
I am not trolling you. /*global module*/
var exists = module !== undefined; |
can we agree on removing exports/module from the globals list and access them via
|
The scenario described in the initial post states
If I understand this correctly, all modules using most of the UMD patterns would fail in that environment. Would it help to switch to using commonjsStrictGlobal pattern to solve this issue? |
This has been fixed with #63 |
The simple check for module assumes that a global module variable exists, which is not the case if the browser just has an global exports variable and not a global module variable
also the tests on master currently fail (at least for me locally)