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

Checks for CommonJS module environments are not fail-safe #139

Open
hjerabek opened this issue Jul 5, 2020 · 1 comment
Open

Checks for CommonJS module environments are not fail-safe #139

hjerabek opened this issue Jul 5, 2020 · 1 comment

Comments

@hjerabek
Copy link

hjerabek commented Jul 5, 2020

IMO, the CommonJS module environment checks coded here, i.e.

typeof module === 'object' && module.exports

will raise an exception if module==null. They should be changed to

typeof module === 'object' && module && module.exports
@SimonHeimberg
Copy link

You are right, it will raise an exception in this case. (I am wondering why the type of null is object, but this is how it is.)
Is this case frequent?

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