From 69b625cdcd238297754706820e90baaf6b844bc3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 5 Jul 2026 14:21:19 +0000 Subject: [PATCH 1/2] fix(@stdlib/string/base/atob): guard against missing global `atob` The job `linux_test (Node.js v12)` and `linux_test (Node.js v14)` on workflow `linux_test` failed on develop with `ReferenceError: atob is not defined` at `lib/global.js:23`. Root cause: the module bare- referenced the global `atob` at load time, which throws on any Node.js version lacking that global (added in Node.js 16). Since `lib/index.js` requires `./main.js` (and transitively `./global.js`) unconditionally before its `hasAtobSupport()` feature-detection runs, this crashed on `require()` in production on Node.js <16, not just in tests. This commit guards the reference with `typeof atob === 'function'`, which does not throw on an undeclared identifier, matching the existing pattern in `@stdlib/assert/has-atob-support/lib/atob.js`. The module now safely resolves to `null` on unsupported platforms, letting the try/catch in `main.js` and the `hasAtobSupport()` check in `index.js` work as intended. Ref: https://github.com/stdlib-js/stdlib/actions/runs/28736797063 --- 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 da9b8d5f8a5a7e999b56a9cbc64b80326affa80f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 5 Jul 2026 14:25:40 +0000 Subject: [PATCH 2/2] fix(@stdlib/string/base/atob): silence node-builtins lint rule for guarded `atob` reference CI check `Lint Changed Files` failed on this PR with two `n/no-unsupported-features/node-builtins` errors on the `typeof atob` guard added in the previous commit: the repo's configured Node.js version floor (>=0.12.18) predates the `atob` global (added in Node.js 16), and eslint-plugin-n flags the reference regardless of the `typeof` guard protecting it at runtime. This adds the same `eslint-disable-line` used for identical version-gated feature-detection elsewhere in the codebase, e.g. `@stdlib/os/homedir/lib/index.js` and `@stdlib/process/geteuid/lib/native.js`. Ref: https://github.com/stdlib-js/stdlib/actions/runs/28743835208 --- 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 //