From 9fa0aebfe948573e2912b4e16e46e87837928407 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 17 Aug 2012 02:10:50 -0700 Subject: [PATCH] Add check for V8 bug #2291. Former-commit-id: 245f156a2ce1ee92c8f8f8f34b9891ba4eff0d23 --- test/test.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/test.js b/test/test.js index d5b03c763..372895ae6 100644 --- a/test/test.js +++ b/test/test.js @@ -779,6 +779,26 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isObject'); + + (function() { + test('should avoid V8 bug #2291', function() { + // trigger V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + var obj = {}, + str = 'foo'; + + // 1: Useless comparison statement, this is half the trigger + obj == obj; + // 2: Initial check with object, this is the other half of the trigger + _.isObject(obj); + + equal(_.isObject(str), false); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.isNaN'); (function() {