]> 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/function/#/copy.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 / function / # / copy.js
1 'use strict';
2
3 var mixin         = require('../../object/mixin')
4   , validFunction = require('../valid-function')
5
6   , re = /^\s*function\s*([\0-'\)-\uffff]+)*\s*\(([\0-\(\*-\uffff]*)\)\s*\{/;
7
8 module.exports = function () {
9         var match = String(validFunction(this)).match(re), fn;
10
11         fn = new Function('fn', 'return function ' + match[1].trim() + '(' +
12                 match[2] + ') { return fn.apply(this, arguments); };')(this);
13         try { mixin(fn, this); } catch (ignore) {}
14         return fn;
15 };