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

@ -94,14 +94,16 @@ class DOMException {
// https://webidl.spec.whatwg.org/#dom-domexception-domexception
constructor(message = "", name = "Error") {
message = webidl.converters.DOMString(message, {
prefix: "Failed to construct 'DOMException'",
context: "Argument 1",
});
name = webidl.converters.DOMString(name, {
prefix: "Failed to construct 'DOMException'",
context: "Argument 2",
});
message = webidl.converters.DOMString(
message,
"Failed to construct 'DOMException'",
"Argument 1",
);
name = webidl.converters.DOMString(
name,
"Failed to construct 'DOMException'",
"Argument 2",
);
const code = nameToCodeMapping[name] ?? 0;
this[_message] = message;