Don't stop calculating field values when a Calculate callback throws

It fixes #18561.
This commit is contained in:
Calixte Denizet 2024-08-05 19:11:48 +02:00
parent c60c0d1c6d
commit ad12f33999
4 changed files with 39 additions and 1 deletions

View file

@ -2510,4 +2510,32 @@ describe("Interaction", () => {
);
});
});
describe("Calculate field value even if one callback throws", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("issue18561.pdf", getSelector("24R"));
});
afterAll(async () => {
await closePages(pages);
});
it("must check that the product is computed although a callback threw", async () => {
await Promise.all(
pages.map(async ([browserName, page], i) => {
await waitForScripting(page);
const inputSelector = getSelector("24R");
await page.click(inputSelector);
await page.type(inputSelector, "123");
await page.click(getSelector("25R"));
await page.waitForFunction(
`${getQuerySelector("28R")}.value === "12300"`
);
})
);
});
});
});

View file

@ -660,3 +660,4 @@
!issue18099_reduced.pdf
!file_pdfjs_test.pdf
!issue18536.pdf
!issue18561.pdf

BIN
test/pdfs/issue18561.pdf Executable file

Binary file not shown.