Skip to main content

Bug Tracker

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 <> Owned by: ystk_skm <>
Priority: low Milestone: 2.0.1
Component: misc Version: 2.0.0
Keywords: Cc:
Blocked by: Blocking:

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 dmethvin comment:1

owner: → ystk_skm <>
status: newpending

Hi, thanks for contributing? Can you provide a test case and some more information about the problem?

Changed April 19, 2013 02:57AM UTC by ystk_skm <> comment:2

status: pendingnew

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=""></script> 
        // Uncaught TypeError: Cannot read property 'exports' of null 

Changed April 19, 2013 03:06AM UTC by dmethvin comment:3

component: unfiledmisc
milestone: None2.0.1
priority: undecidedlow
status: newopen

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 ystk_skm <> comment:4

Just notice it while reading. I'm adjusting my resources for jQuery 2.0.0.

Changed May 20, 2013 04:58PM UTC by Eddie Monge comment:5

resolution: → fixed
status: openclosed

Fix #13789: Don't throw when module === null. Close gh-1269.

Changeset: eabb56c27484cbffd2ce4951f661df83c91e5d7a