Skip to content

Commit f3f2823

Browse files
committed
Ignore grammar error nodes when asserting invariants
1 parent 22c59ec commit f3f2823

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/harness/harnessUtils.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,22 @@ namespace Utils {
120120
});
121121

122122
for (const childName in node) {
123-
if (childName === "parent" || childName === "nextContainer" || childName === "modifiers" || childName === "externalModuleIndicator" ||
123+
if (childName === "parent" ||
124+
childName === "nextContainer" ||
125+
childName === "modifiers" ||
126+
childName === "externalModuleIndicator" ||
124127
// for now ignore jsdoc comments
125-
childName === "jsDocComment" || childName === "checkJsDirective" || childName === "commonJsModuleIndicator") {
128+
childName === "jsDocComment" ||
129+
childName === "checkJsDirective" ||
130+
childName === "commonJsModuleIndicator" ||
131+
// ignore nodes added only to report grammar errors
132+
childName === "illegalInitializer" ||
133+
childName === "illegalDecorators" ||
134+
childName === "illegalModifiers" ||
135+
childName === "illegalQuestionToken" ||
136+
childName === "illegalExclamationToken" ||
137+
childName === "illegalTypeParameters" ||
138+
childName === "illegalType") {
126139
continue;
127140
}
128141
const child = (node as any)[childName];

0 commit comments

Comments
 (0)