fix: [ws] sock shouldn't throw eof error when failed to read frame (#4083)

This commit is contained in:
Yusuke Sakurai 2020-02-24 01:59:36 +09:00 committed by GitHub
parent e9fff02e96
commit d9886a44d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 136 additions and 56 deletions

View file

@ -378,3 +378,8 @@ export function unimplemented(msg?: string): never {
export function unreachable(): never {
throw new AssertionError("unreachable");
}
export function assertNotEOF<T extends {}>(val: T | Deno.EOF): T {
assertNotEquals(val, Deno.EOF);
return val as T;
}