You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on new File IO abstractions and found this TODO issue:
if (__buffered != null) {
// TODO: Is this correct for readByte()?
// Emit the last remaining bytes.
var result = __buffered
__buffered = null
__waitingFiber.transfer(result)
This behavior is clearly incorrect. If the input closes then the last call to readByte will return a string with all remaining buffered data (or an empty string), not a byte. This begs the question of what SHOULD happen? I would suggest that repeat calls to readByte should continue to return bytes until either null (is returned repeatedly) or a Fiber.abort is triggered.
This is the same question as with readLine on whether reaching the EOF should be an error condition or not.
Working on new File IO abstractions and found this TODO issue:
This behavior is clearly incorrect. If the input closes then the last call to readByte will return a string with all remaining buffered data (or an empty string), not a byte. This begs the question of what SHOULD happen? I would suggest that repeat calls to
readByte
should continue to return bytes until eithernull
(is returned repeatedly) or aFiber.abort
is triggered.This is the same question as with
readLine
on whether reaching the EOF should be an error condition or not.Related: #125
The text was updated successfully, but these errors were encountered: