1
0
Fork 0

IE8 does not support Object.defineProperty on non-DOM objects

(see http://stackoverflow.com/questions/3830800/object-defineproperty-in-es5)
closure/master
Mike Gerwitz 2010-12-21 14:37:34 -05:00
parent e1d7b80d46
commit d5f37f294e
1 changed files with 14 additions and 6 deletions

View File

@ -104,14 +104,22 @@ exports.defineSecureProp = function( obj, prop, value )
}
else
{
Object.defineProperty( obj, prop,
try
{
value: value,
Object.defineProperty( obj, prop,
{
value: value,
enumerable: false,
writable: false,
configurable: false,
});
enumerable: false,
writable: false,
configurable: false,
});
}
catch ( e )
{
// if there's an error (ehem, IE8), fall back
obj[ prop ] = value;
}
}
}