Add Module.prototype.load for new Module() instances #29256
+377
−1
Claude / Claude Code Review
completed
Apr 13, 2026 in 34m 59s
Code review found 1 potential issue
Found 4 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 0 |
| 🟡 Nit | 1 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🟡 Nit | src/js/builtins/CommonJS.ts:422-423 |
Module.prototype.load.name is "modulePrototypeLoad" not "load" |
Annotations
Check warning on line 423 in src/js/builtins/CommonJS.ts
claude / Claude Code Review
Module.prototype.load.name is "modulePrototypeLoad" not "load"
Module.prototype.load.name returns "modulePrototypeLoad" instead of "load" because the $overriddenName = "load" directive is missing before the function declaration in CommonJS.ts. JSC derives a builtin function's .name from the source declaration name, so both the instance prototype (JSCommonJSModulePrototype) and the disposable prototype (getModulePrototypeObject) will expose a load property whose .name === "modulePrototypeLoad". The fix is a one-liner: add $overriddenName = "load" immediately
Loading