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
68213f20
Commit
68213f20
authored
Sep 05, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ref #14313: NaN detection. Close gh-1352.
(cherry picked from commit
0bc0a690
)
parent
1d57ffe5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
core.js
src/core.js
+4
-1
css.js
src/css.js
+2
-2
No files found.
src/core.js
View file @
68213f20
...
@@ -221,7 +221,10 @@ jQuery.extend({
...
@@ -221,7 +221,10 @@ jQuery.extend({
},
},
isNumeric
:
function
(
obj
)
{
isNumeric
:
function
(
obj
)
{
return
!
isNaN
(
parseFloat
(
obj
)
)
&&
isFinite
(
obj
);
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
// subtraction forces infinities to NaN
return
obj
-
parseFloat
(
obj
)
>=
0
;
},
},
type
:
function
(
obj
)
{
type
:
function
(
obj
)
{
...
...
src/css.js
View file @
68213f20
...
@@ -273,8 +273,8 @@ jQuery.extend({
...
@@ -273,8 +273,8 @@ jQuery.extend({
type
=
"number"
;
type
=
"number"
;
}
}
// Make sure that
NaN and null
values aren't set. See: #7116
// Make sure that
null and NaN
values aren't set. See: #7116
if
(
value
==
null
||
type
===
"number"
&&
isNaN
(
value
)
)
{
if
(
value
==
null
||
value
!==
value
)
{
return
;
return
;
}
}
...
...
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