aboutsummaryrefslogtreecommitdiff
path: root/src/preamble_sharedlib.js
blob: af204e2f5b993e2e453d4845ba052f14c7af5c5f (plain)
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
// === Auto-generated preamble library stuff ===

//========================================
// Runtime essentials
//========================================

function callRuntimeCallbacks(callbacks) {
  while(callbacks.length > 0) {
    var callback = callbacks.pop();
    var func = callback.func;
    if (typeof func === 'number') {
      func = FUNCTION_TABLE[func];
    }
    func(callback.arg === undefined ? null : callback.arg);
  }
}

var __ATINIT__ = []; // functions called during startup
var STRING_TABLE = [];

function initRuntime() {
  callRuntimeCallbacks(__ATINIT__);
}

// === Body ===