-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
preamble_minimal.js
93 lines (75 loc) · 1.66 KB
/
preamble_minimal.js
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* @license
* Copyright 2019 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/
#if SAFE_HEAP
#include "runtime_safe_heap.js"
#endif
#if USE_ASAN
#include "runtime_asan.js"
#endif
#if ASSERTIONS
/** @type {function(*, string=)} */
function assert(condition, text) {
if (!condition) throw text;
}
#endif
/** @param {string|number=} what */
function abort(what) {
throw {{{ ASSERTIONS ? 'new Error(what)' : 'what' }}};
}
#if SAFE_HEAP && !WASM_BIGINT
// Globals used by JS i64 conversions (see makeSetValue)
var tempDouble;
var tempI64;
#endif
#if WASM != 2 && MAYBE_WASM2JS
#if !WASM2JS
if (Module['doWasm2JS']) {
#endif
#include "wasm2js.js"
#if !WASM2JS
}
#endif
#endif
#if SINGLE_FILE && WASM == 1 && !WASM2JS
#include "base64Decode.js"
Module['wasm'] = base64Decode('<<< WASM_BINARY_DATA >>>');
#endif
var HEAP8, HEAP16, HEAP32, HEAPU8, HEAPU16, HEAPU32, HEAPF32, HEAPF64,
#if WASM_BIGINT
HEAP64, HEAPU64,
#endif
#if SUPPORT_BIG_ENDIAN
HEAP_DATA_VIEW,
#endif
wasmMemory;
#include "runtime_shared.js"
#if PTHREADS
#include "runtime_pthread.js"
#endif
#if IMPORTED_MEMORY
#include "runtime_init_memory.js"
#endif // IMPORTED_MEMORY
#include "runtime_stack_check.js"
#if LOAD_SOURCE_MAP
var wasmSourceMap;
#include "source_map_support.js"
#endif
#if USE_OFFSET_CONVERTER
var wasmOffsetConverter;
#include "wasm_offset_converter.js"
#endif
#if EXIT_RUNTIME
var __ATEXIT__ = []; // functions called during shutdown
var runtimeExited = false;
#endif
#if ASSERTIONS || SAFE_HEAP || USE_ASAN
var runtimeInitialized = false;
#endif
#include "runtime_math.js"
#include "memoryprofiler.js"
#include "runtime_exceptions.js"
#include "runtime_debug.js"
// === Body ===