Side navigation
#13789 closed bug (fixed)
Opened April 19, 2013 02:37AM UTC
Closed May 20, 2013 04:58PM UTC
variable module cannot accept 'null'
Reported by: | ystk_skm <brilliantpenguin@gmail.com> | Owned by: | ystk_skm <brilliantpenguin@gmail.com> |
---|---|---|---|
Priority: | low | Milestone: | 2.0.1 |
Component: | misc | Version: | 2.0.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
See L:8730.
typeof module === "object" && typeof module.exports === "object"
It occurs error when module === null.
I think that this condition should be:
typeof module == 'object' && module != null && typeof module.exports === "object"
Attachments (0)
Change History (5)
Changed April 19, 2013 02:43AM UTC by comment:1
owner: | → ystk_skm <brilliantpenguin@gmail.com> |
---|---|
status: | new → pending |
Changed April 19, 2013 02:57AM UTC by comment:2
status: | pending → new |
---|
There are no huge impact for this bug, only requires some change if module is defined null at this position.
I think it's worth better to avoid such irregular.
<script>var module = null;</script> <script src="http://code.jquery.com/jquery-2.0.0.js"></script> // Uncaught TypeError: Cannot read property 'exports' of null
Changed April 19, 2013 03:06AM UTC by comment:3
component: | unfiled → misc |
---|---|
milestone: | None → 2.0.1 |
priority: | undecided → low |
status: | new → open |
I agree, it shouldn't fail if module
is null
but I'd hope that isn't out in global scope very often.
Did your own code fail because of this, or did you just notice it while reading the code?
Changed April 19, 2013 03:13AM UTC by comment:4
Just notice it while reading. I'm adjusting my resources for jQuery 2.0.0.
Hi, thanks for contributing? Can you provide a test case and some more information about the problem?