runtime: share one parsed value between import and require() of a JSON/TOML file - #35973
Open
robobun wants to merge 9 commits into
Open
runtime: share one parsed value between import and require() of a JSON/TOML file#35973robobun wants to merge 9 commits into
robobun wants to merge 9 commits into
Claude / Claude Code Review
completed
Jul 26, 2026 in 17m 8s
Code review found 2 potential issues
Found 1 candidates, confirmed 2. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 2 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/jsc/bindings/ModuleLoader.cpp:932-941 |
reconcile clobbers require.extensions result when module.loaded is false |
Annotations
Check warning on line 941 in src/jsc/bindings/ModuleLoader.cpp
claude / Claude Code Review
reconcile clobbers require.extensions result when module.loaded is false
The `mod->hasEvaluated` gate also clobbers a `require.extensions['.json']` result: a Node-style handler that assigns `module.exports = ...` directly (no `_compile()`) leaves the cached module with `hasEvaluated == false`, so a later ESM import of the same file falls through to `mod->setExportsObject(value)` and replaces the extension's exports with the on-disk parse. This is separate from the plain-object case above — here `dynamicDowncast` succeeds, so an `entry.isUndefined()` guard would not h
Loading