fix(fake_async): fixed fakeAsync to throw instead of crashing on cjs

This commit is contained in:
vsavkin 2015-05-30 11:55:17 -07:00
parent 74882c6c38
commit 5c53cf6486
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ function _dequeueTimer(id: number): Function {
}
function _assertInFakeAsyncZone(): void {
if (!(<FakeAsyncZone>global.zone)._inFakeAsyncZone) {
if (!global.zone || !(<FakeAsyncZone>global.zone)._inFakeAsyncZone) {
throw new Error('The code should be running in the fakeAsync zone to call this function');
}
}