From 5c53cf64868342deb4bb6fc452658189a9f8b385 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Sat, 30 May 2015 11:55:17 -0700 Subject: [PATCH] fix(fake_async): fixed fakeAsync to throw instead of crashing on cjs --- modules/angular2/src/test_lib/fake_async.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/angular2/src/test_lib/fake_async.ts b/modules/angular2/src/test_lib/fake_async.ts index 947690ee43..e1b510decd 100644 --- a/modules/angular2/src/test_lib/fake_async.ts +++ b/modules/angular2/src/test_lib/fake_async.ts @@ -129,7 +129,7 @@ function _dequeueTimer(id: number): Function { } function _assertInFakeAsyncZone(): void { - if (!(global.zone)._inFakeAsyncZone) { + if (!global.zone || !(global.zone)._inFakeAsyncZone) { throw new Error('The code should be running in the fakeAsync zone to call this function'); } }