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
31b3c44d
Commit
31b3c44d
authored
Apr 12, 2011
by
jeresig
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bug_4366' of
https://github.com/jboesch/jquery
into jboesch-bug_4366
parents
2d27ac4d
926884bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
core.js
src/core.js
+5
-2
core.js
test/unit/core.js
+8
-1
No files found.
src/core.js
View file @
31b3c44d
...
@@ -613,8 +613,11 @@ jQuery.extend({
...
@@ -613,8 +613,11 @@ jQuery.extend({
}
}
}
}
}
else
{
}
else
{
for
(
var
value
=
object
[
0
];
for
(
;
i
<
length
;
)
{
i
<
length
&&
callback
.
call
(
value
,
i
,
value
)
!==
false
;
value
=
object
[
++
i
]
)
{}
if
(
callback
.
call
(
object
[
i
],
i
,
object
[
i
++
]
)
===
false
)
{
break
;
}
}
}
}
}
}
...
...
test/unit/core.js
View file @
31b3c44d
...
@@ -818,7 +818,7 @@ test("jQuery.extend(Object, Object)", function() {
...
@@ -818,7 +818,7 @@ test("jQuery.extend(Object, Object)", function() {
});
});
test
(
"jQuery.each(Object,Function)"
,
function
()
{
test
(
"jQuery.each(Object,Function)"
,
function
()
{
expect
(
1
3
);
expect
(
1
4
);
jQuery
.
each
(
[
0
,
1
,
2
],
function
(
i
,
n
){
jQuery
.
each
(
[
0
,
1
,
2
],
function
(
i
,
n
){
equals
(
i
,
n
,
"Check array iteration"
);
equals
(
i
,
n
,
"Check array iteration"
);
});
});
...
@@ -850,6 +850,13 @@ test("jQuery.each(Object,Function)", function() {
...
@@ -850,6 +850,13 @@ test("jQuery.each(Object,Function)", function() {
f
[
i
]
=
'baz'
;
f
[
i
]
=
'baz'
;
});
});
equals
(
"baz"
,
f
.
foo
,
"Loop over a function"
);
equals
(
"baz"
,
f
.
foo
,
"Loop over a function"
);
var
stylesheet_count
=
0
;
jQuery
.
each
(
document
.
styleSheets
,
function
(
i
){
stylesheet_count
++
;
});
equals
(
stylesheet_count
,
2
,
"should not throw an error in IE while looping over document.styleSheets and return proper amount"
);
});
});
test
(
"jQuery.makeArray"
,
function
(){
test
(
"jQuery.makeArray"
,
function
(){
...
...
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