#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Mon, 23 Jan 2017 11:39:35 +0100
changeset 21270 fd671950be41
parent 21269 a12e4696432c
child 21271 1dd0940b1283
#BUGFIX by cg class: LimitedPrecisionReal changed: #readFrom:onError: DNU in readFrom:onError: if the error-block does not return a float (eg. a nil). May not try to coerce then.
LimitedPrecisionReal.st
--- a/LimitedPrecisionReal.st	Fri Jan 20 22:58:32 2017 +0100
+++ b/LimitedPrecisionReal.st	Mon Jan 23 11:39:35 2017 +0100
@@ -312,7 +312,7 @@
 
     |num|
 
-    num := super readFrom:aStringOrStream onError:exceptionBlock.
+    num := super readFrom:aStringOrStream onError:[^ exceptionBlock value].
     ^ self coerce:num
 
     "
@@ -327,6 +327,10 @@
      LongFloat readFrom:'.1'
      LongFloat readFrom:'0.1'
      LongFloat readFrom:'0'
+
+     LimitedPrecisionReal readFrom:'bla' onError:nil
+     Float readFrom:'bla' onError:nil
+     ShortFloat readFrom:'bla' onError:nil
     "
 
     "Created: / 07-01-1998 / 16:17:19 / cg"
@@ -1193,6 +1197,7 @@
 ! !
 
 
+
 !LimitedPrecisionReal methodsFor:'printing & storing'!
 
 printOn:aStream
@@ -1263,6 +1268,7 @@
    ^ 0
 ! !
 
+
 !LimitedPrecisionReal methodsFor:'testing'!
 
 isFinite