mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -05:00
26 lines
576 B
TypeScript
26 lines
576 B
TypeScript
import { ModuleInfo } from "./types";
|
|
import { sendMsg } from "./dispatch";
|
|
|
|
export function exit(code = 0): void {
|
|
sendMsg("os", { exit: { code } });
|
|
}
|
|
|
|
export function sourceCodeFetch(
|
|
moduleSpecifier: string,
|
|
containingFile: string
|
|
): ModuleInfo {
|
|
const res = sendMsg("os", {
|
|
sourceCodeFetch: { moduleSpecifier, containingFile }
|
|
});
|
|
return res.sourceCodeFetchRes;
|
|
}
|
|
|
|
export function sourceCodeCache(
|
|
filename: string,
|
|
sourceCode: string,
|
|
outputCode: string
|
|
): void {
|
|
sendMsg("os", {
|
|
sourceCodeCache: { filename, sourceCode, outputCode }
|
|
});
|
|
}
|