]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/shim.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / array / # / map / shim.js
1 'use strict';
2
3 var isPlainArray = require('../../is-plain-array')
4   , callable     = require('../../../object/valid-callable')
5
6   , isArray = Array.isArray, map = Array.prototype.map
7   , forEach = Array.prototype.forEach, call = Function.prototype.call;
8
9 module.exports = function (callbackFn/*, thisArg*/) {
10         var result, thisArg;
11         if (!this || !isArray(this) || isPlainArray(this)) {
12                 return map.apply(this, arguments);
13         }
14         callable(callbackFn);
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);
19         });
20         return result;
21 };