Revert "try to avoid blocking once we are committed to an error"
This reverts commit 40cd1ea083
,
which as added accidentally.
This commit is contained in:
parent
97e9a17dac
commit
227d48e732
|
@ -199,12 +199,6 @@
|
|||
(string->jsexpr @T{ falsetto }) =error> "string->jsexpr:"
|
||||
(string->jsexpr @T{ nullity }) =error> "string->jsexpr:"
|
||||
(string->jsexpr @T{ nulliparous }) =error> "string->jsexpr:"
|
||||
(let ()
|
||||
(define-values (in out) (make-pipe))
|
||||
(display "started" out)
|
||||
(flush-output out)
|
||||
(read-json in))
|
||||
=error> #rx"read-json: bad input starting #\"started\""
|
||||
))
|
||||
|
||||
(test do (pred-tests)
|
||||
|
|
|
@ -466,17 +466,16 @@
|
|||
[else (bad-input)]))
|
||||
;;
|
||||
(define (bad-input [prefix #""] #:eof? [eof? #f])
|
||||
(define bstr (make-bytes (sub1 (error-print-width))))
|
||||
(define bytes-read (peek-bytes-avail! bstr 0 #f i))
|
||||
(if (or (and (eof-object? bytes-read) (equal? prefix #""))
|
||||
(define bstr (peek-bytes (sub1 (error-print-width)) 0 i))
|
||||
(if (or (and (eof-object? bstr) (equal? prefix #""))
|
||||
eof?)
|
||||
(err (string-append "unexpected end-of-file"
|
||||
(if (equal? prefix #"")
|
||||
""
|
||||
(format "after ~e" prefix))))
|
||||
(err (format "bad input starting ~e" (bytes-append prefix (if (number? bytes-read)
|
||||
(subbytes bstr 0 bytes-read)
|
||||
#""))))))
|
||||
(err (format "bad input starting ~e" (bytes-append prefix (if (eof-object? bstr)
|
||||
#""
|
||||
bstr))))))
|
||||
;;
|
||||
(read-json #t))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user