Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/src/preamble_minimal.js
4128 views
1
/**
2
* @license
3
* Copyright 2019 The Emscripten Authors
4
* SPDX-License-Identifier: MIT
5
*/
6
7
#if ASSERTIONS
8
/** @type {function(*, string=)} */
9
function assert(condition, text) {
10
if (!condition) throw text;
11
}
12
#endif
13
14
#if ASYNCIFY == 1 // ASYNCIFY-mode requires checking ABORT variable to avoid operating if code has aborted during an unwind
15
var ABORT = 0;
16
#endif
17
18
/** @param {string|number=} what */
19
function abort(what) {
20
#if ASYNCIFY == 1
21
ABORT = 1;
22
#endif
23
throw {{{ ASSERTIONS ? 'new Error(what)' : 'what' }}};
24
}
25
26
#if !WASM_BIGINT
27
// Globals used by JS i64 conversions (see makeSetValue)
28
var tempDouble;
29
var tempI64;
30
#endif
31
32
#if WASM2JS && WASM != 2
33
// WASM == 2 includes wasm2js.js separately.
34
#include "wasm2js.js"
35
#if !WASM2JS
36
}
37
#endif
38
#endif
39
40
#include "runtime_common.js"
41
42