Skip to content
Permalink
Browse files

Widget: Refactoring setOptions loop to remove unnesecary closure / th…

…at reference
  • Loading branch information
gnarf committed Oct 19, 2011
1 parent 1d69181 commit 2f89f356433d83a56135070c2f7d3b188c756b5a
Showing with 5 additions and 4 deletions.
  1. +5 −4 ui/jquery.ui.widget.js
@@ -270,10 +270,11 @@ $.Widget.prototype = {
return this;
},
_setOptions: function( options ) {
var that = this;
$.each( options, function( key, value ) {
that._setOption( key, value );
});
var key;

for ( key in options ) {
this._setOption( key, options[ key ] );
}

return this;
},

3 comments on commit 2f89f35

@sobrinho

This comment has been minimized.

Copy link

@sobrinho sobrinho replied Oct 20, 2011

That is cross-browser?

@scottgonzalez

This comment has been minimized.

Copy link
Member

@scottgonzalez scottgonzalez replied Oct 20, 2011

Yes, it's been in the language forever.

@sobrinho

This comment has been minimized.

Copy link

@sobrinho sobrinho replied Oct 20, 2011

ok, thanks for tip!

Please sign in to comment.
You can’t perform that action at this time.