mirror of
https://github.com/jquery/jquery.git
synced 2026-02-02 23:15:16 -05:00
Data: Don't expose jQuery.acceptData
jQuery.acceptData is an undocumented internal API that shouldn't be exposed. Fixes gh-2555
This commit is contained in:
committed by
Michał Gołębiowski
parent
02e10082b2
commit
224271982e
@@ -1,15 +1,14 @@
|
||||
define( [
|
||||
"../core",
|
||||
"../var/rnotwhite",
|
||||
"./accepts"
|
||||
], function( jQuery, rnotwhite ) {
|
||||
"./var/acceptData"
|
||||
], function( jQuery, rnotwhite, acceptData ) {
|
||||
|
||||
function Data() {
|
||||
this.expando = jQuery.expando + Data.uid++;
|
||||
}
|
||||
|
||||
Data.uid = 1;
|
||||
Data.accepts = jQuery.acceptData;
|
||||
|
||||
Data.prototype = {
|
||||
|
||||
@@ -38,7 +37,7 @@ Data.prototype = {
|
||||
// We can accept data for non-element nodes in modern browsers,
|
||||
// but we should not, see #8335.
|
||||
// Always return an empty object.
|
||||
if ( !Data.accepts( owner ) ) {
|
||||
if ( !acceptData( owner ) ) {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
define( [
|
||||
"../core"
|
||||
], function( jQuery ) {
|
||||
define( function() {
|
||||
|
||||
/**
|
||||
* Determines whether an object can have data
|
||||
*/
|
||||
jQuery.acceptData = function( owner ) {
|
||||
|
||||
return function( owner ) {
|
||||
// Accepts only:
|
||||
// - Node
|
||||
// - Node.ELEMENT_NODE
|
||||
@@ -17,5 +14,4 @@ jQuery.acceptData = function( owner ) {
|
||||
return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
|
||||
};
|
||||
|
||||
return jQuery.acceptData;
|
||||
} );
|
||||
Reference in New Issue
Block a user