From 935b2ff99fc43d2453539bb1955fda7194d168b9 Mon Sep 17 00:00:00 2001 From: JoostK Date: Mon, 16 Nov 2020 17:59:13 +0100 Subject: [PATCH] refactor(compiler-cli): allow query metadata to be omitted (#39707) The metadata specification of queries allows for the boolean properties `first`, `descendants` and `static` to be missing, but the linker did not account for their omission. This fix is tested in subsequent commits that implement compilation of components, at which point this will be covered by the compliance tests. PR Close #39707 --- .../partial_linkers/partial_directive_linker_1.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.ts b/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.ts index f89f38711a..10229bb695 100644 --- a/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.ts +++ b/packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1.ts @@ -137,11 +137,11 @@ function toQueryMetadata(obj: AstObject): R3QueryMetad } return { propertyName: obj.getString('propertyName'), - first: obj.getBoolean('first'), + first: obj.has('first') ? obj.getBoolean('first') : false, predicate, - descendants: obj.getBoolean('descendants'), + descendants: obj.has('descendants') ? obj.getBoolean('descendants') : false, read: obj.has('read') ? obj.getOpaque('read') : null, - static: obj.getBoolean('static'), + static: obj.has('static') ? obj.getBoolean('static') : false, }; }