diff options
| author | jmoenig <jens@moenig.org> | 2014-06-05 17:13:27 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2014-06-05 17:13:27 +0200 |
| commit | f80235ee43f21db5a4036ce0cdbea65cc821899b (patch) | |
| tree | ecc6e15cfb6250d916d9263e85eb514295eb7dc2 /objects.js | |
| parent | cdfe8b900af7a5e2091c05de57fd46306f5e58b0 (diff) | |
| download | snap-f80235ee43f21db5a4036ce0cdbea65cc821899b.tar.gz snap-f80235ee43f21db5a4036ce0cdbea65cc821899b.zip | |
stop replacing the empty string with the number zero in watchers
fixed #473
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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(); |
