From 83d08e3aba7b44141c8dea009bcb28ddb5c35a7d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 16 Aug 2012 22:22:08 -0700 Subject: [PATCH] Avoid false positives for `arguments` objects in IE < 9 when using `isPlainObject`. Former-commit-id: 19e5a6efed32f26d0c908771eec40e7fb2ecf265 --- lodash.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 5f2327b43..956985fe7 100644 --- a/lodash.js +++ b/lodash.js @@ -744,8 +744,9 @@ * @returns {Boolean} Returns `true` if the `value` is a plain `Object` object, else `false`. */ function isPlainObject(value) { + // avoid non-objects and false positives for `arguments` objects in IE < 9 var result = false; - if (!(value && typeof value == 'object')) { + if (!(value && typeof value == 'object') || (noArgumentsClass && isArguments(value))) { return result; } // IE < 9 presents DOM nodes as `Object` objects except they have `toString`