summaryrefslogtreecommitdiff
path: root/runtime/js
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/js')
-rw-r--r--runtime/js/11_workers.js8
-rw-r--r--runtime/js/13_buffer.js12
-rw-r--r--runtime/js/30_fs.js4
-rw-r--r--runtime/js/99_main.js2
4 files changed, 14 insertions, 12 deletions
diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js
index 641833778..5660b291c 100644
--- a/runtime/js/11_workers.js
+++ b/runtime/js/11_workers.js
@@ -192,16 +192,16 @@
this.#poll();
}
- #handleMessage = (data) => {
+ #handleMessage(data) {
const msgEvent = new MessageEvent("message", {
cancelable: false,
data,
});
this.dispatchEvent(msgEvent);
- };
+ }
- #handleError = (e) => {
+ #handleError(e) {
const event = new ErrorEvent("error", {
cancelable: true,
message: e.message,
@@ -219,7 +219,7 @@
}
return handled;
- };
+ }
#poll = async () => {
while (!this.#terminated) {
diff --git a/runtime/js/13_buffer.js b/runtime/js/13_buffer.js
index fcb656c0f..ff9e11f2c 100644
--- a/runtime/js/13_buffer.js
+++ b/runtime/js/13_buffer.js
@@ -73,19 +73,19 @@
this.#off = 0;
}
- #tryGrowByReslice = (n) => {
+ #tryGrowByReslice(n) {
const l = this.#buf.byteLength;
if (n <= this.capacity - l) {
this.#reslice(l + n);
return l;
}
return -1;
- };
+ }
- #reslice = (len) => {
+ #reslice(len) {
assert(len <= this.#buf.buffer.byteLength);
this.#buf = new Uint8Array(this.#buf.buffer, 0, len);
- };
+ }
readSync(p) {
if (this.empty()) {
@@ -117,7 +117,7 @@
return Promise.resolve(n);
}
- #grow = (n) => {
+ #grow(n) {
const m = this.length;
// If buffer is empty, reset to recover space.
if (m === 0 && this.#off !== 0) {
@@ -147,7 +147,7 @@
this.#off = 0;
this.#reslice(Math.min(m + n, MAX_SIZE));
return m;
- };
+ }
grow(n) {
if (n < 0) {
diff --git a/runtime/js/30_fs.js b/runtime/js/30_fs.js
index 67c3d4a1f..11e9b32ef 100644
--- a/runtime/js/30_fs.js
+++ b/runtime/js/30_fs.js
@@ -315,7 +315,7 @@
mtime,
) {
core.opSync("op_utime_sync", {
- path,
+ path: pathFromURL(path),
atime: toUnixTimeFromEpoch(atime),
mtime: toUnixTimeFromEpoch(mtime),
});
@@ -327,7 +327,7 @@
mtime,
) {
await core.opAsync("op_utime_async", {
- path,
+ path: pathFromURL(path),
atime: toUnixTimeFromEpoch(atime),
mtime: toUnixTimeFromEpoch(mtime),
});
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 796d5178f..e1c474c28 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -29,6 +29,7 @@ delete Object.prototype.__proto__;
const webgpu = window.__bootstrap.webgpu;
const webSocket = window.__bootstrap.webSocket;
const webStorage = window.__bootstrap.webStorage;
+ const broadcastChannel = window.__bootstrap.broadcastChannel;
const file = window.__bootstrap.file;
const formData = window.__bootstrap.formData;
const fetch = window.__bootstrap.fetch;
@@ -282,6 +283,7 @@ delete Object.prototype.__proto__;
URL: util.nonEnumerable(url.URL),
URLSearchParams: util.nonEnumerable(url.URLSearchParams),
WebSocket: util.nonEnumerable(webSocket.WebSocket),
+ BroadcastChannel: util.nonEnumerable(broadcastChannel.BroadcastChannel),
Worker: util.nonEnumerable(worker.Worker),
WritableStream: util.nonEnumerable(streams.WritableStream),
WritableStreamDefaultWriter: util.nonEnumerable(