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.
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.71% 90.73% +0.01%
==========================================
Files 801 801
Lines 280906 280906
Branches 54249 54258 +9
==========================================
+ Hits 254832 254877 +45
+ Misses 16246 16193 -53
- Partials 9828 9836 +8 🚀 New features to boost your workflow:
|
|
Friendly ping for review. Both commits now include sign-offs, and all GitHub checks are passing. This also includes the targeted lint rule suggested above. Is there anything else needed from my side? |
|
@atlowChemi since the lint rule here came from your suggestion, would you be able to take a look when you have a moment? Happy to adjust the selector or split the rule into a separate PR if that's easier to review. |
|
@irontaek can you rebase over main so we don't land the PR and have the lint rule error on code in main not fixed by the PR? |
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>
2c08205 to
b66ce2a
Compare
|
Rebased onto current main (2d8a7f3). I also ran ESLint with only the new selector enabled across |
|
Landed in 2b365b2...2ab7bc0 |
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> PR-URL: #66647 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
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> PR-URL: #66647 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
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.