ac7c79bc4521ce1f1df40b8cace224944a9e61d5
[platform/framework/web/crosswalk-tizen.git] /
1 'use strict';
2
3 var toPosInt = require('../../number/to-pos-integer')
4   , eq    = require('../../object/eq')
5   , value = require('../../object/valid-value')
6
7   , hasOwnProperty = Object.prototype.hasOwnProperty;
8
9 module.exports = function (other) {
10         var i, l;
11         (value(this) && value(other));
12         l = toPosInt(this.length);
13         if (l !== toPosInt(other.length)) return false;
14         for (i = 0; i < l; ++i) {
15                 if (hasOwnProperty.call(this, i) !== hasOwnProperty.call(other, i)) {
16                         return false;
17                 }
18                 if (!eq(this[i], other[i])) return false;
19         }
20         return true;
21 };