1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Fix property chain orders of Operators in isDotExpression and isSomPredicate

This commit is contained in:
nmtigor 2022-09-21 17:20:23 +02:00
parent 2146d93609
commit 22cc9b7dc7
2 changed files with 13 additions and 4 deletions

View file

@ -266,7 +266,9 @@ describe("FormCalc expression parser", function () {
it("should parse basic expression with dots", function () {
const parser = new Parser("a.b.c.#d..e.f..g.*");
expect(parser.parse().dump()[0]).toEqual({
const exprlist = parser.parse();
expect(exprlist.expressions[0].isDotExpression()).toEqual(true);
expect(exprlist.dump()[0]).toEqual({
operator: ".",
left: { id: "a" },
right: {
@ -727,5 +729,12 @@ endfunc
);
expect(() => parser.parse()).toThrow(new Error(Errors.if));
});
it("should parse som predicate", () => {
const parser = new Parser("a.b <= 3");
const expr = parser.parse().expressions[0];
expect(expr.isSomPredicate()).toEqual(true);
expect(expr.left.isSomPredicate()).toEqual(true);
});
});
});