diff --git a/lodash.js b/lodash.js index f5b0162e5..f3b700f5e 100644 --- a/lodash.js +++ b/lodash.js @@ -875,21 +875,6 @@ */ support.funcNames = typeof Function.name == 'string'; - /** - * Detect if `arguments` object indexes are non-enumerable - * (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1). - * - * Chrome < 25 and Node.js < 0.11.0 will treat `arguments` object indexes - * that exceed their function's formal parameters and whose associated - * values are `0` as non-enumerable and incorrectly return `false` from - * `Object#hasOwnProperty`. - * - * @memberOf _.support - * @type boolean - */ - support.nonEnumArgs = !(argsKey == '1' && hasOwnProperty.call(arguments, '1') && - propertyIsEnumerable.call(arguments, '1')); - /** * Detect if string indexes are non-enumerable * (IE < 9, RingoJS, Rhino, Narwhal). @@ -972,6 +957,25 @@ } catch(e) { support.nodeClass = true; } + + /** + * Detect if `arguments` object indexes are non-enumerable + * (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1). + * + * Chrome < 25 and Node.js < 0.11.0 will treat `arguments` object indexes + * that exceed their function's formal parameters and whose associated + * values are `0` as non-enumerable and incorrectly return `false` from + * `Object#hasOwnProperty`. + * + * @memberOf _.support + * @type boolean + */ + try { + support.nonEnumArgs = !(argsKey == '1' && hasOwnProperty.call(arguments, '1') && + propertyIsEnumerable.call(arguments, '1')); + } catch(e) { + support.nonEnumArgs = true; + } }(0, 0)); /**