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

Merge pull request #15486 from nmtigor/fix_orders_of_prop

Fix property chain orders of Operators in isDotExpression
This commit is contained in:
calixteman 2022-09-25 04:13:25 -10:00 committed by GitHub
commit da1780f826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);
});
});
});