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
20
lib/util.js
20
lib/util.js
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue