mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +00:00
1 line
4.7 KiB
JSON
1 line
4.7 KiB
JSON
|
{"ast":null,"code":"'use strict';\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n\n var args = slice.call(arguments, 1);\n var bound;\n\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(this, args.concat(slice.call(arguments)));\n\n if (Object(result) === result) {\n return result;\n }\n\n return this;\n } else {\n return target.apply(that, args.concat(slice.call(arguments)));\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};","map":{"version":3,"sources":["/app/node_modules/function-bind/implementation.js"],"names":["ERROR_MESSAGE","slice","Array","prototype","toStr","Object","toString","funcType","module","exports","bind","that","target","call","TypeError","args","arguments","bound","binder","result","apply","concat","boundLength","Math","max","length","boundArgs","i","push","Function","join","Empty"],"mappings":"AAAA;AAEA;;AAEA,IAAIA,aAAa,GAAG,iDAApB;AACA,IAAIC,KAAK,GAAGC,KAAK,CAACC,SAAN,CAAgBF,KAA5B;AACA,IAAIG,KAAK,GAAGC,MAAM,CAACF,SAAP,CAAiBG,QAA7B;AACA,IAAIC,QAAQ,GAAG,mBAAf;;AAEAC,MAAM,CAACC,OAAP,GAAiB,SAASC,IAAT,CAAcC,IAAd,EAAoB;AACjC,MAAIC,M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EAAsB;AAClB,QAAI4B,KAAK,GAAG,SAASA,KAAT,GAAiB,CAAE,CAA/B;;AACAA,IAAAA,KAAK,CAAC5B,SAAN,GAAkBS,MAAM,CAACT,SAAzB;AACAc,IAAAA,KAAK,CAACd,SAAN,GAAkB,IAAI4B,KAAJ,EAAlB;AACAA,IAAAA,KAAK,CAAC5B,SAAN,GAAkB,IAAlB;AACH;;AAED,SAAOc,KAAP;AACH,CA1CD","sourcesContent":["'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n
|