summaryrefslogtreecommitdiff
path: root/std/ws/mod.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/ws/mod.ts')
-rw-r--r--std/ws/mod.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/ws/mod.ts b/std/ws/mod.ts
index 2a18cded7..569936706 100644
--- a/std/ws/mod.ts
+++ b/std/ws/mod.ts
@@ -338,11 +338,11 @@ class WebSocketImpl implements WebSocket {
async read(p: Uint8Array): Promise<number | null> {
for await (const ev of this.receive()) {
if (ev instanceof Uint8Array) {
- return copyBytes(p, ev);
+ return copyBytes(ev, p);
}
if (typeof ev === "string") {
- return copyBytes(p, encode(ev));
+ return copyBytes(encode(ev), p);
}
}