diff --git a/lodash.js b/lodash.js index fa484326d..f8cce34a6 100644 --- a/lodash.js +++ b/lodash.js @@ -129,7 +129,11 @@ * @returns {Function} Returns the `lodash` function. */ function runInContext(context) { - context = context ? _.defaults({}, context, _.pick(window, contextProps)) : window; + // Avoid issues with some ES3 environments that attempt to use values, named + // after built-in constructors like `Object`, for the creation of literals. + // ES5 clears this up by stating that literals must use built-in constructors. + // See http://es5.github.com/#x11.1.5. + context = context ? _.defaults(window.Object(), context, _.pick(window, contextProps)) : window; /** Native constructor references */ var Array = context.Array,