diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-08-15 20:57:36 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-08-20 16:53:39 -0400 |
commit | 868e8d88662ad5691212afc733e83f5de1c0979d (patch) | |
tree | b8edff8614255140f1b79f4f563457157a1271f7 /js/main.ts | |
parent | 7b0618c20b5348230304323efd75bc65361bbe1e (diff) |
First pass at fetch()
With help from Thomas Ghysels <info@thomasg.be>
Diffstat (limited to 'js/main.ts')
-rw-r--r-- | js/main.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/main.ts b/js/main.ts index c712f7e08..d035f9ba6 100644 --- a/js/main.ts +++ b/js/main.ts @@ -7,6 +7,7 @@ import * as os from "./os"; import * as runtime from "./runtime"; import { libdeno } from "./globals"; import * as timers from "./timers"; +import { onFetchRes } from "./fetch"; function startMsg(cmdId: number): Uint8Array { const builder = new flatbuffers.Builder(); @@ -24,6 +25,12 @@ function onMessage(ui8: Uint8Array) { const bb = new flatbuffers.ByteBuffer(ui8); const base = fbs.Base.getRootAsBase(bb); switch (base.msgType()) { + case fbs.Any.FetchRes: { + const msg = new fbs.FetchRes(); + assert(base.msg(msg) != null); + onFetchRes(base, msg); + break; + } case fbs.Any.TimerReady: { const msg = new fbs.TimerReady(); assert(base.msg(msg) != null); |