()
| 1089 | } |
| 1090 | |
| 1091 | function getOrCreateRootProxy() { |
| 1092 | const ProxyZoneSpec = getProxyZoneSpec(); |
| 1093 | if (ProxyZoneSpec === undefined) { |
| 1094 | throw new Error( |
| 1095 | 'ProxyZoneSpec is needed for withProxyZone but could not be found. ' + |
| 1096 | 'Make sure that your environment includes zone-testing.js', |
| 1097 | ); |
| 1098 | } |
| 1099 | // Ensure the shared ProxyZoneSpec instance exists |
| 1100 | if (_sharedProxyZoneSpec === null) { |
| 1101 | _sharedProxyZoneSpec = new ProxyZoneSpec() as ProxyZoneSpec; |
| 1102 | } |
| 1103 | |
| 1104 | _sharedProxyZone = Zone.root.fork(_sharedProxyZoneSpec); |
| 1105 | return _sharedProxyZone; |
| 1106 | } |
| 1107 | |
| 1108 | /** |
| 1109 | * Flush any pending microtasks. |
no test coverage detected