fix(SyncAsyncResult): fix default async value (#10013)

This commit is contained in:
Victor Berchet
2016-07-12 13:55:06 -07:00
committed by GitHub
parent ded518d47f
commit 6d02d2f107
2 changed files with 25 additions and 1 deletions

View File

@ -93,7 +93,7 @@ export function createDiTokenExpression(token: CompileTokenMetadata): o.Expressi
export class SyncAsyncResult<T> {
constructor(public syncResult: T, public asyncResult: Promise<T> = null) {
if (!asyncResult) {
asyncResult = Promise.resolve(syncResult);
this.asyncResult = Promise.resolve(syncResult);
}
}
}