Skip to content

Conversation

@eddiemonge
Copy link
Contributor

If module = null is included before jQuery, an error is thrown because null is an object but module.exports is not a property of it.

This checks to make sure module is a truthy value before checking its properties.
typeof null = "object"
typeof {} = "object"
typeof null.prop = JS error
typeof {}.prop = undefined

Not entirely sure how to write a test for this. If someone wants to point me in a direction, I'll gladly try it out.

@mgol mgol closed this in eabb56c May 20, 2013
@mgol
Copy link
Member

mgol commented May 20, 2013

Merged, thanks!

mgol pushed a commit to mgol/jquery that referenced this pull request May 29, 2013
yansern pushed a commit to foundry-modules/jquery that referenced this pull request Nov 15, 2013
# By Richard Gibson (61) and others
# Via Dave Methvin
* commit '3b0b953d98bd13efd8c6b37d5318c5bf1e74931c': (186 commits)
  Tagging the 1.10.2 release.
  Update Sizzle to version 1.10.2
  Change the changelog header style (cherry picked from commit a44202d)
  Revert "Fix #13983. Switch to //# for sourcemaps."
  Fix #13983. Switch to //# for sourcemaps.
  Fix test for #13937 ticket. Close jquerygh-1299 (cherry picked from commit 308980e)
  Update AUTHORS.txt
  Fixes #14049: don't append px to CSS order value. Close jquerygh-1300. (cherry picked from ec6eb38)
  Update Sizzle: bower manifest
  Moved too-early assignment inside the if stmt where the var is actually used. Close jquerygh-1292. (cherry picked from commit 3a43443)
  Build: Update testswarm task to node-testswarm 1.x API
  Update Sizzle. Avoid the use of frameElement. Fixes #13980.
  Avoid jQuery(this) and a closure for .toggle(Boolean), close jquerygh-1271. (cherry picked from commit e53a919)
  Fix #13974: XML .attr("type")
  No ticket: correct typo in an example in README.md. Close jquerygh-1281. (cherry-picked from a0aa623)
  Updating the source version to 1.10.2-pre
  Tagging the 1.10.1 release.
  Fix #13789: Don't throw when module === null. Close jquerygh-1269. Close jquerygh-1280. (cherry-picked from eabb56c)
  Sizzle Update: fix #13936 - iframe reload should not affect Sizzle.
  Fix #13937: Correctly scope .finish() following multi-element .animate(). Thanks @gnarf37. Close jquerygh-1279.
  ...

Conflicts:
	package.json
	src/.jshintrc
	src/core.js
	src/deprecated.js
	src/exports.js
mescoda pushed a commit to mescoda/jquery that referenced this pull request Nov 4, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants