From 84db80642a134cf0bd17accbc5c12f37e09e632e Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Sun, 10 Mar 2024 11:23:14 +0900 Subject: [PATCH] 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. --- ext/canvas/01_image.js | 2 +- ext/fetch/23_request.js | 2 +- ext/fetch/23_response.js | 4 ++-- ext/fetch/26_fetch.js | 4 ++-- ext/url/00_url.js | 2 +- ext/web/02_event.js | 2 +- ext/web/03_abort_signal.js | 4 ++-- ext/web/06_streams.js | 32 ++++++++++++++++---------------- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ext/canvas/01_image.js b/ext/canvas/01_image.js index 844650dcb0..a738f7992c 100644 --- a/ext/canvas/01_image.js +++ b/ext/canvas/01_image.js @@ -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) { diff --git a/ext/fetch/23_request.js b/ext/fetch/23_request.js index 542bcb8bb2..61c3b3f5d5 100644 --- a/ext/fetch/23_request.js +++ b/ext/fetch/23_request.js @@ -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."); diff --git a/ext/fetch/23_response.js b/ext/fetch/23_response.js index fcf544d406..a3805a97db 100644 --- a/ext/fetch/23_response.js +++ b/ext/fetch/23_response.js @@ -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"); diff --git a/ext/fetch/26_fetch.js b/ext/fetch/26_fetch.js index 9f90156c56..c4669e430b 100644 --- a/ext/fetch/26_fetch.js +++ b/ext/fetch/26_fetch.js @@ -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", ); diff --git a/ext/url/00_url.js b/ext/url/00_url.js index 6559432e5e..3b081218bb 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -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) { diff --git a/ext/web/02_event.js b/ext/web/02_event.js index 026e46374e..8f1c963e3d 100644 --- a/ext/web/02_event.js +++ b/ext/web/02_event.js @@ -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); } diff --git a/ext/web/03_abort_signal.js b/ext/web/03_abort_signal.js index 2bca29529a..e64a34db74 100644 --- a/ext/web/03_abort_signal.js +++ b/ext/web/03_abort_signal.js @@ -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, diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index fa9e4b59ea..e531844535 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -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"], - "Failed to call 'pullAlgorithm' on 'ReadableByteStreamController'", + "Failed to execute 'pullAlgorithm' on 'ReadableByteStreamController'", true, ); } @@ -3572,7 +3572,7 @@ function setUpReadableByteStreamControllerFromUnderlyingSource( [reason], underlyingSource, webidl.converters["Promise"], - "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"], - "Failed to call 'pullAlgorithm' on 'ReadableStreamDefaultController'", + "Failed to execute 'pullAlgorithm' on 'ReadableStreamDefaultController'", true, ); } @@ -3685,7 +3685,7 @@ function setUpReadableStreamDefaultControllerFromUnderlyingSource( [reason], underlyingSource, webidl.converters["Promise"], - "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"], - "Failed to call 'transformAlgorithm' on 'TransformStreamDefaultController'", + "Failed to execute 'transformAlgorithm' on 'TransformStreamDefaultController'", true, ); } @@ -3802,7 +3802,7 @@ function setUpTransformStreamDefaultControllerFromTransformer( [controller], transformer, webidl.converters["Promise"], - "Failed to call 'flushAlgorithm' on 'TransformStreamDefaultController'", + "Failed to execute 'flushAlgorithm' on 'TransformStreamDefaultController'", true, ); } @@ -3813,7 +3813,7 @@ function setUpTransformStreamDefaultControllerFromTransformer( [reason], transformer, webidl.converters["Promise"], - "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"], - "Failed to call 'writeAlgorithm' on 'WritableStreamDefaultController'", + "Failed to execute 'writeAlgorithm' on 'WritableStreamDefaultController'", true, ); } @@ -3928,7 +3928,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink( [], underlyingSink, webidl.converters["Promise"], - "Failed to call 'closeAlgorithm' on 'WritableStreamDefaultController'", + "Failed to execute 'closeAlgorithm' on 'WritableStreamDefaultController'", true, ); } @@ -3939,7 +3939,7 @@ function setUpWritableStreamDefaultControllerFromUnderlyingSink( [reason], underlyingSink, webidl.converters["Promise"], - "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 {