From f80235ee43f21db5a4036ce0cdbea65cc821899b Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 5 Jun 2014 17:13:27 +0200 Subject: stop replacing the empty string with the number zero in watchers fixed #473 --- objects.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index dc02051..e3f1674 100644 --- a/objects.js +++ b/objects.js @@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2014-Jun-04'; +modules.objects = '2014-Jun-05'; var SpriteMorph; var StageMorph; @@ -6591,9 +6591,11 @@ WatcherMorph.prototype.update = function () { } else { newValue = this.target[this.getter](); } - num = +newValue; - if (typeof newValue !== 'boolean' && !isNaN(num)) { - newValue = Math.round(newValue * 1000000000) / 1000000000; + if (newValue !== '' && !isNil(newValue)) { + num = +newValue; + if (typeof newValue !== 'boolean' && !isNaN(num)) { + newValue = Math.round(newValue * 1000000000) / 1000000000; + } } if (newValue !== this.currentValue) { this.changed(); -- cgit v1.3.1