diff options
author | Timmy Willison <timmywillisn@gmail.com> | 2015-03-16 14:11:38 -0400 |
---|---|---|
committer | Timmy Willison <timmywillisn@gmail.com> | 2015-03-16 14:11:38 -0400 |
commit | 7632b7454b8a918b5eb9ade199a6a842eae98571 (patch) | |
tree | 5aa224d7b2a57def1c6b43de9ce83ae2b3642234 | |
parent | 5dc4616ca0fdbf2a80890bd9b236e796b84db8c1 (diff) | |
download | jquery-7632b7454b8a918b5eb9ade199a6a842eae98571.tar.gz jquery-7632b7454b8a918b5eb9ade199a6a842eae98571.zip |
Attributes: revert returning null for non-elements
-rw-r--r-- | src/attributes/attr.js | 2 | ||||
-rw-r--r-- | test/unit/attributes.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/attributes/attr.js b/src/attributes/attr.js index 201a2d2a6..3bb05a5a3 100644 --- a/src/attributes/attr.js +++ b/src/attributes/attr.js @@ -28,7 +28,7 @@ jQuery.extend({ // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return null; + return; } // Fallback to prop when attributes are not supported diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 1163ff4e1..ebc28a0e1 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -371,7 +371,7 @@ test( "attr(String, Object)", function() { jQuery.each( [ commentNode, textNode, attributeNode ], function( i, elem ) { var $elem = jQuery( elem ); $elem.attr( "nonexisting", "foo" ); - strictEqual( $elem.attr("nonexisting"), null, "attr(name, value) works correctly on comment and text nodes (bug #7500)." ); + strictEqual( $elem.attr("nonexisting"), undefined, "attr(name, value) works correctly on comment and text nodes (bug #7500)." ); }); jQuery.each( [ window, document, obj, "#firstp" ], function( i, elem ) { |