summaryrefslogtreecommitdiff
path: root/runtime/js/11_workers.js
diff options
context:
space:
mode:
authorAaron O'Mullan <aaron.omullan@gmail.com>2021-04-05 18:40:24 +0200
committerGitHub <noreply@github.com>2021-04-05 18:40:24 +0200
commit2aed322dd507a8568b6ee6f4897e9a8e3220f763 (patch)
treee9a45c0b7688a9881ea9ce132b92554ef2955ad6 /runtime/js/11_workers.js
parent284e6c303956e8ca20af63b4ecc045438a260fe6 (diff)
refactor: convert ops to use serde_v8 (#10009)
This commit rewrites most of the ops to use "serde_v8" instead of "json" serialization.
Diffstat (limited to 'runtime/js/11_workers.js')
-rw-r--r--runtime/js/11_workers.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/js/11_workers.js b/runtime/js/11_workers.js
index 2917ec004..b11195713 100644
--- a/runtime/js/11_workers.js
+++ b/runtime/js/11_workers.js
@@ -28,15 +28,15 @@
}
function hostTerminateWorker(id) {
- core.jsonOpSync("op_host_terminate_worker", { id });
+ core.jsonOpSync("op_host_terminate_worker", id);
}
function hostPostMessage(id, data) {
- core.jsonOpSync("op_host_post_message", { id }, data);
+ core.jsonOpSync("op_host_post_message", id, data);
}
function hostGetMessage(id) {
- return core.jsonOpAsync("op_host_get_message", { id });
+ return core.jsonOpAsync("op_host_get_message", id);
}
const encoder = new TextEncoder();
@@ -197,7 +197,7 @@
}
}
- const { id } = createWorker(
+ const id = createWorker(
specifier,
hasSourceCode,
sourceCode,
@@ -270,7 +270,7 @@
} else {
core.jsonOpSync(
"op_host_unhandled_error",
- { message: event.error.message },
+ event.error.message,
);
}
}
@@ -289,7 +289,7 @@
} else {
core.jsonOpSync(
"op_host_unhandled_error",
- { message: event.error.message },
+ event.error.message,
);
}
}