mirror of
https://github.com/denoland/deno.git
synced 2025-08-31 07:47:46 +00:00
refactor(webidl): move prefix & context out of converters options bag (#18931)
This commit is contained in:
parent
d856bfd336
commit
b31cf9fde6
31 changed files with 1042 additions and 964 deletions
|
@ -101,7 +101,7 @@ function workerClose() {
|
|||
function postMessage(message, transferOrOptions = {}) {
|
||||
const prefix =
|
||||
"Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope'";
|
||||
webidl.requiredArguments(arguments.length, 1, { prefix });
|
||||
webidl.requiredArguments(arguments.length, 1, prefix);
|
||||
message = webidl.converters.any(message);
|
||||
let options;
|
||||
if (
|
||||
|
@ -111,16 +111,15 @@ function postMessage(message, transferOrOptions = {}) {
|
|||
) {
|
||||
const transfer = webidl.converters["sequence<object>"](
|
||||
transferOrOptions,
|
||||
{ prefix, context: "Argument 2" },
|
||||
prefix,
|
||||
"Argument 2",
|
||||
);
|
||||
options = { transfer };
|
||||
} else {
|
||||
options = webidl.converters.StructuredSerializeOptions(
|
||||
transferOrOptions,
|
||||
{
|
||||
prefix,
|
||||
context: "Argument 2",
|
||||
},
|
||||
prefix,
|
||||
"Argument 2",
|
||||
);
|
||||
}
|
||||
const { transfer } = options;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue