From 258d66f9cf5543d69b7e01b193a95cc056e37bbd Mon Sep 17 00:00:00 2001 From: Robin North Date: Wed, 31 Jan 2018 22:25:01 +0000 Subject: [PATCH] Remove polyfill for Function.prototype.bind --- lib/polyfills/Function.prototype.bind.js | 20 -------------------- lib/proto/attach-form.js | 2 -- lib/proto/attach-link.js | 2 -- 3 files changed, 24 deletions(-) delete mode 100644 lib/polyfills/Function.prototype.bind.js diff --git a/lib/polyfills/Function.prototype.bind.js b/lib/polyfills/Function.prototype.bind.js deleted file mode 100644 index d54bcb5..0000000 --- a/lib/polyfills/Function.prototype.bind.js +++ /dev/null @@ -1,20 +0,0 @@ -if (!Function.prototype.bind) { - Function.prototype.bind = function(oThis) { - if (typeof this !== "function") { - // closest thing possible to the ECMAScript 5 internal IsCallable function - throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable") - } - - var aArgs = Array.prototype.slice.call(arguments, 1) - var that = this - var Fnoop = function() {} - var fBound = function() { - return that.apply(this instanceof Fnoop && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))) - } - - Fnoop.prototype = this.prototype - fBound.prototype = new Fnoop() - - return fBound - } -} diff --git a/lib/proto/attach-form.js b/lib/proto/attach-form.js index 5850222..fa4d6af 100644 --- a/lib/proto/attach-form.js +++ b/lib/proto/attach-form.js @@ -1,5 +1,3 @@ -require("../polyfills/Function.prototype.bind") - var on = require("../events/on") var clone = require("../clone") diff --git a/lib/proto/attach-link.js b/lib/proto/attach-link.js index 398d8ec..f7009e5 100644 --- a/lib/proto/attach-link.js +++ b/lib/proto/attach-link.js @@ -1,5 +1,3 @@ -require("../polyfills/Function.prototype.bind") - var on = require("../events/on") var clone = require("../clone")