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
ec9b38a3
Commit
ec9b38a3
authored
Jan 24, 2013
by
Richard Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13315: compare typeof node.method to var instead of literal "undefined" for safer uglification
parent
eb47553e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
10 deletions
+14
-10
attributes.js
src/attributes.js
+3
-3
core.js
src/core.js
+4
-0
event.js
src/event.js
+2
-2
manipulation.js
src/manipulation.js
+3
-3
offset.js
src/offset.js
+1
-1
support.js
src/support.js
+1
-1
No files found.
src/attributes.js
View file @
ec9b38a3
...
@@ -137,7 +137,7 @@ jQuery.fn.extend({
...
@@ -137,7 +137,7 @@ jQuery.fn.extend({
}
}
// Toggle whole class name
// Toggle whole class name
}
else
if
(
type
===
"undefined"
||
type
===
"boolean"
)
{
}
else
if
(
type
===
core_strundefined
||
type
===
"boolean"
)
{
if
(
this
.
className
)
{
if
(
this
.
className
)
{
// store className if set
// store className if set
jQuery
.
_data
(
this
,
"__className__"
,
this
.
className
);
jQuery
.
_data
(
this
,
"__className__"
,
this
.
className
);
...
@@ -299,7 +299,7 @@ jQuery.extend({
...
@@ -299,7 +299,7 @@ jQuery.extend({
}
}
// Fallback to prop when attributes are not supported
// Fallback to prop when attributes are not supported
if
(
typeof
elem
.
getAttribute
===
"undefined"
)
{
if
(
typeof
elem
.
getAttribute
===
core_strundefined
)
{
return
jQuery
.
prop
(
elem
,
name
,
value
);
return
jQuery
.
prop
(
elem
,
name
,
value
);
}
}
...
@@ -332,7 +332,7 @@ jQuery.extend({
...
@@ -332,7 +332,7 @@ jQuery.extend({
// In IE9+, Flash objects don't have .getAttribute (#12945)
// In IE9+, Flash objects don't have .getAttribute (#12945)
// Support: IE9+
// Support: IE9+
if
(
typeof
elem
.
getAttribute
!==
"undefined"
)
{
if
(
typeof
elem
.
getAttribute
!==
core_strundefined
)
{
ret
=
elem
.
getAttribute
(
name
);
ret
=
elem
.
getAttribute
(
name
);
}
}
...
...
src/core.js
View file @
ec9b38a3
...
@@ -5,6 +5,10 @@ var
...
@@ -5,6 +5,10 @@ var
// The deferred used on DOM ready
// The deferred used on DOM ready
readyList
,
readyList
,
// Support: IE<9
// For `typeof node.method` instead of `node.method !== undefined`
core_strundefined
=
typeof
undefined
,
// Use the correct document accordingly with window argument (sandbox)
// Use the correct document accordingly with window argument (sandbox)
document
=
window
.
document
,
document
=
window
.
document
,
location
=
window
.
location
,
location
=
window
.
location
,
...
...
src/event.js
View file @
ec9b38a3
...
@@ -52,7 +52,7 @@ jQuery.event = {
...
@@ -52,7 +52,7 @@ jQuery.event = {
eventHandle
=
elemData
.
handle
=
function
(
e
)
{
eventHandle
=
elemData
.
handle
=
function
(
e
)
{
// Discard the second event of a jQuery.event.trigger() and
// Discard the second event of a jQuery.event.trigger() and
// when an event is called after a page has unloaded
// when an event is called after a page has unloaded
return
typeof
jQuery
!==
"undefined"
&&
(
!
e
||
jQuery
.
event
.
triggered
!==
e
.
type
)
?
return
typeof
jQuery
!==
core_strundefined
&&
(
!
e
||
jQuery
.
event
.
triggered
!==
e
.
type
)
?
jQuery
.
event
.
dispatch
.
apply
(
eventHandle
.
elem
,
arguments
)
:
jQuery
.
event
.
dispatch
.
apply
(
eventHandle
.
elem
,
arguments
)
:
undefined
;
undefined
;
};
};
...
@@ -619,7 +619,7 @@ jQuery.removeEvent = document.removeEventListener ?
...
@@ -619,7 +619,7 @@ jQuery.removeEvent = document.removeEventListener ?
// #8545, #7054, preventing memory leaks for custom events in IE6-8
// #8545, #7054, preventing memory leaks for custom events in IE6-8
// detachEvent needed property on element, by name of that event, to properly expose it to GC
// detachEvent needed property on element, by name of that event, to properly expose it to GC
if
(
typeof
elem
[
name
]
===
"undefined"
)
{
if
(
typeof
elem
[
name
]
===
core_strundefined
)
{
elem
[
name
]
=
null
;
elem
[
name
]
=
null
;
}
}
...
...
src/manipulation.js
View file @
ec9b38a3
...
@@ -531,8 +531,8 @@ jQuery.each({
...
@@ -531,8 +531,8 @@ jQuery.each({
function
getAll
(
context
,
tag
)
{
function
getAll
(
context
,
tag
)
{
var
elems
,
elem
,
var
elems
,
elem
,
i
=
0
,
i
=
0
,
found
=
typeof
context
.
getElementsByTagName
!==
"undefined"
?
context
.
getElementsByTagName
(
tag
||
"*"
)
:
found
=
typeof
context
.
getElementsByTagName
!==
core_strundefined
?
context
.
getElementsByTagName
(
tag
||
"*"
)
:
typeof
context
.
querySelectorAll
!==
"undefined"
?
context
.
querySelectorAll
(
tag
||
"*"
)
:
typeof
context
.
querySelectorAll
!==
core_strundefined
?
context
.
querySelectorAll
(
tag
||
"*"
)
:
undefined
;
undefined
;
if
(
!
found
)
{
if
(
!
found
)
{
...
@@ -778,7 +778,7 @@ jQuery.extend({
...
@@ -778,7 +778,7 @@ jQuery.extend({
if
(
deleteExpando
)
{
if
(
deleteExpando
)
{
delete
elem
[
internalKey
];
delete
elem
[
internalKey
];
}
else
if
(
typeof
elem
.
removeAttribute
!==
"undefined"
)
{
}
else
if
(
typeof
elem
.
removeAttribute
!==
core_strundefined
)
{
elem
.
removeAttribute
(
internalKey
);
elem
.
removeAttribute
(
internalKey
);
}
else
{
}
else
{
...
...
src/offset.js
View file @
ec9b38a3
...
@@ -25,7 +25,7 @@ jQuery.fn.offset = function( options ) {
...
@@ -25,7 +25,7 @@ jQuery.fn.offset = function( options ) {
// If we don't have gBCR, just use 0,0 rather than error
// If we don't have gBCR, just use 0,0 rather than error
// BlackBerry 5, iOS 3 (original iPhone)
// BlackBerry 5, iOS 3 (original iPhone)
if
(
typeof
elem
.
getBoundingClientRect
!==
"undefined"
)
{
if
(
typeof
elem
.
getBoundingClientRect
!==
core_strundefined
)
{
box
=
elem
.
getBoundingClientRect
();
box
=
elem
.
getBoundingClientRect
();
}
}
win
=
getWindow
(
doc
);
win
=
getWindow
(
doc
);
...
...
src/support.js
View file @
ec9b38a3
...
@@ -201,7 +201,7 @@ jQuery.support = (function() {
...
@@ -201,7 +201,7 @@ jQuery.support = (function() {
!
parseFloat
(
(
window
.
getComputedStyle
(
marginDiv
,
null
)
||
{}
).
marginRight
);
!
parseFloat
(
(
window
.
getComputedStyle
(
marginDiv
,
null
)
||
{}
).
marginRight
);
}
}
if
(
typeof
div
.
style
.
zoom
!==
"undefined"
)
{
if
(
typeof
div
.
style
.
zoom
!==
core_strundefined
)
{
// Support: IE<8
// Support: IE<8
// Check if natively block-level elements act like inline-block
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// elements when setting their display to 'inline' and giving
...
...
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