From fcfeb316e7e863bfe6d66209485ff61f1e8845b4 Mon Sep 17 00:00:00 2001 From: zochris <20927697+zochris@users.noreply.github.com> Date: Mon, 7 Oct 2019 23:16:24 +0200 Subject: [PATCH] Make "Infinity" case-insensitive in number field (#3188) --- core/field_number.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/field_number.js b/core/field_number.js index 396cac7f5..be5ac735d 100644 --- a/core/field_number.js +++ b/core/field_number.js @@ -274,6 +274,8 @@ Blockly.FieldNumber.prototype.doClassValidation_ = function(opt_newValue) { newValue = newValue.replace(/O/ig, '0'); // Strip out thousands separators. newValue = newValue.replace(/,/g, ''); + // Ignore case of 'Infinity'. + newValue = newValue.replace(/infinity/i, 'Infinity'); // Clean up number. var n = Number(newValue || 0);