SIGN IN SIGN UP

Drop isBunEmbeddedPath shortcut — emscripten can't read those paths anyway

Round 9 logs showed our locateFile fallback was returning the bunfs
path (`B:\~BUN\root\tree-sitter.wasm`), and emscripten then ENOENT'd
on it. The sibling-of-execPath fallback I added in the previous
commit never ran because the scriptDir branch above it took the
`isBunEmbeddedPath` shortcut and returned early.

The shortcut was based on a wrong assumption: that emscripten could
read bunfs paths. It can't — emscripten's `readAsync` calls
`fs.readFile` under the hood, and `fs.readFile('B:\~BUN\root\...')`
fails the same way `fs.existsSync` does on those paths.

Remove the shortcut. Now resolveTreeSitterWasm only returns paths
that `fs.existsSync` confirms — which on Windows means we skip the
bunfs scriptDir fallback and fall through to the
`dirname(process.execPath)` sibling, where the build script copied
tree-sitter.wasm next to the binary.

Verified locally: build copies wasm to bin/, --smoke-tree-sitter
exits 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
J
James Grugett committed
82a511c450b195261293ae849b61444a21c5324a
Parent: 9ba251b