simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

polyfills.js (631B)


      1 // TODO: remove these polyfills as soon as we have a build process that transpiles the code to ES5
      2 // Polyfill for IE 11 (Number.isFinite is used in `complex.js`)
      3 // source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite
      4 Number.isFinite = Number.isFinite || function (value) {
      5   return typeof value === 'number' && isFinite(value);
      6 }; // Polyfill for IE 11
      7 // source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
      8 
      9 
     10 Number.isNaN = Number.isNaN || function (value) {
     11   return value !== value; // eslint-disable-line no-self-compare
     12 };