-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathcore.js
More file actions
51 lines (45 loc) · 1.17 KB
/
core.js
File metadata and controls
51 lines (45 loc) · 1.17 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Patterns from 'tailored';
import ErlangTypes from 'erlang-types';
import Functions from './core/functions';
import SpecialForms from './core/special_forms';
import erlang from './core/erlang_compat/erlang';
import maps from './core/erlang_compat/maps';
import lists from './core/erlang_compat/lists';
import elixir_errors from './core/erlang_compat/elixir_errors';
import io from './core/erlang_compat/io';
import binary from './core/erlang_compat/binary';
import Store from './core/store';
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,
Store,
global: globalState,
erlang,
maps,
lists,
elixir_errors,
io,
binary
};