refactor: convert ops to use serde_v8 (#10009)

This commit rewrites most of the ops to use "serde_v8" instead
of "json" serialization.
This commit is contained in:
Aaron O'Mullan 2021-04-05 18:40:24 +02:00 committed by GitHub
parent 284e6c3039
commit 2aed322dd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 840 additions and 980 deletions

View file

@ -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,
);
}
}