summaryrefslogtreecommitdiff
path: root/os.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-22 14:23:42 +0200
committerGitHub <noreply@github.com>2018-06-22 14:23:42 +0200
commit86354a29a40fb97e334f951428239ab8e171e2dd (patch)
tree2f0d8cc2680aa4ccbaf865b427976b3f810b6920 /os.ts
parentef9dc2464e10510bdcc4be9eae431e3dcf7f7999 (diff)
Delete go implementation (#276)
The go prototype will remain at https://github.com/ry/deno/tree/golang
Diffstat (limited to 'os.ts')
-rw-r--r--os.ts65
1 files changed, 0 insertions, 65 deletions
diff --git a/os.ts b/os.ts
deleted file mode 100644
index a51c6ec5d..000000000
--- a/os.ts
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2018 Ryan Dahl <ry@tinyclouds.org>
-// All rights reserved. MIT License.
-import { ModuleInfo } from "./types";
-import { pubInternal } from "./dispatch";
-import { deno as pb } from "./msg.pb";
-import { assert } from "./util";
-
-export function exit(exitCode = 0): void {
- pubInternal("os", {
- command: pb.Msg.Command.EXIT,
- exitCode
- });
-}
-
-export function codeFetch(
- moduleSpecifier: string,
- containingFile: string
-): ModuleInfo {
- const res = pubInternal("os", {
- command: pb.Msg.Command.CODE_FETCH,
- codeFetchModuleSpecifier: moduleSpecifier,
- codeFetchContainingFile: containingFile
- });
- assert(res.command === pb.Msg.Command.CODE_FETCH_RES);
- return {
- moduleName: res.codeFetchResModuleName,
- filename: res.codeFetchResFilename,
- sourceCode: res.codeFetchResSourceCode,
- outputCode: res.codeFetchResOutputCode
- };
-}
-
-export function codeCache(
- filename: string,
- sourceCode: string,
- outputCode: string
-): void {
- pubInternal("os", {
- command: pb.Msg.Command.CODE_CACHE,
- codeCacheFilename: filename,
- codeCacheSourceCode: sourceCode,
- codeCacheOutputCode: outputCode
- });
-}
-
-export function readFileSync(filename: string): Uint8Array {
- const res = pubInternal("os", {
- command: pb.Msg.Command.READ_FILE_SYNC,
- readFileSyncFilename: filename
- });
- return res.readFileSyncData;
-}
-
-export function writeFileSync(
- filename: string,
- data: Uint8Array,
- perm: number
-): void {
- pubInternal("os", {
- command: pb.Msg.Command.WRITE_FILE_SYNC,
- writeFileSyncFilename: filename,
- writeFileSyncData: data,
- writeFileSyncPerm: perm
- });
-}