Files
oxc-project__oxc/crates/oxc_react_compiler/fixtures/try-catch-retry-after-throw.js
Boshen d68059a2d8 fix(react_compiler): retry after caught throws (#25641)
Retain exception-handler edges for value-block stores so caught throws do not commit the input/result memo entry. This preserves retries for identical inputs after a transient throw.

Adds a sequential-render evaluator fixture covering throw-once behavior.

Validated with `env -u NO_COLOR just ready` and a Sprout runtime comparison.

AI assistance was used to investigate and implement this change.
2026-08-14 05:02:31 +00:00

33 lines
653 B
JavaScript

// @compilationMode:annotation @panicThreshold:none
function Component(params) {
'use memo';
const selectedOptions = (() => {
try {
const channel = params.parse()?.channel;
return channel ? [{label: `#${channel}`, value: channel}] : [];
} catch {
return [];
}
})();
return selectedOptions;
}
const input = {
value: 'success',
shouldThrow: true,
parse() {
if (this.shouldThrow) {
this.shouldThrow = false;
throw new Error('oops');
}
return {channel: this.value};
},
};
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [input],
sequentialRenders: [input, input],
};