build: upgrade to TypeScript 2.7 (#22669)

Fixes: #21571

PR Close #22669
This commit is contained in:
Chuck Jazdzewski
2018-02-08 08:59:25 -08:00
committed by Kara Erickson
parent a225b48482
commit 8449eb8d62
30 changed files with 222 additions and 162 deletions

View File

@ -41,7 +41,10 @@ export function withBody<T>(html: string, blockFn: T): T {
let returnValue: any = undefined;
if (typeof blockFn === 'function') {
document.body.innerHTML = html;
let blockReturn = blockFn();
// TODO(i): I'm not sure why a cast is required here but otherwise I get
// TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'never' has
// no compatible call signatures.
let blockReturn = (blockFn as any)();
if (blockReturn instanceof Promise) {
blockReturn = blockReturn.then(done, done.fail);
} else {