Repository navigation
Count the exception a try handler binds as bound - #9481
Conversation
Changelog💅 Polish
Semantic Diff2 commits · Full page Count the exception a try handler binds as bound2463524 · cknitt + Claude · Nov 29, 2026, 08:08 UTC
JS modified (a module using an // Inline_export.res
@inline
let catchMessage = f =>
try f() catch {
| JsExn(e) => JsExn.message(e)
| _ => None
}
// inline_export_test.res
let fromCatch = Inline_export.catchMessage(() => JsError.throwWithMessage("boom"))
-let fromCatch = Inline_export.catchMessage(() => Stdlib_JsError.throwWithMessage("boom"));
+let fromCatch;
+
+try {
+ fromCatch = Stdlib_JsError.throwWithMessage("boom");
+} catch (raw_e) {
+ let e = Primitive_exceptions.internalToException(raw_e);
+ fromCatch = e.RE_EXN_ID === "JsExn" ? Stdlib_JsExn.message(e._1) : undefined;
+}Review
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
✅ Compiler benchmarksAllocated wordsIn total: 672,238,220 → 672,252,509 (±0.00%). Generated projects: 630,219,095 → 630,218,080 (±0.00%). None of the 265 benchmarks changed by 0.1% or more. InstructionsIn total: 9,225,935,307 → 9,225,944,970 (±0.00%). None of the 33 benchmarks changed by 0.1% or more. Output sizeIn total: 27,284,100 → 27,284,222 (±0.00%).
Pull request a717669 compared with base df0b61d in this run. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## remove-cross-module-opt #9481 +/- ##
========================================================
Coverage 82.43% 82.43%
========================================================
Files 465 465
Lines 65953 65956 +3
========================================================
+ Hits 54366 54371 +5
+ Misses 11587 11585 -2
🚀 New features to boost your workflow:
|
4056364 to
a717669
Compare
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
a717669 to
44b3341
Compare
Lam_closuredidn't count the variable atry … catchhandler binds as bound, so inside the handler it looked captured from outside. Every function containing a handler then counted as not closed. So an@inlinefunction with atry … catchwas never stored for other modules, and was always called.Inlined copies get fresh names for that variable, since
Lam_bounded_varsrenames it like any other binder.The only output that changes is
tests/tests/src/inline_export_test.mjs. There,Inline_export.catchMessageis now inlined:The runtime's, Belt's and all other test outputs are the same, including inlining within a module.
Part of stack #9474, after #9480.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kbf3gJwNt3jmNq5d8xKA9D