1 | var globalScope;
|
2 | if (typeof window === 'undefined') {
|
3 | if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
|
4 |
|
5 | globalScope = self;
|
6 | }
|
7 | else {
|
8 | globalScope = global;
|
9 | }
|
10 | }
|
11 | else {
|
12 | globalScope = window;
|
13 | }
|
14 |
|
15 |
|
16 | var _global = globalScope;
|
17 | export { _global as global };
|
18 | export function isPresent(obj) {
|
19 | return obj != null;
|
20 | }
|
21 | export function stringify(token) {
|
22 | if (typeof token === 'string') {
|
23 | return token;
|
24 | }
|
25 | if (token == null) {
|
26 | return '' + token;
|
27 | }
|
28 | if (token.overriddenName) {
|
29 | return "" + token.overriddenName;
|
30 | }
|
31 | if (token.name) {
|
32 | return "" + token.name;
|
33 | }
|
34 | var res = token.toString();
|
35 | var newLineIndex = res.indexOf('\n');
|
36 | return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
|
37 | }
|
38 | var DebugContext = (function () {
|
39 | function DebugContext() {
|
40 | }
|
41 | return DebugContext;
|
42 | }());
|
43 | export { DebugContext };
|
44 |
|
\ | No newline at end of file |