From 641cd63462855299e52c652cd0c0ad7cebd49bce Mon Sep 17 00:00:00 2001 From: jdalton Date: Wed, 22 Apr 2015 20:17:39 -0700 Subject: [PATCH] Fix old V8 JIT bug that has cropped up again. --- lodash.src.js | 5 +++-- test/test.js | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 92f502f78..e43613f62 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -1016,6 +1016,7 @@ (function(x) { var Ctor = function() { this.x = x; }, + args = arguments, object = { '0': x, 'length': x }, props = []; @@ -1029,7 +1030,7 @@ * @memberOf _.support * @type boolean */ - support.argsTag = objToString.call(arguments) == argsTag; + support.argsTag = objToString.call(args) == argsTag; /** * Detect if `name` or `message` properties of `Error.prototype` are @@ -1158,7 +1159,7 @@ * @type boolean */ try { - support.nonEnumArgs = !propertyIsEnumerable.call(arguments, 1); + support.nonEnumArgs = !propertyIsEnumerable.call(args, 1); } catch(e) { support.nonEnumArgs = true; } diff --git a/test/test.js b/test/test.js index 83df6c3bc..bc5e869c4 100644 --- a/test/test.js +++ b/test/test.js @@ -8973,7 +8973,7 @@ }); test('`_.' + methodName + '` should work with `arguments` objects (test in IE < 9)', 1, function() { - if (!(isPhantom || isStrict)) { + if (!isStrict) { deepEqual(func(args).sort(), ['0', '1', '2']); } else { @@ -8982,7 +8982,7 @@ }); test('`_.' + methodName + '` should return keys for custom properties on `arguments` objects', 1, function() { - if (!(isPhantom || isStrict)) { + if (!isStrict) { args.a = 1; deepEqual(func(args).sort(), ['0', '1', '2', 'a']); delete args.a; @@ -8993,7 +8993,7 @@ }); test('`_.' + methodName + '` should ' + (isKeys ? 'not' : '') + ' include inherited properties of `arguments` objects', 1, function() { - if (!(isPhantom || isStrict)) { + if (!isStrict) { var expected = isKeys ? ['0', '1', '2'] : ['0', '1', '2', 'a']; objectProto.a = 1;