From 3d4e95ac57932f75383f79bbb3e52a2a3c6fc202 Mon Sep 17 00:00:00 2001 From: Catherine <whitequark@whitequark.org> Date: Fri, 22 Dec 2023 17:17:21 +0000 Subject: [PATCH] Formatting and comments. NFC --- lib/api-base.js | 1 + lib/wasi-virt.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/api-base.js b/lib/api-base.js index bba7af6..4019d38 100644 --- a/lib/api-base.js +++ b/lib/api-base.js @@ -59,6 +59,7 @@ export class BaseApplication { } async _fetchObject(obj, fetchFn) { + // Mutate the object being fetched, to avoid re-fetches within the same session. for (const [key, value] of Object.entries(obj)) { if (value instanceof URL) { console.log(`[YoWASP runtime] Fetching resource file ${value}`); diff --git a/lib/wasi-virt.js b/lib/wasi-virt.js index 4de4646..666a631 100644 --- a/lib/wasi-virt.js +++ b/lib/wasi-virt.js @@ -350,12 +350,12 @@ export class Environment { now: wallClockNow }, random: { - getRandomBytes: getRandomBytes + getRandomBytes, }, io: { Error: IoError, InputStream, - OutputStream + OutputStream, }, cli: { exit(status) { throw new Exit(status.tag === 'ok' ? 0 : 1); }, @@ -377,7 +377,7 @@ export class Environment { getDirectories() { if ($this.root === null) return []; return [[new Descriptor($this.root), "/"]]; - } + }, } }; }