From 2bb0eb604bb95db67aaf55f800a228207a75d95a Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sun, 14 Dec 2014 12:04:18 -0800 Subject: [PATCH] Ensure the 'hasParseErrors' bit is the same between trees. --- src/harness/harness.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/harness/harness.ts b/src/harness/harness.ts index edc0aa49025..471261ef1f2 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -302,6 +302,10 @@ module Utils { assert.equal(node1.end, node2.end, "node1.end !== node2.end"); assert.equal(node1.kind, node2.kind, "node1.kind !== node2.kind"); assert.equal(node1.flags, node2.flags, "node1.flags !== node2.flags"); + + // call this on both nodes to ensure all propagated flags have been set (and thus can be + // compared). + assert.equal(ts.containsParseError(node1), ts.containsParseError(node2)); assert.equal(node1.parserContextFlags, node2.parserContextFlags, "node1.parserContextFlags !== node2.parserContextFlags"); ts.forEachChild(node1,