Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
8f7db68c
Commit
8f7db68c
authored
Nov 15, 2013
by
Timmy Willison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #14549. Execute the factory immediately when CommonJS is used in the browser.
parent
6fde9752
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
intro.js
src/intro.js
+14
-10
No files found.
src/intro.js
View file @
8f7db68c
...
@@ -15,17 +15,21 @@
...
@@ -15,17 +15,21 @@
(
function
(
window
,
factory
)
{
(
function
(
window
,
factory
)
{
if
(
typeof
module
===
"object"
&&
typeof
module
.
exports
===
"object"
)
{
if
(
typeof
module
===
"object"
&&
typeof
module
.
exports
===
"object"
)
{
// Expose a jQuery-making factory as module.exports in loaders that implement the Node
// For CommonJS and CommonJS-like environments where a proper window is present,
// module pattern (including browserify).
// execute the factory and get jQuery
// This accentuates the need for a real window in the environment
// For environments that do not inherently posses a window with a document
// (such as Node.js), expose a jQuery-making factory as module.exports
// This accentuates the need for the creation of a real window
// e.g. var jQuery = require("jquery")(window);
// e.g. var jQuery = require("jquery")(window);
module
.
exports
=
function
(
w
)
{
// See ticket #14549 for more info
w
=
w
||
window
;
module
.
exports
=
window
.
document
?
if
(
!
w
.
document
)
{
factory
(
window
)
:
throw
new
Error
(
"jQuery requires a window with a document"
);
function
(
w
)
{
}
if
(
!
w
.
document
)
{
return
factory
(
w
);
throw
new
Error
(
"jQuery requires a window with a document"
);
};
}
return
factory
(
w
);
};
}
else
{
}
else
{
factory
(
window
);
factory
(
window
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment