From 65457208e5c78ea9d0da19159bc8d3ca20e8357a Mon Sep 17 00:00:00 2001 From: jdalton Date: Fri, 10 Apr 2015 15:41:48 -0700 Subject: [PATCH] Fix feature test for IE tech preview. --- lodash.src.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index b2b0bdcc5..a28637079 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -775,6 +775,7 @@ getOwnPropertySymbols = isNative(getOwnPropertySymbols = Object.getOwnPropertySymbols) && getOwnPropertySymbols, getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, push = arrayProto.push, + preventExtensions = isNative(Object.preventExtensions = Object.preventExtensions) && preventExtensions, propertyIsEnumerable = objectProto.propertyIsEnumerable, Set = isNative(Set = context.Set) && Set, setTimeout = context.setTimeout, @@ -796,13 +797,13 @@ /** Used as `baseAssign`. */ var nativeAssign = (function() { - var object = Object('x'), - func = isNative(func = Object.assign) && func; + var object = { '1': 0 }, + func = preventExtensions && isNative(func = Object.assign) && func; // Avoid `Object.assign` in Firefox 34-37 which have an early implementation // with a slower try/catch behavior. See https://bugzilla.mozilla.org/show_bug.cgi?id=1103344 // for more details. - try { func(object, 'xo'); } catch(e) {} + try { func(preventExtensions(object), 'xo'); } catch(e) {} return !object[1] && func; }());