]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/shim.js
2ee731347b1aee539a64250404656f89c380d43b
3 var isPlainArray
= require('../../is-plain-array')
4 , callable
= require('../../../object/valid-callable')
6 , isArray
= Array
.isArray
, map
= Array
.prototype.map
7 , forEach
= Array
.prototype.forEach
, call
= Function
.prototype.call
;
9 module
.exports = function (callbackFn
/*, thisArg*/) {
11 if (!this || !isArray(this) || isPlainArray(this)) {
12 return map
.apply(this, arguments
);
15 thisArg
= arguments
[1];
16 result
= new this.constructor(this.length
);
17 forEach
.call(this, function (val
, i
, self
) {
18 result
[i
] = call
.call(callbackFn
, thisArg
, val
, i
, self
);