summaryrefslogtreecommitdiff
path: root/os.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-25 15:36:13 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-25 16:16:28 -0400
commit0fe6ab91df7158cacd5c2a632d36066251a292c4 (patch)
tree054673ba8b49ce6a122cf02612a80ecb5c89f0aa /os.ts
parent5b858632acb672c1f38145edac9df11fdbcacad6 (diff)
Finish de-oneof-ing
Diffstat (limited to 'os.ts')
-rw-r--r--os.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/os.ts b/os.ts
index de4bdf436..258524afc 100644
--- a/os.ts
+++ b/os.ts
@@ -3,8 +3,11 @@ import { sendMsg } from "./dispatch";
import { main as pb } from "./msg.pb";
import { assert } from "./util";
-export function exit(code = 0): void {
- sendMsg("os", { exit: { code } });
+export function exit(exitCode = 0): void {
+ sendMsg("os", {
+ command: pb.Msg.Command.EXIT,
+ exitCode
+ });
}
export function sourceCodeFetch(
@@ -12,7 +15,9 @@ export function sourceCodeFetch(
containingFile: string
): ModuleInfo {
const res = sendMsg("os", {
- sourceCodeFetch: { moduleSpecifier, containingFile }
+ command: pb.Msg.Command.SOURCE_CODE_FETCH,
+ sourceCodeFetchModuleSpecifier: moduleSpecifier,
+ sourceCodeFetchContainingFile: containingFile
});
assert(res.command === pb.Msg.Command.SOURCE_CODE_FETCH_RES);
return {
@@ -29,6 +34,9 @@ export function sourceCodeCache(
outputCode: string
): void {
sendMsg("os", {
- sourceCodeCache: { filename, sourceCode, outputCode }
+ command: pb.Msg.Command.SOURCE_CODE_CACHE,
+ sourceCodeCacheFilename: filename,
+ sourceCodeCacheSourceCode: sourceCode,
+ sourceCodeCacheOutputCode: outputCode
});
}