mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
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:
parent
284e6c3039
commit
2aed322dd5
49 changed files with 840 additions and 980 deletions
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue