From dbc60207f57cf30dc06bd8ad80d9e35eff100bff Mon Sep 17 00:00:00 2001 From: Bernhard Sirlinger Date: Wed, 28 May 2014 16:58:16 +0200 Subject: [PATCH] Fix jshint errors --- test/polyfills.js | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/test/polyfills.js b/test/polyfills.js index 2776fa95e..1237ebac3 100644 --- a/test/polyfills.js +++ b/test/polyfills.js @@ -1,21 +1,25 @@ -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"); - } +(function () { + "use strict"; - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, - fNOP = function () {}, - fBound = function () { - return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); - }; + 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"); + } - fNOP.prototype = this.prototype; - fBound.prototype = new fNOP(); + var aArgs = Array.prototype.slice.call(arguments, 1), + fToBind = this, + FNOP = function () {}, + fBound = function () { + return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); + }; - return fBound; - }; -} + FNOP.prototype = this.prototype; + fBound.prototype = new FNOP(); + + return fBound; + }; + } +}());