aboutsummaryrefslogtreecommitdiffstats
path: root/src/core.js
diff options
context:
space:
mode:
authorJason Bedard <jason+github@jbedard.ca>2018-01-14 00:46:20 -0800
committerTimmy Willison <4timmywil@gmail.com>2018-01-16 10:39:08 -0500
commit1ea092a54b00aa4d902f4e22ada3854d195d4a18 (patch)
tree705d445aa449743e06e6354bb3f746076700e31f /src/core.js
parent91fb18190e5ab9821e3c74b6aecbb5d197c6c5f6 (diff)
downloadjquery-1ea092a54b00aa4d902f4e22ada3854d195d4a18.tar.gz
jquery-1ea092a54b00aa4d902f4e22ada3854d195d4a18.zip
Core: deprecate jQuery.type
Fixes gh-3605 Close gh-3895
Diffstat (limited to 'src/core.js')
-rw-r--r--src/core.js18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/core.js b/src/core.js
index 8ffc4e516..7a016121c 100644
--- a/src/core.js
+++ b/src/core.js
@@ -18,10 +18,11 @@ define( [
"./var/support",
"./var/isFunction",
"./var/isWindow",
- "./core/DOMEval"
+ "./core/DOMEval",
+ "./core/toType"
], function( arr, document, getProto, slice, concat, push, indexOf,
class2type, toString, hasOwn, fnToString, ObjectFunctionString,
- support, isFunction, isWindow, DOMEval ) {
+ support, isFunction, isWindow, DOMEval, toType ) {
"use strict";
@@ -237,17 +238,6 @@ jQuery.extend( {
return true;
},
- type: function( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
-
- // Support: Android <=2.3 only (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call( obj ) ] || "object" :
- typeof obj;
- },
-
// Evaluates a script in a global context
globalEval: function( code ) {
DOMEval( code );
@@ -395,7 +385,7 @@ function isArrayLike( obj ) {
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = !!obj && "length" in obj && obj.length,
- type = jQuery.type( obj );
+ type = toType( obj );
if ( isFunction( obj ) || isWindow( obj ) ) {
return false;