From 8a3c22a68d754783446501bd73d7e120e702e2bf Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 14:24:34 +0000 Subject: [PATCH 1/2] fix(@stdlib/string/base/atob): guard global `atob` reference for Node <16 The job `linux_test` (Node.js v12, v14) has failed on develop every scheduled run for the past month with: ReferenceError: atob is not defined at .../lib/node_modules/@stdlib/string/base/atob/lib/global.js:23 Root cause: `lib/global.js` exported a bare reference to the global `atob` identifier. Under `'use strict'`, referencing an undeclared identifier throws a `ReferenceError` at evaluation time, and Node.js only added `atob`/`btoa` as globals in v16.0.0. Because `lib/index.js` unconditionally requires `./main.js` (which requires `./global.js`) before ever checking `hasAtobSupport()`, simply requiring `@stdlib/string/base/atob` crashed on any Node <16, defeating the package's own polyfill fallback. The same unconditional require in `test/test.main.js` crashed at require-time regardless of that test file's `skip: !hasAtobSupport()` option, since `skip` only gates the tape assertions, not the top-level `require`. This commit guards the reference with `typeof atob === 'function'`, mirroring the identical pattern already used by this package's own dependency, `@stdlib/assert/has-atob-support/lib/atob.js`. `typeof` on an undeclared identifier evaluates to `'undefined'` rather than throwing, so the module now loads safely on Node <16 and correctly falls back to the polyfill, while behavior on Node >=16 (where the native `atob` is resolved) is unchanged. Ref: https://github.com/stdlib-js/stdlib/actions/runs/29241732795 --- 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..5021368bd031 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 : void 0; // eslint-disable-line stdlib/no-redeclare + + // EXPORTS // -module.exports = atob; +module.exports = main; From 1f3dcc6ef77ab2399c98e6f928b0cccd5d6dc175 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 14:30:41 +0000 Subject: [PATCH 2/2] style(@stdlib/string/base/atob): fix eslint-disable directive in `global.js` CI's `Lint Changed Files` check failed on this branch: the previous commit's `// eslint-disable-line stdlib/no-redeclare` was an unused directive (that rule never fires on this line, since `main` is declared, not `atob`), and the actual violation reported was `n/no-unsupported-features/node-builtins`, since `atob` is flagged as unsupported for the package's configured engines range (>=0.10.0). This commit points the disable comment at the correct rule and switches the fallback value from `void 0` to `null` to fully match the precedent in `@stdlib/assert/has-atob-support/lib/atob.js`. Behavior is unchanged; re-verified manually with and without a global `atob` present. --- 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 5021368bd031..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 : void 0; // eslint-disable-line stdlib/no-redeclare +var main = ( typeof atob === 'function' ) ? atob : null; // eslint-disable-line n/no-unsupported-features/node-builtins // EXPORTS //