aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2016-02-24 23:47:19 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2016-03-02 13:12:35 +0100
commit93a8fa6bfc1c8a469e188630b61e736dfb69e128 (patch)
tree47494be97e64818ae3f627c97530240f8f0d10a7 /src
parent8a91f8442f4d31bdd4b43035ee88d40fbb116f64 (diff)
downloadjquery-93a8fa6bfc1c8a469e188630b61e736dfb69e128.tar.gz
jquery-93a8fa6bfc1c8a469e188630b61e736dfb69e128.zip
Core: Deprecate jQuery.parseJSON
Fixes gh-2800 Closes gh-2948
Diffstat (limited to 'src')
-rw-r--r--src/ajax.js3
-rw-r--r--src/ajax/parseJSON.js9
-rw-r--r--src/data.js2
-rw-r--r--src/deprecated.js2
4 files changed, 4 insertions, 12 deletions
diff --git a/src/ajax.js b/src/ajax.js
index 35b29bab4..a71428580 100644
--- a/src/ajax.js
+++ b/src/ajax.js
@@ -7,7 +7,6 @@ define( [
"./ajax/var/rquery",
"./core/init",
- "./ajax/parseJSON",
"./ajax/parseXML",
"./event/trigger",
"./deferred",
@@ -348,7 +347,7 @@ jQuery.extend( {
"text html": true,
// Evaluate text as a json expression
- "text json": jQuery.parseJSON,
+ "text json": JSON.parse,
// Parse text as xml
"text xml": jQuery.parseXML
diff --git a/src/ajax/parseJSON.js b/src/ajax/parseJSON.js
deleted file mode 100644
index c2aeb6aae..000000000
--- a/src/ajax/parseJSON.js
+++ /dev/null
@@ -1,9 +0,0 @@
-define( [
- "../core"
-], function( jQuery ) {
-
-jQuery.parseJSON = JSON.parse;
-
-return jQuery.parseJSON;
-
-} );
diff --git a/src/data.js b/src/data.js
index d2855dde1..9c296ef62 100644
--- a/src/data.js
+++ b/src/data.js
@@ -35,7 +35,7 @@ function dataAttr( elem, key, data ) {
// Only convert to a number if it doesn't change the string
+data + "" === data ? +data :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ rbrace.test( data ) ? JSON.parse( data ) :
data;
} catch ( e ) {}
diff --git a/src/deprecated.js b/src/deprecated.js
index 78885266d..79522e9b1 100644
--- a/src/deprecated.js
+++ b/src/deprecated.js
@@ -23,4 +23,6 @@ jQuery.fn.extend( {
}
} );
+jQuery.parseJSON = JSON.parse;
+
} );