Skip to content

Commit f4dd012

Browse files
committed
feat(Zone): check global for rootZoneSpec
closes angular#513 remove symbolRootZoneSpec from global using let instead of var add missing semicolon
1 parent c03acda commit f4dd012

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/zone.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,14 @@ const Zone: ZoneType = (function(global: any) {
987987
const symbolPromise = __symbol__('Promise');
988988
const symbolThen = __symbol__('then');
989989

990-
let _currentZoneFrame = new ZoneFrame(null, new Zone(null, null));
990+
const symbolRootZoneSpec = '__rootZoneSpec__';
991+
let rootZone: Zone = new Zone(null, null);
992+
if (global[symbolRootZoneSpec]) {
993+
rootZone = <Zone>rootZone.fork(global[symbolRootZoneSpec]);
994+
delete global[symbolRootZoneSpec];
995+
}
996+
997+
let _currentZoneFrame = new ZoneFrame(null, rootZone);
991998
let _currentTask: Task = null;
992999
let _microTaskQueue: Task[] = [];
9931000
let _isDrainingMicrotaskQueue: boolean = false;

0 commit comments

Comments
 (0)