| Conditions | 2 |
| Paths | 30 |
| Total Lines | 46 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | define(function() { |
||
| 2 | 'use strict'; |
||
| 3 | |||
| 4 | Math.log10 = Math.log10 || function(x) { |
||
|
|
|||
| 5 | return Math.log(x) / Math.LN10; |
||
| 6 | }; |
||
| 7 | |||
| 8 | Math.sign = Math.sign || function(x) { |
||
| 9 | x = +x; // convert to a number |
||
| 10 | if (x === 0 || isNaN(x)) { |
||
| 11 | return x; |
||
| 12 | } |
||
| 13 | return x > 0 ? 1 : -1; |
||
| 14 | }; |
||
| 15 | |||
| 16 | // copied from https://developer.mozilla.org/ |
||
| 17 | /* eslint-disable */ |
||
| 18 | if (!Function.prototype.bind) { |
||
| 19 | Function.prototype.bind = function(oThis) { |
||
| 20 | if (typeof this !== 'function') { |
||
| 21 | // closest thing possible to the ECMAScript 5 |
||
| 22 | // internal IsCallable function |
||
| 23 | throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable'); |
||
| 24 | } |
||
| 25 | |||
| 26 | var aArgs = Array.prototype.slice.call(arguments, 1), |
||
| 27 | fToBind = this, |
||
| 28 | fNOP = function() {}, |
||
| 29 | fBound = function() { |
||
| 30 | return fToBind.apply(this instanceof fNOP |
||
| 31 | ? this |
||
| 32 | : oThis, |
||
| 33 | aArgs.concat(Array.prototype.slice.call(arguments))); |
||
| 34 | }; |
||
| 35 | |||
| 36 | if (this.prototype) { |
||
| 37 | // Function.prototype doesn't have a prototype property |
||
| 38 | fNOP.prototype = this.prototype; |
||
| 39 | } |
||
| 40 | fBound.prototype = new fNOP(); |
||
| 41 | |||
| 42 | return fBound; |
||
| 43 | }; |
||
| 44 | } |
||
| 45 | /* eslint-enable */ |
||
| 46 | }); |
||
| 47 |