Commit 20cbf1b1 authored by timmywil's avatar timmywil

Microoptimization in jQuery.attr and remove the redundancy of return undefined

parent a8460d24
......@@ -177,7 +177,7 @@ jQuery.fn.extend({
ret == null ? "" : ret;
}
return undefined;
return;
}
isFunction = jQuery.isFunction( value );
......@@ -302,7 +302,7 @@ jQuery.extend({
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
return;
}
if ( pass && name in jQuery.attrFn ) {
......@@ -310,7 +310,7 @@ jQuery.extend({
}
// Fallback to prop when attributes are not supported
if ( !("getAttribute" in elem) ) {
if ( typeof elem.getAttribute === "undefined" ) {
return jQuery.prop( elem, name, value );
}
......@@ -327,7 +327,7 @@ jQuery.extend({
if ( value === null ) {
jQuery.removeAttr( elem, name );
return undefined;
return;
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
......@@ -439,7 +439,7 @@ jQuery.extend({
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
return;
}
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment