mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Make "Infinity" case-insensitive in number field (#3188)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user