refactor(webidl): move prefix & context out of converters options bag (#18931)

This commit is contained in:
Leo Kettmeir 2023-05-01 12:47:13 +02:00 committed by GitHub
parent d856bfd336
commit b31cf9fde6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 1042 additions and 964 deletions

View file

@ -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;