diff options
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/01_build.js | 6 | ||||
-rw-r--r-- | runtime/js/11_workers.js | 2 | ||||
-rw-r--r-- | runtime/js/30_fs.js | 20 | ||||
-rw-r--r-- | runtime/js/40_spawn.js | 2 |
4 files changed, 17 insertions, 13 deletions
diff --git a/runtime/js/01_build.js b/runtime/js/01_build.js index 23a1c819b..778331cdd 100644 --- a/runtime/js/01_build.js +++ b/runtime/js/01_build.js @@ -13,7 +13,11 @@ }; function setBuildInfo(target) { - const [arch, vendor, os, env] = StringPrototypeSplit(target, "-", 4); + const { 0: arch, 1: vendor, 2: os, 3: env } = StringPrototypeSplit( + target, + "-", + 4, + ); build.target = target; build.arch = arch; build.vendor = vendor; diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js index fa544a510..85c01e1a9 100644 --- a/runtime/js/11_workers.js +++ b/runtime/js/11_workers.js @@ -139,7 +139,7 @@ #pollControl = async () => { while (this.#status === "RUNNING") { - const [type, data] = await hostRecvCtrl(this.#id); + const { 0: type, 1: data } = await hostRecvCtrl(this.#id); // If terminate was called then we ignore all messages if (this.#status === "TERMINATED") { diff --git a/runtime/js/30_fs.js b/runtime/js/30_fs.js index 770cef1a8..87b2015fb 100644 --- a/runtime/js/30_fs.js +++ b/runtime/js/30_fs.js @@ -213,7 +213,7 @@ 'const unix = Deno.build.os === "darwin" || Deno.build.os === "linux"; return {'; const typeEntries = ObjectEntries(types); for (let i = 0; i < typeEntries.length; ++i) { - let [name, type] = typeEntries[i]; + let { 0: name, 1: type } = typeEntries[i]; const optional = type.startsWith("?"); if (optional) type = type.slice(1); @@ -243,7 +243,7 @@ return [new Function("view", str), new Uint32Array(offset)]; } - const [statStruct, statBuf] = createByteStruct({ + const { 0: statStruct, 1: statBuf } = createByteStruct({ isFile: "bool", isDirectory: "bool", isSymlink: "bool", @@ -392,8 +392,8 @@ atime, mtime, ) { - const [atimeSec, atimeNsec] = toUnixTimeFromEpoch(atime); - const [mtimeSec, mtimeNsec] = toUnixTimeFromEpoch(mtime); + const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime); + const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime); ops.op_futime_sync(rid, atimeSec, atimeNsec, mtimeSec, mtimeNsec); } @@ -402,8 +402,8 @@ atime, mtime, ) { - const [atimeSec, atimeNsec] = toUnixTimeFromEpoch(atime); - const [mtimeSec, mtimeNsec] = toUnixTimeFromEpoch(mtime); + const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime); + const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime); await core.opAsync( "op_futime_async", rid, @@ -419,8 +419,8 @@ atime, mtime, ) { - const [atimeSec, atimeNsec] = toUnixTimeFromEpoch(atime); - const [mtimeSec, mtimeNsec] = toUnixTimeFromEpoch(mtime); + const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime); + const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime); ops.op_utime_sync( pathFromURL(path), atimeSec, @@ -435,8 +435,8 @@ atime, mtime, ) { - const [atimeSec, atimeNsec] = toUnixTimeFromEpoch(atime); - const [mtimeSec, mtimeNsec] = toUnixTimeFromEpoch(mtime); + const { 0: atimeSec, 1: atimeNsec } = toUnixTimeFromEpoch(atime); + const { 0: mtimeSec, 1: mtimeNsec } = toUnixTimeFromEpoch(mtime); await core.opAsync( "op_utime_async", pathFromURL(path), diff --git a/runtime/js/40_spawn.js b/runtime/js/40_spawn.js index de733d7eb..9c1d96a28 100644 --- a/runtime/js/40_spawn.js +++ b/runtime/js/40_spawn.js @@ -172,7 +172,7 @@ ); } - const [status, stdout, stderr] = await SafePromiseAll([ + const { 0: status, 1: stdout, 2: stderr } = await SafePromiseAll([ this.#status, collectOutput(this.#stdout), collectOutput(this.#stderr), |