aboutsummaryrefslogtreecommitdiffstats
path: root/src/data
diff options
context:
space:
mode:
authorJason Bedard <jason+github@jbedard.ca>2015-08-24 19:56:57 -0700
committerMichał Gołębiowski <m.goleb@gmail.com>2015-09-08 01:00:31 +0200
commit224271982eb9cd351d7db1b38c740b4e927e6f97 (patch)
tree51d05b1ae640aca783e70bc6f415901388ff9c6a /src/data
parent02e10082b25df3b47b6b98e3b35399712795b7df (diff)
downloadjquery-224271982eb9cd351d7db1b38c740b4e927e6f97.tar.gz
jquery-224271982eb9cd351d7db1b38c740b4e927e6f97.zip
Data: Don't expose jQuery.acceptData
jQuery.acceptData is an undocumented internal API that shouldn't be exposed. Fixes gh-2555
Diffstat (limited to 'src/data')
-rw-r--r--src/data/Data.js7
-rw-r--r--src/data/var/acceptData.js (renamed from src/data/accepts.js)8
2 files changed, 5 insertions, 10 deletions
diff --git a/src/data/Data.js b/src/data/Data.js
index 476b3e1e2..a19476ea6 100644
--- a/src/data/Data.js
+++ b/src/data/Data.js
@@ -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 {};
}
diff --git a/src/data/accepts.js b/src/data/var/acceptData.js
index 24e2f0ef0..6a1e5021b 100644
--- a/src/data/accepts.js
+++ b/src/data/var/acceptData.js
@@ -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;
} );