From 3410f42e5ec7699de1337781ce7afe7984a61ed8 Mon Sep 17 00:00:00 2001 From: adroitwhiz Date: Thu, 25 Apr 2019 16:41:51 -0400 Subject: [PATCH] Remove Number.isNaN IE polyfill --- src/util/cast.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/util/cast.js b/src/util/cast.js index 14089cd9f..042ebcd5d 100644 --- a/src/util/cast.js +++ b/src/util/cast.js @@ -1,13 +1,5 @@ const Color = require('../util/color'); -/** - * Store and possibly polyfill Number.isNaN. Number.isNaN can save time over - * self.isNaN by not coercing its input. We need to polyfill it to support - * Internet Explorer. - * @const - */ -const _NumberIsNaN = Number.isNaN || isNaN; - /** * @fileoverview * Utilities for casting and comparing Scratch data-types. @@ -33,13 +25,13 @@ class Cast { if (typeof value === 'number') { // Scratch treats NaN as 0, when needed as a number. // E.g., 0 + NaN -> 0. - if (_NumberIsNaN(value)) { + if (Number.isNaN(value)) { return 0; } return value; } const n = Number(value); - if (_NumberIsNaN(n)) { + if (Number.isNaN(n)) { // Scratch treats NaN as 0, when needed as a number. // E.g., 0 + NaN -> 0. return 0;