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
9e0c0561
Commit
9e0c0561
authored
Jun 11, 2012
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #10589. Remove deprecated $.fn.data("events") special case.
No unit tests were harmed in the removal of this hack.
parent
6af0bcc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
data.js
src/data.js
+4
-11
No files found.
src/data.js
View file @
9e0c0561
...
@@ -32,7 +32,7 @@ jQuery.extend({
...
@@ -32,7 +32,7 @@ jQuery.extend({
return
;
return
;
}
}
var
privateCache
,
thisCache
,
ret
,
var
thisCache
,
ret
,
internalKey
=
jQuery
.
expando
,
internalKey
=
jQuery
.
expando
,
getByName
=
typeof
name
===
"string"
,
getByName
=
typeof
name
===
"string"
,
...
@@ -46,12 +46,11 @@ jQuery.extend({
...
@@ -46,12 +46,11 @@ jQuery.extend({
// Only defining an ID for JS objects if its cache already exists allows
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
// the code to shortcut on the same path as a DOM node with no cache
id
=
isNode
?
elem
[
internalKey
]
:
elem
[
internalKey
]
&&
internalKey
,
id
=
isNode
?
elem
[
internalKey
]
:
elem
[
internalKey
]
&&
internalKey
;
isEvents
=
name
===
"events"
;
// Avoid doing any more work than we need to when trying to get data on an
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
// object that has no data at all
if
(
(
!
id
||
!
cache
[
id
]
||
(
!
isEvents
&&
!
pvt
&&
!
cache
[
id
].
data
))
&&
getByName
&&
data
===
undefined
)
{
if
(
(
!
id
||
!
cache
[
id
]
||
(
!
pvt
&&
!
cache
[
id
].
data
))
&&
getByName
&&
data
===
undefined
)
{
return
;
return
;
}
}
...
@@ -85,7 +84,7 @@ jQuery.extend({
...
@@ -85,7 +84,7 @@ jQuery.extend({
}
}
}
}
privateCache
=
thisCache
=
cache
[
id
];
thisCache
=
cache
[
id
];
// jQuery data() is stored in a separate object inside the object's internal data
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
// cache in order to avoid key collisions between internal data and user-defined
...
@@ -102,12 +101,6 @@ jQuery.extend({
...
@@ -102,12 +101,6 @@ jQuery.extend({
thisCache
[
jQuery
.
camelCase
(
name
)
]
=
data
;
thisCache
[
jQuery
.
camelCase
(
name
)
]
=
data
;
}
}
// Users should not attempt to inspect the internal events object using jQuery.data,
// it is undocumented and subject to change. But does anyone listen? No.
if
(
isEvents
&&
!
thisCache
[
name
]
)
{
return
privateCache
.
events
;
}
// Check for both converted-to-camel and non-converted data property names
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
// If a data property was specified
if
(
getByName
)
{
if
(
getByName
)
{
...
...
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