diff --git a/red/runtime/util.js b/red/runtime/util.js index 9e96bc4b6..8c51f2cda 100644 --- a/red/runtime/util.js +++ b/red/runtime/util.js @@ -62,31 +62,55 @@ function cloneMessage(msg) { } function compareObjects(obj1,obj2) { + var i; if (obj1 === obj2) { return true; } if (obj1 == null || obj2 == null) { return false; } - if (!(obj1 instanceof Object) && !(obj2 instanceof Object)) { - return false; - } + var isArray1 = Array.isArray(obj1); var isArray2 = Array.isArray(obj2); if (isArray1 != isArray2) { return false; } if (isArray1 && isArray2) { - if (obj1.length != obj2.length) { + if (obj1.length !== obj2.length) { return false; } - for (var i=0;i