From d6873d1cc931a6067c0431b161d4ba4a36658b03 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sat, 11 Jun 2011 21:32:11 -0400 Subject: [PATCH] Corrected client-side assert.deepEqual() to only perform object/array operations if both provided values are objects/arrays respectively --- tools/combine-test.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/combine-test.tpl b/tools/combine-test.tpl index 3e07c31..08540b9 100644 --- a/tools/combine-test.tpl +++ b/tools/combine-test.tpl @@ -73,7 +73,7 @@ module.assert = { exports: { return; } - if ( cmp instanceof Array ) + if ( ( cmp instanceof Array ) && ( val instanceof Array ) ) { var i = 0, len = cmp.length; @@ -86,7 +86,7 @@ module.assert = { exports: { return; } - else if ( cmp instanceof Object ) + else if ( ( typeof cmp === 'object' ) && ( typeof val === 'object' ) ) { for ( var i in cmp ) {