source: trip-planner-front/node_modules/rxjs/src/internal/util/root.ts

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1declare let global: any;
2
3/**
4 * @license
5 * Copyright Google Inc. All Rights Reserved.
6 *
7 * Use of this source code is governed by an MIT-style license that can be
8 * found in the LICENSE file at https://angular.io/license
9 */
10
11declare var WorkerGlobalScope: any;
12// CommonJS / Node have global context exposed as "global" variable.
13// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake
14// the global "global" var for now.
15
16const __window = typeof window !== 'undefined' && window;
17const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
18 self instanceof WorkerGlobalScope && self;
19const __global = typeof global !== 'undefined' && global;
20const _root: any = __window || __global || __self;
21
22// Workaround Closure Compiler restriction: The body of a goog.module cannot use throw.
23// This is needed when used with angular/tsickle which inserts a goog.module statement.
24// Wrap in IIFE
25(function () {
26 if (!_root) {
27 throw new Error('RxJS could not find any global context (window, self, global)');
28 }
29})();
30
31export { _root as root };
Note: See TracBrowser for help on using the repository browser.