Repository navigation
Conversation
|
Review requested:
|
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. Caution AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context. |
|
Probably worth adding a lint rule that doesn't allow calling the error constructor without throwing/assigning/returning it. |
|
Good idea. |
This comment was marked as resolved.
This comment was marked as resolved.
The default branch of the type switch constructed an Error without throwing it, so an unknown type silently benchmarked an undefined path instead of failing. Assisted-by: a closed-source coding agent Signed-off-by: Minho Yoo <13810291+irontaek@users.noreply.github.com>
Add a no-restricted-syntax selector next to the existing ThrowStatement one. It would have caught the benchmark bug fixed in the previous commit; the two intentional sites are disabled inline. Assisted-by: a closed-source coding agent Signed-off-by: Minho Yoo <13810291+irontaek@users.noreply.github.com>
622bc2e to
2c08205
Compare
|
Thanks, added the sign-off to both commits. |
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66647 +/- ##
========================================
Coverage 90.47% 90.48%
========================================
Files 791 791
Lines 276800 277204 +404
Branches 53191 53306 +115
========================================
+ Hits 250442 250825 +383
- Misses 16778 16795 +17
- Partials 9580 9584 +4 π New features to boost your workflow:
|
In 21 fs and webstorage benchmarks, the
default:branch of thetypeswitchcreates
new Error('Invalid type')without throwing it. An unknown type thenfalls through and benchmarks an undefined path instead of failing.
Before:
After, the same command throws
Error: Invalid type. Every type listed in eachbenchmark's config still has a matching
case, so valid runs are unchanged.Disclosure: this change was found by a static check for discarded
new Error(...)expressions and prepared with a coding agent, which also ran the commands above.
I'll handle review feedback myself.