From 8c48436c8f162171fe0572cb04a7ff181480bd61 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Fri, 15 Jul 2016 20:05:45 -0700 Subject: [PATCH] Fix validation on number field. --- core/field_number.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/field_number.js b/core/field_number.js index cd773cb87..94cda5108 100644 --- a/core/field_number.js +++ b/core/field_number.js @@ -31,7 +31,7 @@ goog.require('goog.math'); /** * Class for an editable number field. - * @param {string} value The initial content of the field. + * @param {number|string} value The initial content of the field. * @param {number|string|undefined} opt_min Minimum value. * @param {number|string|undefined} opt_max Maximum value. * @param {number|string|undefined} opt_precision Precision for value. @@ -68,7 +68,7 @@ Blockly.FieldNumber.prototype.setConstraints = function(min, max, precision) { this.min_ = isNaN(min) ? -Infinity : min; max = parseFloat(max); this.max_ = isNaN(max) ? Infinity : max; - this.setValue(this.callValidator(this.getValue)); + this.setValue(this.callValidator(this.getValue())); }; /**