1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

chore: replace 'call' to 'execute' in error messages (#22579)

Since both "call" and "execute" were used in error messages, I replaced them with "execute," which is more used.
This commit is contained in:
Kenta Moriuchi 2024-03-10 11:23:14 +09:00 committed by GitHub
parent f8543a9fd8
commit 84db80642a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 26 additions and 26 deletions

View file

@ -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) {

View file

@ -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.");

View file

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

View file

@ -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);
@ -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",
);

View file

@ -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) {

View file

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

View file

@ -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);
}
@ -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,

View file

@ -573,7 +573,7 @@ function extractSizeAlgorithm(strategy) {
[chunk],
undefined,
webidl.converters["unrestricted double"],
"Failed to call `sizeAlgorithm`",
"Failed to execute `sizeAlgorithm`",
);
}
@ -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) {
@ -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,
);
}
@ -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,
);
}
@ -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) {
@ -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,
);
}
@ -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,
);
}
@ -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,
);
}
@ -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,
);
}
@ -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,
);
}
@ -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) {
@ -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,
);
}
@ -3928,7 +3928,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink(
[],
underlyingSink,
webidl.converters["Promise<undefined>"],
"Failed to call 'closeAlgorithm' on 'WritableStreamDefaultController'",
"Failed to execute 'closeAlgorithm' on 'WritableStreamDefaultController'",
true,
);
}
@ -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,
);
}
@ -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);
@ -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 {