Skip to content

Commit

Permalink
chore: replace 'call' to 'execute' in error messages (#22579)
Browse files Browse the repository at this point in the history
Since both "call" and "execute" were used in error messages, I replaced them with "execute," which is more used.
  • Loading branch information
petamoriken committed Mar 10, 2024
1 parent f8543a9 commit 84db806
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion ext/canvas/01_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 163,7 @@ function createImageBitmap(
sh = undefined,
options = undefined,
) {
const prefix = "Failed to call 'createImageBitmap'";
const prefix = "Failed to execute 'createImageBitmap'";

// Overload: createImageBitmap(image [, options ])
if (arguments.length < 3) {
Expand Down
2 changes: 1 addition & 1 deletion ext/fetch/23_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 466,7 @@ class Request {
}

clone() {
const prefix = "Failed to call 'Request.clone'";
const prefix = "Failed to execute 'Request.clone'";
webidl.assertBranded(this, RequestPrototype);
if (this[_body] && this[_body].unusable()) {
throw new TypeError("Body is unusable.");
Expand Down
4 changes: 2 additions & 2 deletions ext/fetch/23_response.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 256,7 @@ class Response {
* @returns {Response}
*/
static redirect(url, status = 302) {
const prefix = "Failed to call 'Response.redirect'";
const prefix = "Failed to execute 'Response.redirect'";
url = webidl.converters["USVString"](url, prefix, "Argument 1");
status = webidl.converters["unsigned short"](status, prefix, "Argument 2");

Expand All @@ -283,7 283,7 @@ class Response {
* @returns {Response}
*/
static json(data = undefined, init = {}) {
const prefix = "Failed to call 'Response.json'";
const prefix = "Failed to execute 'Response.json'";
data = webidl.converters.any(data);
init = webidl.converters["ResponseInit_fast"](init, prefix, "Argument 2");

Expand Down
4 changes: 2 additions & 2 deletions ext/fetch/26_fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 313,7 @@ function fetch(input, init = {}) {
let opPromise = undefined;
// 1.
const result = new Promise((resolve, reject) => {
const prefix = "Failed to call 'fetch'";
const prefix = "Failed to execute 'fetch'";
webidl.requiredArguments(arguments.length, 1, prefix);
// 2.
const requestObject = new Request(input, init);
Expand Down Expand Up @@ -425,7 425,7 @@ function handleWasmStreaming(source, rid) {
try {
const res = webidl.converters["Response"](
source,
"Failed to call 'WebAssembly.compileStreaming'",
"Failed to execute 'WebAssembly.compileStreaming'",
"Argument 1",
);

Expand Down
2 changes: 1 addition & 1 deletion ext/url/00_url.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 395,7 @@ class URL {
* @param {string} [base]
*/
static canParse(url, base = undefined) {
const prefix = "Failed to call 'URL.canParse'";
const prefix = "Failed to execute 'URL.canParse'";
webidl.requiredArguments(arguments.length, 1, prefix);
url = webidl.converters.DOMString(url, prefix, "Argument 1");
if (base !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion ext/web/02_event.js
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 1507,7 @@ function checkThis(thisArg) {
// https://html.spec.whatwg.org/#dom-reporterror
function reportError(error) {
checkThis(this);
const prefix = "Failed to call 'reportError'";
const prefix = "Failed to execute 'reportError'";
webidl.requiredArguments(arguments.length, 1, prefix);
reportException(error);
}
Expand Down
4 changes: 2 additions & 2 deletions ext/web/03_abort_signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 83,7 @@ const illegalConstructorKey = Symbol("illegalConstructorKey");

class AbortSignal extends EventTarget {
static any(signals) {
const prefix = "Failed to call 'AbortSignal.any'";
const prefix = "Failed to execute 'AbortSignal.any'";
webidl.requiredArguments(arguments.length, 1, prefix);
return createDependentAbortSignal(signals, prefix);
}
Expand All @@ -98,7 98,7 @@ class AbortSignal extends EventTarget {
}

static timeout(millis) {
const prefix = "Failed to call 'AbortSignal.timeout'";
const prefix = "Failed to execute 'AbortSignal.timeout'";
webidl.requiredArguments(arguments.length, 1, prefix);
millis = webidl.converters["unsigned long long"](
millis,
Expand Down
32 changes: 16 additions & 16 deletions ext/web/06_streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 573,7 @@ function extractSizeAlgorithm(strategy) {
[chunk],
undefined,
webidl.converters["unrestricted double"],
"Failed to call `sizeAlgorithm`",
"Failed to execute `sizeAlgorithm`",
);
}

Expand Down Expand Up @@ -3551,7 3551,7 @@ function setUpReadableByteStreamControllerFromUnderlyingSource(
[controller],
underlyingSource,
webidl.converters.any,
"Failed to call 'startAlgorithm' on 'ReadableByteStreamController'",
"Failed to execute 'startAlgorithm' on 'ReadableByteStreamController'",
);
}
if (underlyingSourceDict.pull !== undefined) {
Expand All @@ -3561,7 3561,7 @@ function setUpReadableByteStreamControllerFromUnderlyingSource(
[controller],
underlyingSource,
webidl.converters["Promise<undefined>"],
"Failed to call 'pullAlgorithm' on 'ReadableByteStreamController'",
"Failed to execute 'pullAlgorithm' on 'ReadableByteStreamController'",
true,
);
}
Expand All @@ -3572,7 3572,7 @@ function setUpReadableByteStreamControllerFromUnderlyingSource(
[reason],
underlyingSource,
webidl.converters["Promise<undefined>"],
"Failed to call 'cancelAlgorithm' on 'ReadableByteStreamController'",
"Failed to execute 'cancelAlgorithm' on 'ReadableByteStreamController'",
true,
);
}
Expand Down Expand Up @@ -3664,7 3664,7 @@ function setUpReadableStreamDefaultControllerFromUnderlyingSource(
[controller],
underlyingSource,
webidl.converters.any,
"Failed to call 'startAlgorithm' on 'ReadableStreamDefaultController'",
"Failed to execute 'startAlgorithm' on 'ReadableStreamDefaultController'",
);
}
if (underlyingSourceDict.pull !== undefined) {
Expand All @@ -3674,7 3674,7 @@ function setUpReadableStreamDefaultControllerFromUnderlyingSource(
[controller],
underlyingSource,
webidl.converters["Promise<undefined>"],
"Failed to call 'pullAlgorithm' on 'ReadableStreamDefaultController'",
"Failed to execute 'pullAlgorithm' on 'ReadableStreamDefaultController'",
true,
);
}
Expand All @@ -3685,7 3685,7 @@ function setUpReadableStreamDefaultControllerFromUnderlyingSource(
[reason],
underlyingSource,
webidl.converters["Promise<undefined>"],
"Failed to call 'cancelAlgorithm' on 'ReadableStreamDefaultController'",
"Failed to execute 'cancelAlgorithm' on 'ReadableStreamDefaultController'",
true,
);
}
Expand Down Expand Up @@ -3791,7 3791,7 @@ function setUpTransformStreamDefaultControllerFromTransformer(
[chunk, controller],
transformer,
webidl.converters["Promise<undefined>"],
"Failed to call 'transformAlgorithm' on 'TransformStreamDefaultController'",
"Failed to execute 'transformAlgorithm' on 'TransformStreamDefaultController'",
true,
);
}
Expand All @@ -3802,7 3802,7 @@ function setUpTransformStreamDefaultControllerFromTransformer(
[controller],
transformer,
webidl.converters["Promise<undefined>"],
"Failed to call 'flushAlgorithm' on 'TransformStreamDefaultController'",
"Failed to execute 'flushAlgorithm' on 'TransformStreamDefaultController'",
true,
);
}
Expand All @@ -3813,7 3813,7 @@ function setUpTransformStreamDefaultControllerFromTransformer(
[reason],
transformer,
webidl.converters["Promise<undefined>"],
"Failed to call 'cancelAlgorithm' on 'TransformStreamDefaultController'",
"Failed to execute 'cancelAlgorithm' on 'TransformStreamDefaultController'",
true,
);
}
Expand Down Expand Up @@ -3907,7 3907,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink(
[controller],
underlyingSink,
webidl.converters.any,
"Failed to call 'startAlgorithm' on 'WritableStreamDefaultController'",
"Failed to execute 'startAlgorithm' on 'WritableStreamDefaultController'",
);
}
if (underlyingSinkDict.write !== undefined) {
Expand All @@ -3917,7 3917,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink(
[chunk, controller],
underlyingSink,
webidl.converters["Promise<undefined>"],
"Failed to call 'writeAlgorithm' on 'WritableStreamDefaultController'",
"Failed to execute 'writeAlgorithm' on 'WritableStreamDefaultController'",
true,
);
}
Expand All @@ -3928,7 3928,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink(
[],
underlyingSink,
webidl.converters["Promise<undefined>"],
"Failed to call 'closeAlgorithm' on 'WritableStreamDefaultController'",
"Failed to execute 'closeAlgorithm' on 'WritableStreamDefaultController'",
true,
);
}
Expand All @@ -3939,7 3939,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink(
[reason],
underlyingSink,
webidl.converters["Promise<undefined>"],
"Failed to call 'abortAlgorithm' on 'WritableStreamDefaultController'",
"Failed to execute 'abortAlgorithm' on 'WritableStreamDefaultController'",
true,
);
}
Expand Down Expand Up @@ -5196,7 5196,7 @@ class ReadableStream {
webidl.requiredArguments(
arguments.length,
1,
"Failed to call 'ReadableStream.from'",
"Failed to execute 'ReadableStream.from'",
);
asyncIterable = webidl.converters.any(asyncIterable);

Expand Down Expand Up @@ -6209,7 6209,7 @@ class TransformStream {
[this[_controller]],
transformer,
webidl.converters.any,
"Failed to call 'start' on 'TransformStreamDefaultController'",
"Failed to execute 'start' on 'TransformStreamDefaultController'",
),
);
} else {
Expand Down

0 comments on commit 84db806

Please sign in to comment.