summaryrefslogtreecommitdiff
path: root/js/os.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-02-03 10:27:53 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-02-02 18:27:53 -0500
commitefa1eeb8b39cb38b5641a0ee8eab1837beaab4af (patch)
treecd19bdac24b03a6869872553c66874cc31cfcc10 /js/os.ts
parentc3241822522fb2b13792fe5666596888057cf829 (diff)
Compiler cleanups and minor improvements (#1656)
Diffstat (limited to 'js/os.ts')
-rw-r--r--js/os.ts19
1 files changed, 10 insertions, 9 deletions
diff --git a/js/os.ts b/js/os.ts
index 36093c32c..61b6ed974 100644
--- a/js/os.ts
+++ b/js/os.ts
@@ -19,8 +19,6 @@ interface CodeInfo {
filename: string | undefined;
mediaType: msg.MediaType;
sourceCode: string | undefined;
- outputCode: string | undefined;
- sourceMap: string | undefined;
}
/** Exit the Deno process with optional exit code. */
@@ -35,7 +33,7 @@ export function exit(exitCode = 0): never {
// @internal
export function codeFetch(specifier: string, referrer: string): CodeInfo {
- util.log("os.ts codeFetch", specifier, referrer);
+ util.log("os.codeFetch", { specifier, referrer });
// Send CodeFetch message
const builder = flatbuffers.createBuilder();
const specifier_ = builder.createString(specifier);
@@ -58,9 +56,7 @@ export function codeFetch(specifier: string, referrer: string): CodeInfo {
moduleName: codeFetchRes.moduleName() || undefined,
filename: codeFetchRes.filename() || undefined,
mediaType: codeFetchRes.mediaType(),
- sourceCode: codeFetchRes.sourceCode() || undefined,
- outputCode: codeFetchRes.outputCode() || undefined,
- sourceMap: codeFetchRes.sourceMap() || undefined
+ sourceCode: codeFetchRes.sourceCode() || undefined
};
}
@@ -71,7 +67,12 @@ export function codeCache(
outputCode: string,
sourceMap: string
): void {
- util.log("os.ts codeCache", filename, sourceCode, outputCode);
+ util.log("os.codeCache", {
+ filename,
+ sourceCodeLength: sourceCode.length,
+ outputCodeLength: outputCode.length,
+ sourceMapLength: sourceMap.length
+ });
const builder = flatbuffers.createBuilder();
const filename_ = builder.createString(filename);
const sourceCode_ = builder.createString(sourceCode);
@@ -160,7 +161,7 @@ function sendStart(): msg.StartRes {
// This function bootstraps an environment within Deno, it is shared both by
// the runtime and the compiler environments.
// @internal
-export function start(): msg.StartRes {
+export function start(source?: string): msg.StartRes {
libdeno.recv(handleAsyncMsgFromRust);
// First we send an empty `Start` message to let the privileged side know we
@@ -168,7 +169,7 @@ export function start(): msg.StartRes {
// args and other info.
const startResMsg = sendStart();
- util.setLogDebug(startResMsg.debugFlag());
+ util.setLogDebug(startResMsg.debugFlag(), source);
return startResMsg;
}