Skip to content

Commit bc2d28b

Browse files
committed
feat(Zone): check global for rootZoneSpec
closes angular#513
1 parent 402971a commit bc2d28b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/zone.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,13 @@ const Zone: ZoneType = (function(global: any) {
952952
const symbolPromise = __symbol__('Promise');
953953
const symbolThen = __symbol__('then');
954954

955-
let _currentZoneFrame = new ZoneFrame(null, new Zone(null, null));
955+
const symbolRootZoneSpec = '__rootZoneSpec__'
956+
var rootZone: Zone = new Zone(null, null);
957+
if (global[symbolRootZoneSpec]) {
958+
rootZone = <Zone>rootZone.fork(global[symbolRootZoneSpec]);
959+
}
960+
961+
let _currentZoneFrame = new ZoneFrame(null, rootZone);
956962
let _currentTask: Task = null;
957963
let _microTaskQueue: Task[] = [];
958964
let _isDrainingMicrotaskQueue: boolean = false;

0 commit comments

Comments
 (0)