1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -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, sh = undefined,
options = undefined, options = undefined,
) { ) {
const prefix = "Failed to call 'createImageBitmap'"; const prefix = "Failed to execute 'createImageBitmap'";
// Overload: createImageBitmap(image [, options ]) // Overload: createImageBitmap(image [, options ])
if (arguments.length < 3) { if (arguments.length < 3) {

View file

@ -466,7 +466,7 @@ class Request {
} }
clone() { clone() {
const prefix = "Failed to call 'Request.clone'"; const prefix = "Failed to execute 'Request.clone'";
webidl.assertBranded(this, RequestPrototype); webidl.assertBranded(this, RequestPrototype);
if (this[_body] && this[_body].unusable()) { if (this[_body] && this[_body].unusable()) {
throw new TypeError("Body is unusable."); throw new TypeError("Body is unusable.");

View file

@ -256,7 +256,7 @@ class Response {
* @returns {Response} * @returns {Response}
*/ */
static redirect(url, status = 302) { 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"); url = webidl.converters["USVString"](url, prefix, "Argument 1");
status = webidl.converters["unsigned short"](status, prefix, "Argument 2"); status = webidl.converters["unsigned short"](status, prefix, "Argument 2");
@ -283,7 +283,7 @@ class Response {
* @returns {Response} * @returns {Response}
*/ */
static json(data = undefined, init = {}) { static json(data = undefined, init = {}) {
const prefix = "Failed to call 'Response.json'"; const prefix = "Failed to execute 'Response.json'";
data = webidl.converters.any(data); data = webidl.converters.any(data);
init = webidl.converters["ResponseInit_fast"](init, prefix, "Argument 2"); init = webidl.converters["ResponseInit_fast"](init, prefix, "Argument 2");

View file

@ -313,7 +313,7 @@ function fetch(input, init = {}) {
let opPromise = undefined; let opPromise = undefined;
// 1. // 1.
const result = new Promise((resolve, reject) => { const result = new Promise((resolve, reject) => {
const prefix = "Failed to call 'fetch'"; const prefix = "Failed to execute 'fetch'";
webidl.requiredArguments(arguments.length, 1, prefix); webidl.requiredArguments(arguments.length, 1, prefix);
// 2. // 2.
const requestObject = new Request(input, init); const requestObject = new Request(input, init);
@ -425,7 +425,7 @@ function handleWasmStreaming(source, rid) {
try { try {
const res = webidl.converters["Response"]( const res = webidl.converters["Response"](
source, source,
"Failed to call 'WebAssembly.compileStreaming'", "Failed to execute 'WebAssembly.compileStreaming'",
"Argument 1", "Argument 1",
); );

View file

@ -395,7 +395,7 @@ class URL {
* @param {string} [base] * @param {string} [base]
*/ */
static canParse(url, base = undefined) { 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); webidl.requiredArguments(arguments.length, 1, prefix);
url = webidl.converters.DOMString(url, prefix, "Argument 1"); url = webidl.converters.DOMString(url, prefix, "Argument 1");
if (base !== undefined) { if (base !== undefined) {

View file

@ -1507,7 +1507,7 @@ function checkThis(thisArg) {
// https://html.spec.whatwg.org/#dom-reporterror // https://html.spec.whatwg.org/#dom-reporterror
function reportError(error) { function reportError(error) {
checkThis(this); checkThis(this);
const prefix = "Failed to call 'reportError'"; const prefix = "Failed to execute 'reportError'";
webidl.requiredArguments(arguments.length, 1, prefix); webidl.requiredArguments(arguments.length, 1, prefix);
reportException(error); reportException(error);
} }

View file

@ -83,7 +83,7 @@ const illegalConstructorKey = Symbol("illegalConstructorKey");
class AbortSignal extends EventTarget { class AbortSignal extends EventTarget {
static any(signals) { static any(signals) {
const prefix = "Failed to call 'AbortSignal.any'"; const prefix = "Failed to execute 'AbortSignal.any'";
webidl.requiredArguments(arguments.length, 1, prefix); webidl.requiredArguments(arguments.length, 1, prefix);
return createDependentAbortSignal(signals, prefix); return createDependentAbortSignal(signals, prefix);
} }
@ -98,7 +98,7 @@ class AbortSignal extends EventTarget {
} }
static timeout(millis) { static timeout(millis) {
const prefix = "Failed to call 'AbortSignal.timeout'"; const prefix = "Failed to execute 'AbortSignal.timeout'";
webidl.requiredArguments(arguments.length, 1, prefix); webidl.requiredArguments(arguments.length, 1, prefix);
millis = webidl.converters["unsigned long long"]( millis = webidl.converters["unsigned long long"](
millis, millis,

View file

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