fix(compiler-cli): fix and re-enble expression lowering (#18570)

Fixes issue uncovered by #18388 and re-enables expression
lowering disabled by #18513.
This commit is contained in:
Chuck Jazdzewski
2017-08-08 12:40:08 -07:00
committed by Victor Berchet
parent f0a55016af
commit 6f2038cc85
4 changed files with 80 additions and 15 deletions

View File

@ -51,11 +51,9 @@ function convert(annotatedSource: string) {
for (const annotation of annotations) {
const node = findNode(sourceFile, annotation.start, annotation.length);
expect(node).toBeDefined();
if (node) {
const location = node.pos;
requests.set(location, {name: annotation.name, kind: node.kind, location, end: node.end});
}
if (!node) throw new Error('Invalid test specification. Could not find the node to substitute');
const location = node.pos;
requests.set(location, {name: annotation.name, kind: node.kind, location, end: node.end});
}
const program = ts.createProgram(