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
6ffa7307
Commit
6ffa7307
authored
Dec 27, 2010
by
jrburke
Committed by
Colin Snover
Dec 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Register as a CommonJS async module if in that kind of environment. Fixes #7102.
parent
01cba2ec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
23 deletions
+35
-23
core.js
src/core.js
+5
-0
testinit.js
test/data/testinit.js
+6
-1
core.js
test/unit/core.js
+24
-22
No files found.
src/core.js
View file @
6ffa7307
...
@@ -886,6 +886,11 @@ function doScrollCheck() {
...
@@ -886,6 +886,11 @@ function doScrollCheck() {
jQuery
.
ready
();
jQuery
.
ready
();
}
}
// Expose jQuery as an Asynchronous Module
if
(
typeof
define
!==
"undefined"
)
{
define
(
"jquery"
,
[],
function
()
{
return
jQuery
;
}
);
}
// Expose jQuery to the global object
// Expose jQuery to the global object
return
(
window
.
jQuery
=
window
.
$
=
jQuery
);
return
(
window
.
jQuery
=
window
.
$
=
jQuery
);
...
...
test/data/testinit.js
View file @
6ffa7307
var
jQuery
=
this
.
jQuery
||
"jQuery"
,
// For testing .noConflict()
var
jQuery
=
this
.
jQuery
||
"jQuery"
,
// For testing .noConflict()
$
=
this
.
$
||
"$"
,
$
=
this
.
$
||
"$"
,
originaljQuery
=
jQuery
,
originaljQuery
=
jQuery
,
original$
=
$
;
original$
=
$
,
commonJSDefined
;
function
define
(
module
,
dependencies
,
callback
)
{
commonJSDefined
=
callback
();
}
/**
/**
* Returns an array of elements with the given IDs, eg.
* Returns an array of elements with the given IDs, eg.
...
...
test/unit/core.js
View file @
6ffa7307
...
@@ -12,7 +12,9 @@ test("Basic requirements", function() {
...
@@ -12,7 +12,9 @@ test("Basic requirements", function() {
});
});
test
(
"jQuery()"
,
function
()
{
test
(
"jQuery()"
,
function
()
{
expect
(
23
);
expect
(
24
);
strictEqual
(
commonJSDefined
,
jQuery
,
"CommonJS registered (Bug #7102)"
);
// Basic constructor's behavior
// Basic constructor's behavior
...
...
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