Skip to content

Commit 1c86fca

Browse files
committed
fix: shadow global Symbol in symbol/async-iterator
The JavaScript linting CI job failed on develop: lib/node_modules/@stdlib/symbol/async-iterator/lib/main.js 42:65 error The 'Symbol.asyncIterator' is still an experimental feature and is not supported until Node.js 10.0.0. The configured version range is '>=0.12.18' n/no-unsupported-features/es-builtins Root cause: main.js referenced the global Symbol directly. The n/no-unsupported-features/es-builtins ESLint rule flags Symbol.asyncIterator as requiring Node >= 10.0.0, which exceeds the project configured minimum of >=0.12.18. Shadowing the global with var Symbol = require( '@stdlib/symbol/ctor' ) removes the global reference and resolves the violation. The local binding resolves to the native Symbol in environments where it exists, preserving runtime behavior identically. The sibling package symbol/to-primitive uses the same pattern for Symbol.toPrimitive, which is also flagged by the same rule. Failing run: https://github.com/stdlib-js/stdlib/actions/runs/25195861572 https://claude.ai/code/session_01KcDPB7otMv5FFbBc5N12mu
1 parent 8238153 commit 1c86fca

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • lib/node_modules/@stdlib/symbol/async-iterator/lib

lib/node_modules/@stdlib/symbol/async-iterator/lib/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// MODULES //
2222

2323
var hasAsyncIteratorSymbolSupport = require( '@stdlib/assert/has-async-iterator-symbol-support' ); // eslint-disable-line id-length
24+
var Symbol = require( '@stdlib/symbol/ctor' );
2425

2526

2627
// MAIN //

0 commit comments

Comments
 (0)