From 3b5367459662b6a7084118aa18759e8b010da144 Mon Sep 17 00:00:00 2001 From: Gary Hsu Date: Tue, 29 Sep 2026 13:00:35 -0700 Subject: [PATCH 1/4] Rename AbortController CMake option compatibly Preserve the old spelling as a default for the new option and reject conflicting settings to avoid silently enabling a disabled polyfill. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CMakeLists.txt | 13 ++++++++++++- Polyfills/AbortController/Readme.md | 2 ++ Polyfills/CMakeLists.txt | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21882d3e..f82ce282 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,7 +95,18 @@ option(JSRUNTIMEHOST_POLYFILL_SCHEDULING "Include JsRuntimeHost Polyfill Schedul option(JSRUNTIMEHOST_POLYFILL_XMLHTTPREQUEST "Include JsRuntimeHost Polyfill XMLHttpRequest." ON) option(JSRUNTIMEHOST_POLYFILL_FETCH "Include JsRuntimeHost Polyfill fetch." ON) option(JSRUNTIMEHOST_POLYFILL_URL "Include JsRuntimeHost Polyfill URL and URLSearchParams." ON) -option(JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER "Include JsRuntimeHost Polyfills AbortController and AbortSignal." ON) +if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER) + set(_jsrh_abortcontroller_default "${JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER}") +else() + set(_jsrh_abortcontroller_default ON) +endif() +option(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "Include JsRuntimeHost Polyfills AbortController and AbortSignal." "${_jsrh_abortcontroller_default}") +unset(_jsrh_abortcontroller_default) +if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND + ((JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND NOT JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER) OR + (NOT JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER))) + message(FATAL_ERROR "JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER and JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER have conflicting values.") +endif() option(JSRUNTIMEHOST_POLYFILL_WEBSOCKET "Include JsRuntimeHost Polyfill WebSocket." ON) option(JSRUNTIMEHOST_POLYFILL_BLOB "Include JsRuntimeHost Polyfill Blob." ON) option(JSRUNTIMEHOST_POLYFILL_FILE "Include JsRuntimeHost Polyfill File and FileReader." ON) diff --git a/Polyfills/AbortController/Readme.md b/Polyfills/AbortController/Readme.md index f5b8b596..2ef414ec 100644 --- a/Polyfills/AbortController/Readme.md +++ b/Polyfills/AbortController/Readme.md @@ -1,6 +1,8 @@ # AbortController Implements parts of [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/) and [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). Provides a way to trigger the abort signal. *Work In Progress* +The `JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER` CMake option (ON by default) builds both polyfills. The previous spelling, `JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER`, is still accepted: `-DJSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER=OFF` disables the same target. If both names are set, they must agree; conflicting values fail configuration. When switching names in an existing build directory, remove the old cache entry or set both to the same value. + Supported on `AbortSignal`: * `aborted` (read-only) and `reason` * [`throwIfAborted()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted) diff --git a/Polyfills/CMakeLists.txt b/Polyfills/CMakeLists.txt index a44765fb..5ddba4e0 100644 --- a/Polyfills/CMakeLists.txt +++ b/Polyfills/CMakeLists.txt @@ -18,7 +18,7 @@ if(JSRUNTIMEHOST_POLYFILL_URL) add_subdirectory(URL) endif() -if(JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER) +if(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER) add_subdirectory(AbortController) endif() From 71a064aefd5256bbf6b9356675cf118a64cd3570 Mon Sep 17 00:00:00 2001 From: Gary Hsu Date: Tue, 29 Sep 2026 13:27:08 -0700 Subject: [PATCH 2/4] Make new AbortController option take precedence Translate the legacy setting only when the new option is absent. Explicit settings of the new option win without a conflict error. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CMakeLists.txt | 14 +++----------- Polyfills/AbortController/Readme.md | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f82ce282..fc170f71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,18 +95,10 @@ option(JSRUNTIMEHOST_POLYFILL_SCHEDULING "Include JsRuntimeHost Polyfill Schedul option(JSRUNTIMEHOST_POLYFILL_XMLHTTPREQUEST "Include JsRuntimeHost Polyfill XMLHttpRequest." ON) option(JSRUNTIMEHOST_POLYFILL_FETCH "Include JsRuntimeHost Polyfill fetch." ON) option(JSRUNTIMEHOST_POLYFILL_URL "Include JsRuntimeHost Polyfill URL and URLSearchParams." ON) -if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER) - set(_jsrh_abortcontroller_default "${JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER}") -else() - set(_jsrh_abortcontroller_default ON) -endif() -option(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "Include JsRuntimeHost Polyfills AbortController and AbortSignal." "${_jsrh_abortcontroller_default}") -unset(_jsrh_abortcontroller_default) -if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND - ((JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND NOT JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER) OR - (NOT JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER))) - message(FATAL_ERROR "JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER and JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER have conflicting values.") +if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND NOT DEFINED JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER) + set(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "${JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER}" CACHE BOOL "Include JsRuntimeHost Polyfills AbortController and AbortSignal.") endif() +option(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "Include JsRuntimeHost Polyfills AbortController and AbortSignal." ON) option(JSRUNTIMEHOST_POLYFILL_WEBSOCKET "Include JsRuntimeHost Polyfill WebSocket." ON) option(JSRUNTIMEHOST_POLYFILL_BLOB "Include JsRuntimeHost Polyfill Blob." ON) option(JSRUNTIMEHOST_POLYFILL_FILE "Include JsRuntimeHost Polyfill File and FileReader." ON) diff --git a/Polyfills/AbortController/Readme.md b/Polyfills/AbortController/Readme.md index 2ef414ec..3398f930 100644 --- a/Polyfills/AbortController/Readme.md +++ b/Polyfills/AbortController/Readme.md @@ -1,7 +1,7 @@ # AbortController Implements parts of [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/) and [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). Provides a way to trigger the abort signal. *Work In Progress* -The `JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER` CMake option (ON by default) builds both polyfills. The previous spelling, `JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER`, is still accepted: `-DJSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER=OFF` disables the same target. If both names are set, they must agree; conflicting values fail configuration. When switching names in an existing build directory, remove the old cache entry or set both to the same value. +The `JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER` CMake option (ON by default) builds both polyfills. The previous spelling, `JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER`, is still accepted: `-DJSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER=OFF` disables the same target. If both names are set, the new name takes precedence. When switching names in an existing build directory, set the new name explicitly or clear the cached new option before using the old one. Supported on `AbortSignal`: * `aborted` (read-only) and `reason` From a6dad7891a94f67996c73a5fb482ade268f4be0e Mon Sep 17 00:00:00 2001 From: Gary Hsu Date: Tue, 29 Sep 2026 13:30:40 -0700 Subject: [PATCH 3/4] Keep AbortController compatibility mapping below options Show only the new option in the option list and map the old variable onto it afterward. Drop the extra README migration text. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CMakeLists.txt | 8 +++++--- Polyfills/AbortController/Readme.md | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc170f71..1fd47e9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,9 +95,6 @@ option(JSRUNTIMEHOST_POLYFILL_SCHEDULING "Include JsRuntimeHost Polyfill Schedul option(JSRUNTIMEHOST_POLYFILL_XMLHTTPREQUEST "Include JsRuntimeHost Polyfill XMLHttpRequest." ON) option(JSRUNTIMEHOST_POLYFILL_FETCH "Include JsRuntimeHost Polyfill fetch." ON) option(JSRUNTIMEHOST_POLYFILL_URL "Include JsRuntimeHost Polyfill URL and URLSearchParams." ON) -if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER AND NOT DEFINED JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER) - set(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "${JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER}" CACHE BOOL "Include JsRuntimeHost Polyfills AbortController and AbortSignal.") -endif() option(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "Include JsRuntimeHost Polyfills AbortController and AbortSignal." ON) option(JSRUNTIMEHOST_POLYFILL_WEBSOCKET "Include JsRuntimeHost Polyfill WebSocket." ON) option(JSRUNTIMEHOST_POLYFILL_BLOB "Include JsRuntimeHost Polyfill Blob." ON) @@ -106,6 +103,11 @@ option(JSRUNTIMEHOST_POLYFILL_PERFORMANCE "Include JsRuntimeHost Polyfill Perfor option(JSRUNTIMEHOST_POLYFILL_TEXTDECODER "Include JsRuntimeHost Polyfill TextDecoder." ON) option(JSRUNTIMEHOST_POLYFILL_TEXTENCODER "Include JsRuntimeHost Polyfill TextEncoder." ON) +# Compatibility with the previous AbortController option. +if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER) + set(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "${JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER}" CACHE BOOL "Include JsRuntimeHost Polyfills AbortController and AbortSignal." FORCE) +endif() + # Sanitizers option(ENABLE_SANITIZERS "Enable AddressSanitizer and UBSan" OFF) option(ENABLE_THREAD_SANITIZER "Enable ThreadSanitizer" OFF) diff --git a/Polyfills/AbortController/Readme.md b/Polyfills/AbortController/Readme.md index 3398f930..f5b8b596 100644 --- a/Polyfills/AbortController/Readme.md +++ b/Polyfills/AbortController/Readme.md @@ -1,8 +1,6 @@ # AbortController Implements parts of [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/) and [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). Provides a way to trigger the abort signal. *Work In Progress* -The `JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER` CMake option (ON by default) builds both polyfills. The previous spelling, `JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER`, is still accepted: `-DJSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER=OFF` disables the same target. If both names are set, the new name takes precedence. When switching names in an existing build directory, set the new name explicitly or clear the cached new option before using the old one. - Supported on `AbortSignal`: * `aborted` (read-only) and `reason` * [`throwIfAborted()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted) From 5035f3c4980f2548a6157b72eb61aa5639d1363e Mon Sep 17 00:00:00 2001 From: Gary Hsu Date: Tue, 29 Sep 2026 14:41:37 -0700 Subject: [PATCH 4/4] Use a plain variable for legacy AbortController setting Keep the new CMake option in the option list and apply the old spelling only to the effective value. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fd47e9f..a195c1eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,7 @@ option(JSRUNTIMEHOST_POLYFILL_TEXTENCODER "Include JsRuntimeHost Polyfill TextEn # Compatibility with the previous AbortController option. if(DEFINED JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER) - set(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "${JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER}" CACHE BOOL "Include JsRuntimeHost Polyfills AbortController and AbortSignal." FORCE) + set(JSRUNTIMEHOST_POLYFILL_ABORTCONTROLLER "${JSRUNTIMEHOST_POLYFILL_ABORT_CONTROLLER}") endif() # Sanitizers