IE8 does not support Object.defineProperty on non-DOM objects
(see http://stackoverflow.com/questions/3830800/object-defineproperty-in-es5)closure/master
parent
e1d7b80d46
commit
d5f37f294e
|
@ -103,6 +103,8 @@ exports.defineSecureProp = function( obj, prop, value )
|
||||||
obj[ prop ] = value;
|
obj[ prop ] = value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
Object.defineProperty( obj, prop,
|
Object.defineProperty( obj, prop,
|
||||||
{
|
{
|
||||||
|
@ -113,6 +115,12 @@ exports.defineSecureProp = function( obj, prop, value )
|
||||||
configurable: false,
|
configurable: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
catch ( e )
|
||||||
|
{
|
||||||
|
// if there's an error (ehem, IE8), fall back
|
||||||
|
obj[ prop ] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue