GitNexus/gitnexus/test/unit/scope-resolution/go
evolution 28df98c997
fix(go): use loose equality for Array.find() null checks (#1384)
* fix(go): use loose equality for Array.find() null checks (#1346, #1366)

Array.find() returns undefined (not null) when no match is found, but
the code checked with === null / !== null which fails to intercept it.
This caused "Cannot read properties of undefined (reading 'type')" and
"Cannot read properties of undefined (reading 'namedChildren')" crashes
on Go files containing plain for loops, make(chan T), or other patterns
where the expected tree-sitter node type is absent.

* refactor(go): use strict undefined checks for Array.find() results

Address review feedback: Array.find() returns undefined by spec, so
check with === undefined / !== undefined instead of loose == null.
2026-05-06 17:57:19 +01:00
..
go-captures-smoke.test.ts feat(go): implement scope resolution hooks for Go language support (#1302) 2026-05-04 07:29:11 +01:00
go-hooks.test.ts feat(go): implement scope resolution hooks for Go language support (#1302) 2026-05-04 07:29:11 +01:00
go-imports.test.ts feat(go): implement scope resolution hooks for Go language support (#1302) 2026-05-04 07:29:11 +01:00
go-package-siblings.test.ts feat(go): implement scope resolution hooks for Go language support (#1302) 2026-05-04 07:29:11 +01:00
go-range-binding-null-guard.test.ts fix(go): use loose equality for Array.find() null checks (#1384) 2026-05-06 17:57:19 +01:00
go-type-binding.test.ts fix(go): use loose equality for Array.find() null checks (#1384) 2026-05-06 17:57:19 +01:00