summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-copy.js
blob: ac7c79bc4521ce1f1df40b8cace224944a9e61d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';

var toPosInt = require('../../number/to-pos-integer')
  , eq    = require('../../object/eq')
  , value = require('../../object/valid-value')

  , hasOwnProperty = Object.prototype.hasOwnProperty;

module.exports = function (other) {
	var i, l;
	(value(this) && value(other));
	l = toPosInt(this.length);
	if (l !== toPosInt(other.length)) return false;
	for (i = 0; i < l; ++i) {
		if (hasOwnProperty.call(this, i) !== hasOwnProperty.call(other, i)) {
			return false;
		}
		if (!eq(this[i], other[i])) return false;
	}
	return true;
};