'use strict';/* eslint no-invalid-this: 1 */var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';var slice = Array.prototype.slice;var toStr = Object.prototype.toString;var funcType = '[object Function]';module.exports = function bind(that) {var target = this;if (typeof target !== 'function' || toStr.call(target) !== funcType) {throw new TypeError(ERROR_MESSAGE + target);}var args = slice.call(arguments, 1);var bound;var binder = function () {if (this instanceof bound) {var result = target.apply(this,args.concat(slice.call(arguments)));if (Object(result) === result) {return result;}return this;} else {return target.apply(that,args.concat(slice.call(arguments)));}};var boundLength = Math.max(0, target.length - args.length);var boundArgs = [];for (var i = 0; i < boundLength; i++) {boundArgs.push('$' + i);}bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);if (target.prototype) {var Empty = function Empty() {};Empty.prototype = target.prototype;bound.prototype = new Empty();Empty.prototype = null;}return bound;};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。