From 94907886814be6c981ee939d6cdf6cb7c147ca74 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 14:15:34 +0000 Subject: [PATCH 1/2] fix: guard `atob` global reference in `@stdlib/string/base/atob` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `global.js` exported the bare `atob` identifier at module evaluation time (`module.exports = atob`). On Node.js v12 and v14, `atob` is not a global — it was added in Node.js v16.0.0 — so loading the module threw `ReferenceError: atob is not defined`. Because `index.js` eagerly requires `./main.js` before calling `hasAtobSupport()`, the polyfill branch was structurally unreachable: the process crashed during the require phase. Replace the bare reference with a typeof guard: var main = ( typeof atob === 'function' ) ? atob : null; This mirrors the pattern already used in `@stdlib/assert/has-atob-support/lib/atob.js`. On Node.js v12/v14, `global.js` now exports `null`; `main.js`'s existing try/catch absorbs the null-call TypeError and returns null. On v16+, the native `atob` is exported unchanged, restoring prior behavior. Ref: https://github.com/stdlib-js/stdlib/actions/runs/27901198731 --- lib/node_modules/@stdlib/string/base/atob/lib/global.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/string/base/atob/lib/global.js b/lib/node_modules/@stdlib/string/base/atob/lib/global.js index 2d8f761f1dc2..491962d727f2 100644 --- a/lib/node_modules/@stdlib/string/base/atob/lib/global.js +++ b/lib/node_modules/@stdlib/string/base/atob/lib/global.js @@ -18,6 +18,11 @@ 'use strict'; +// MAIN // + +var main = ( typeof atob === 'function' ) ? atob : null; + + // EXPORTS // -module.exports = atob; +module.exports = main; From faf2b18a9a41927083ade7afb408c5332abd964c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 21 Jun 2026 14:20:48 +0000 Subject: [PATCH 2/2] fix: suppress n/no-unsupported-features/node-builtins lint error in `@stdlib/string/base/atob` The `atob` global is intentionally referenced inside a `typeof` guard to detect its availability. The eslint rule `n/no-unsupported-features/node-builtins` does not understand that this is a feature-detection pattern rather than an unsupported usage, so suppress it inline. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_0116goNvkDr7ZQ7w5vpvseiw --- lib/node_modules/@stdlib/string/base/atob/lib/global.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/string/base/atob/lib/global.js b/lib/node_modules/@stdlib/string/base/atob/lib/global.js index 491962d727f2..410b2879eccc 100644 --- a/lib/node_modules/@stdlib/string/base/atob/lib/global.js +++ b/lib/node_modules/@stdlib/string/base/atob/lib/global.js @@ -20,7 +20,7 @@ // MAIN // -var main = ( typeof atob === 'function' ) ? atob : null; +var main = ( typeof atob === 'function' ) ? atob : null; // eslint-disable-line n/no-unsupported-features/node-builtins // EXPORTS //