Make "Infinity" case-insensitive in number field (#3188)

This commit is contained in:
zochris
2019-10-07 23:16:24 +02:00
committed by Neil Fraser
parent bc4cb542e8
commit fcfeb316e7

View File

@@ -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);