1
0
Fork 0

Simplified and enhanced util.freeze()

closure/master
Mike Gerwitz 2011-05-15 19:12:01 -04:00
parent 4c74f2a1f2
commit f47fcf4f46
1 changed files with 4 additions and 8 deletions

View File

@ -62,17 +62,13 @@ var can_define_prop = ( function()
*
* @return {Object} object passed to function
*/
exports.freeze = function( obj )
{
// if freezing is not supported (ES5), do nothing
if ( Object.freeze === undefined )
exports.freeze = ( typeof Object.freeze === 'function' )
? Object.freeze
: function( obj )
{
return;
}
Object.freeze( obj );
return obj;
};
;
/**