diff --git a/lib/util.js b/lib/util.js index c257f8f..f8b7cc5 100644 --- a/lib/util.js +++ b/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; + } } }