Skip to content

fix(try): empty <@catch>#3158

Open
LuLaValva wants to merge 5 commits intomainfrom
await-catch-no-body
Open

fix(try): empty <@catch>#3158
LuLaValva wants to merge 5 commits intomainfrom
await-catch-no-body

Conversation

@LuLaValva
Copy link
Copy Markdown
Member

Before this fix, <@catch></@catch> was functionally equivalent to having no <@catch> at all in a <try>. This is not the intended behavior, and it meant that async errors were not absorbed by stub <@catch>

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: e1e5607

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/runtime-tags Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2df6182-90a6-461c-854d-65f2bef3df2f

📥 Commits

Reviewing files that changed from the base of the PR and between a1589d8 and e1e5607.

📒 Files selected for processing (3)
  • .sizes.json
  • .sizes/dom.js
  • packages/runtime-tags/src/dom/scope.ts
✅ Files skipped from review due to trivial changes (1)
  • .sizes.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/runtime-tags/src/dom/scope.ts

Walkthrough

Try/catch handling was modified so input.catch is only normalized when present, storing 0 as a placeholder when normalization yields a falsy value; invocations now use optional chaining to safely access catch renderers and a callable fallback is provided when input.catch exists. Scope lookup (findBranchWithKey) was changed from a falsy check to a null/undefined check so falsy values (e.g., 0, "", false) are treated as present. A new test fixture and test for an empty reject-async <@catch/> were added. .sizes.json aggregates were updated and a runtime-tags changeset was added.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(try): empty <@catch>' clearly and concisely describes the main change—fixing behavior for empty catch blocks in try statements.
Description check ✅ Passed The description directly explains the fix: empty <@catch> blocks were previously treated like no catch block existed, and now they properly absorb async errors.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch await-catch-no-body

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.57%. Comparing base (33f925a) to head (e1e5607).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3158      +/-   ##
==========================================
- Coverage   89.57%   89.57%   -0.01%     
==========================================
  Files         370      370              
  Lines       47086    47087       +1     
  Branches     4270     4274       +4     
==========================================
  Hits        42177    42177              
- Misses       4857     4858       +1     
  Partials       52       52              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant