-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathcore.js
More file actions
37 lines (31 loc) · 794 Bytes
/
core.js
File metadata and controls
37 lines (31 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import Patterns from 'tailored';
import ErlangTypes from 'erlang-types';
import Functions from './core/functions';
import SpecialForms from './core/special_forms';
class Integer {}
class Float {}
function get_global() {
if (typeof self !== 'undefined') {
return self;
} else if (typeof window !== 'undefined') {
return window;
} else if (typeof global !== 'undefined') {
return global;
}
console.warn('No global state found');
return null;
}
const globalState = get_global();
globalState.__elixirscript_store__ = new Map();
globalState.__elixirscript_names__ = new Map();
export default {
Tuple: ErlangTypes.Tuple,
PID: ErlangTypes.PID,
BitString: ErlangTypes.BitString,
Patterns,
Integer,
Float,
Functions,
SpecialForms,
global: globalState,
};