diff --git a/src/core.js b/src/core.js index 3b42d73ab..b1483c018 100644 --- a/src/core.js +++ b/src/core.js @@ -442,7 +442,7 @@ if ( typeof Symbol === "function" ) { /* jshint ignore: end */ // Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error".split( " " ), +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); diff --git a/test/unit/core.js b/test/unit/core.js index 407ae7e2c..42bfe91c1 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -272,6 +272,19 @@ QUnit.test( "type", function( assert ) { assert.equal( jQuery.type( new MyObject() ), "object", "Object" ); } ); +QUnit.test( "type for `Symbol`", function( assert ) { + // Prevent reference errors + if( typeof Symbol !== "function" ) { + assert.expect( 0 ); + return + } + + assert.expect( 2 ); + + assert.equal( jQuery.type( Symbol() ), "symbol", "Symbol" ); + assert.equal( jQuery.type( Object( Symbol() ) ), "symbol", "Symbol" ); +}); + QUnit.asyncTest( "isPlainObject", function( assert ) { assert.expect( 15 );