@coherentglobal/wasm-runner 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +263 -0
- package/dist/browser/template/main.template.d.ts +1 -0
- package/dist/browser/template/main.template.js +13 -0
- package/dist/browser/template/main.template.js.map +1 -0
- package/dist/browser/template/runtime.template.d.ts +1 -0
- package/dist/browser/template/runtime.template.js +926 -0
- package/dist/browser/template/runtime.template.js.map +1 -0
- package/dist/browser/template/worker.template.d.ts +3 -0
- package/dist/browser/template/worker.template.js +39 -0
- package/dist/browser/template/worker.template.js.map +1 -0
- package/dist/browser/template.d.ts +1 -0
- package/dist/browser/template.js +14 -0
- package/dist/browser/template.js.map +1 -0
- package/dist/browser.d.ts +63 -0
- package/dist/browser.js +308 -0
- package/dist/browser.js.map +1 -0
- package/dist/error.d.ts +56 -0
- package/dist/error.js +112 -0
- package/dist/error.js.map +1 -0
- package/dist/node/template/main.template.ejs +70 -0
- package/dist/node.d.ts +66 -0
- package/dist/node.js +375 -0
- package/dist/node.js.map +1 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +15 -0
- package/dist/utils.js +122 -0
- package/dist/utils.js.map +1 -0
- package/package.json +79 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,926 @@
|
|
|
1
|
+
function runtime(wasmBinaryFile) {
|
|
2
|
+
return function (Module) {
|
|
3
|
+
Module = typeof Module !== "undefined" ? Module : {};
|
|
4
|
+
let readyPromiseResolve, readyPromiseReject;
|
|
5
|
+
Module.ready = new Promise((resolve, reject) => {
|
|
6
|
+
readyPromiseResolve = resolve;
|
|
7
|
+
readyPromiseReject = reject;
|
|
8
|
+
});
|
|
9
|
+
var moduleOverrides = {};
|
|
10
|
+
var key;
|
|
11
|
+
for (key in Module) {
|
|
12
|
+
if (Module.hasOwnProperty(key)) {
|
|
13
|
+
moduleOverrides[key] = Module[key];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
var arguments_ = [];
|
|
17
|
+
var thisProgram = "./this.program";
|
|
18
|
+
var quit_ = function (status, toThrow) {
|
|
19
|
+
throw toThrow;
|
|
20
|
+
};
|
|
21
|
+
var ENVIRONMENT_IS_WEB = typeof window === "object";
|
|
22
|
+
var ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
|
|
23
|
+
var scriptDirectory = "";
|
|
24
|
+
function locateFile(path) {
|
|
25
|
+
if (Module["locateFile"]) {
|
|
26
|
+
return Module["locateFile"](path, scriptDirectory);
|
|
27
|
+
}
|
|
28
|
+
return scriptDirectory + path;
|
|
29
|
+
}
|
|
30
|
+
var read_, readAsync, readBinary, setWindowTitle;
|
|
31
|
+
function logExceptionOnExit(e) {
|
|
32
|
+
if (e instanceof ExitStatus)
|
|
33
|
+
return;
|
|
34
|
+
var toLog = e;
|
|
35
|
+
err("exiting due to exception: " + toLog);
|
|
36
|
+
}
|
|
37
|
+
if (ENVIRONMENT_IS_WORKER) {
|
|
38
|
+
scriptDirectory = self.location.href;
|
|
39
|
+
}
|
|
40
|
+
else if (typeof document !== "undefined" && document.currentScript) {
|
|
41
|
+
scriptDirectory = document.currentScript.src;
|
|
42
|
+
}
|
|
43
|
+
if (scriptDirectory.indexOf("blob:") !== 0) {
|
|
44
|
+
scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
scriptDirectory = "";
|
|
48
|
+
}
|
|
49
|
+
{
|
|
50
|
+
read_ = function (url) {
|
|
51
|
+
var xhr = new XMLHttpRequest();
|
|
52
|
+
xhr.open("GET", url, false);
|
|
53
|
+
xhr.send(null);
|
|
54
|
+
return xhr.responseText;
|
|
55
|
+
};
|
|
56
|
+
if (ENVIRONMENT_IS_WORKER) {
|
|
57
|
+
readBinary = function (url) {
|
|
58
|
+
var xhr = new XMLHttpRequest();
|
|
59
|
+
xhr.open("GET", url, false);
|
|
60
|
+
xhr.responseType = "arraybuffer";
|
|
61
|
+
xhr.send(null);
|
|
62
|
+
return new Uint8Array(xhr.response);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
readAsync = function (url, onload, onerror) {
|
|
66
|
+
var xhr = new XMLHttpRequest();
|
|
67
|
+
xhr.open("GET", url, true);
|
|
68
|
+
xhr.responseType = "arraybuffer";
|
|
69
|
+
xhr.onload = function () {
|
|
70
|
+
if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {
|
|
71
|
+
onload(xhr.response);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
onerror();
|
|
75
|
+
};
|
|
76
|
+
xhr.onerror = onerror;
|
|
77
|
+
xhr.send(null);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
setWindowTitle = function (title) {
|
|
81
|
+
document.title = title;
|
|
82
|
+
};
|
|
83
|
+
var out = Module["print"] || console.log.bind(console);
|
|
84
|
+
var err = Module["printErr"] || console.warn.bind(console);
|
|
85
|
+
for (key in moduleOverrides) {
|
|
86
|
+
if (moduleOverrides.hasOwnProperty(key)) {
|
|
87
|
+
Module[key] = moduleOverrides[key];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
moduleOverrides = null;
|
|
91
|
+
if (Module["arguments"])
|
|
92
|
+
arguments_ = Module["arguments"];
|
|
93
|
+
if (Module["thisProgram"])
|
|
94
|
+
thisProgram = Module["thisProgram"];
|
|
95
|
+
if (Module["quit"])
|
|
96
|
+
quit_ = Module["quit"];
|
|
97
|
+
var wasmBinary;
|
|
98
|
+
if (Module["wasmBinary"])
|
|
99
|
+
wasmBinary = Module["wasmBinary"];
|
|
100
|
+
var noExitRuntime = Module["noExitRuntime"] || true;
|
|
101
|
+
function getValue(ptr, type, noSafe) {
|
|
102
|
+
type = type || "i8";
|
|
103
|
+
if (type.charAt(type.length - 1) === "*")
|
|
104
|
+
type = "i32";
|
|
105
|
+
switch (type) {
|
|
106
|
+
case "i1":
|
|
107
|
+
return HEAP8[ptr >> 0];
|
|
108
|
+
case "i8":
|
|
109
|
+
return HEAP8[ptr >> 0];
|
|
110
|
+
case "i16":
|
|
111
|
+
return HEAP16[ptr >> 1];
|
|
112
|
+
case "i32":
|
|
113
|
+
return HEAP32[ptr >> 2];
|
|
114
|
+
case "i64":
|
|
115
|
+
return HEAP32[ptr >> 2];
|
|
116
|
+
case "float":
|
|
117
|
+
return HEAPF32[ptr >> 2];
|
|
118
|
+
case "double":
|
|
119
|
+
return Number(HEAPF64[ptr >> 3]);
|
|
120
|
+
default:
|
|
121
|
+
abort("invalid type for getValue: " + type);
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
var wasmMemory;
|
|
126
|
+
var ABORT = false;
|
|
127
|
+
var EXITSTATUS;
|
|
128
|
+
function assert(condition, text) {
|
|
129
|
+
if (!condition) {
|
|
130
|
+
abort("Assertion failed: " + text);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
function getCFunc(ident) {
|
|
134
|
+
var func = Module["_" + ident];
|
|
135
|
+
assert(func, "Cannot call unknown function " + ident + ", make sure it is exported");
|
|
136
|
+
return func;
|
|
137
|
+
}
|
|
138
|
+
function ccall(ident, returnType, argTypes, args, opts) {
|
|
139
|
+
var toC = {
|
|
140
|
+
string: function (str) {
|
|
141
|
+
var ret = 0;
|
|
142
|
+
if (str !== null && str !== undefined && str !== 0) {
|
|
143
|
+
var len = (str.length << 2) + 1;
|
|
144
|
+
ret = stackAlloc(len);
|
|
145
|
+
stringToUTF8(str, ret, len);
|
|
146
|
+
}
|
|
147
|
+
return ret;
|
|
148
|
+
},
|
|
149
|
+
array: function (arr) {
|
|
150
|
+
var ret = stackAlloc(arr.length);
|
|
151
|
+
writeArrayToMemory(arr, ret);
|
|
152
|
+
return ret;
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
function convertReturnValue(ret) {
|
|
156
|
+
if (returnType === "string")
|
|
157
|
+
return UTF8ToString(ret);
|
|
158
|
+
if (returnType === "boolean")
|
|
159
|
+
return Boolean(ret);
|
|
160
|
+
return ret;
|
|
161
|
+
}
|
|
162
|
+
var func = getCFunc(ident);
|
|
163
|
+
var cArgs = [];
|
|
164
|
+
var stack = 0;
|
|
165
|
+
if (args) {
|
|
166
|
+
for (var i = 0; i < args.length; i++) {
|
|
167
|
+
var converter = toC[argTypes[i]];
|
|
168
|
+
if (converter) {
|
|
169
|
+
if (stack === 0)
|
|
170
|
+
stack = stackSave();
|
|
171
|
+
cArgs[i] = converter(args[i]);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
cArgs[i] = args[i];
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
var ret = func.apply(null, cArgs);
|
|
179
|
+
function onDone(ret) {
|
|
180
|
+
if (stack !== 0)
|
|
181
|
+
stackRestore(stack);
|
|
182
|
+
return convertReturnValue(ret);
|
|
183
|
+
}
|
|
184
|
+
ret = onDone(ret);
|
|
185
|
+
return ret;
|
|
186
|
+
}
|
|
187
|
+
function cwrap(ident, returnType, argTypes, opts) {
|
|
188
|
+
argTypes = argTypes || [];
|
|
189
|
+
var numericArgs = argTypes.every(function (type) {
|
|
190
|
+
return type === "number";
|
|
191
|
+
});
|
|
192
|
+
var numericRet = returnType !== "string";
|
|
193
|
+
if (numericRet && numericArgs && !opts) {
|
|
194
|
+
return getCFunc(ident);
|
|
195
|
+
}
|
|
196
|
+
return function () {
|
|
197
|
+
return ccall(ident, returnType, argTypes, arguments, opts);
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined;
|
|
201
|
+
function UTF8ArrayToString(heap, idx, maxBytesToRead) {
|
|
202
|
+
var endIdx = idx + maxBytesToRead;
|
|
203
|
+
var endPtr = idx;
|
|
204
|
+
while (heap[endPtr] && !(endPtr >= endIdx))
|
|
205
|
+
++endPtr;
|
|
206
|
+
if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
|
|
207
|
+
return UTF8Decoder.decode(heap.subarray(idx, endPtr));
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
var str = "";
|
|
211
|
+
while (idx < endPtr) {
|
|
212
|
+
var u0 = heap[idx++];
|
|
213
|
+
if (!(u0 & 128)) {
|
|
214
|
+
str += String.fromCharCode(u0);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
var u1 = heap[idx++] & 63;
|
|
218
|
+
if ((u0 & 224) == 192) {
|
|
219
|
+
str += String.fromCharCode(((u0 & 31) << 6) | u1);
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
var u2 = heap[idx++] & 63;
|
|
223
|
+
if ((u0 & 240) == 224) {
|
|
224
|
+
u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heap[idx++] & 63);
|
|
228
|
+
}
|
|
229
|
+
if (u0 < 65536) {
|
|
230
|
+
str += String.fromCharCode(u0);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
var ch = u0 - 65536;
|
|
234
|
+
str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return str;
|
|
239
|
+
}
|
|
240
|
+
function UTF8ToString(ptr, maxBytesToRead) {
|
|
241
|
+
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
|
|
242
|
+
}
|
|
243
|
+
function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
|
|
244
|
+
if (!(maxBytesToWrite > 0))
|
|
245
|
+
return 0;
|
|
246
|
+
var startIdx = outIdx;
|
|
247
|
+
var endIdx = outIdx + maxBytesToWrite - 1;
|
|
248
|
+
for (var i = 0; i < str.length; ++i) {
|
|
249
|
+
var u = str.charCodeAt(i);
|
|
250
|
+
if (u >= 55296 && u <= 57343) {
|
|
251
|
+
var u1 = str.charCodeAt(++i);
|
|
252
|
+
u = (65536 + ((u & 1023) << 10)) | (u1 & 1023);
|
|
253
|
+
}
|
|
254
|
+
if (u <= 127) {
|
|
255
|
+
if (outIdx >= endIdx)
|
|
256
|
+
break;
|
|
257
|
+
heap[outIdx++] = u;
|
|
258
|
+
}
|
|
259
|
+
else if (u <= 2047) {
|
|
260
|
+
if (outIdx + 1 >= endIdx)
|
|
261
|
+
break;
|
|
262
|
+
heap[outIdx++] = 192 | (u >> 6);
|
|
263
|
+
heap[outIdx++] = 128 | (u & 63);
|
|
264
|
+
}
|
|
265
|
+
else if (u <= 65535) {
|
|
266
|
+
if (outIdx + 2 >= endIdx)
|
|
267
|
+
break;
|
|
268
|
+
heap[outIdx++] = 224 | (u >> 12);
|
|
269
|
+
heap[outIdx++] = 128 | ((u >> 6) & 63);
|
|
270
|
+
heap[outIdx++] = 128 | (u & 63);
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
if (outIdx + 3 >= endIdx)
|
|
274
|
+
break;
|
|
275
|
+
heap[outIdx++] = 240 | (u >> 18);
|
|
276
|
+
heap[outIdx++] = 128 | ((u >> 12) & 63);
|
|
277
|
+
heap[outIdx++] = 128 | ((u >> 6) & 63);
|
|
278
|
+
heap[outIdx++] = 128 | (u & 63);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
heap[outIdx] = 0;
|
|
282
|
+
return outIdx - startIdx;
|
|
283
|
+
}
|
|
284
|
+
function stringToUTF8(str, outPtr, maxBytesToWrite) {
|
|
285
|
+
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
286
|
+
}
|
|
287
|
+
function lengthBytesUTF8(str) {
|
|
288
|
+
var len = 0;
|
|
289
|
+
for (var i = 0; i < str.length; ++i) {
|
|
290
|
+
var u = str.charCodeAt(i);
|
|
291
|
+
if (u >= 55296 && u <= 57343)
|
|
292
|
+
u = (65536 + ((u & 1023) << 10)) | (str.charCodeAt(++i) & 1023);
|
|
293
|
+
if (u <= 127)
|
|
294
|
+
++len;
|
|
295
|
+
else if (u <= 2047)
|
|
296
|
+
len += 2;
|
|
297
|
+
else if (u <= 65535)
|
|
298
|
+
len += 3;
|
|
299
|
+
else
|
|
300
|
+
len += 4;
|
|
301
|
+
}
|
|
302
|
+
return len;
|
|
303
|
+
}
|
|
304
|
+
function writeArrayToMemory(array, buffer) {
|
|
305
|
+
HEAP8.set(array, buffer);
|
|
306
|
+
}
|
|
307
|
+
function writeAsciiToMemory(str, buffer, dontAddNull) {
|
|
308
|
+
for (var i = 0; i < str.length; ++i) {
|
|
309
|
+
HEAP8[buffer++ >> 0] = str.charCodeAt(i);
|
|
310
|
+
}
|
|
311
|
+
if (!dontAddNull)
|
|
312
|
+
HEAP8[buffer >> 0] = 0;
|
|
313
|
+
}
|
|
314
|
+
function alignUp(x, multiple) {
|
|
315
|
+
if (x % multiple > 0) {
|
|
316
|
+
x += multiple - (x % multiple);
|
|
317
|
+
}
|
|
318
|
+
return x;
|
|
319
|
+
}
|
|
320
|
+
var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
|
|
321
|
+
function updateGlobalBufferAndViews(buf) {
|
|
322
|
+
buffer = buf;
|
|
323
|
+
Module["HEAP8"] = HEAP8 = new Int8Array(buf);
|
|
324
|
+
Module["HEAP16"] = HEAP16 = new Int16Array(buf);
|
|
325
|
+
Module["HEAP32"] = HEAP32 = new Int32Array(buf);
|
|
326
|
+
Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf);
|
|
327
|
+
Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf);
|
|
328
|
+
Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf);
|
|
329
|
+
Module["HEAPF32"] = HEAPF32 = new Float32Array(buf);
|
|
330
|
+
Module["HEAPF64"] = HEAPF64 = new Float64Array(buf);
|
|
331
|
+
}
|
|
332
|
+
var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;
|
|
333
|
+
var wasmTable;
|
|
334
|
+
var __ATPRERUN__ = [];
|
|
335
|
+
var __ATINIT__ = [];
|
|
336
|
+
var __ATPOSTRUN__ = [];
|
|
337
|
+
var runtimeInitialized = false;
|
|
338
|
+
var runtimeExited = false;
|
|
339
|
+
var runtimeKeepaliveCounter = 0;
|
|
340
|
+
function keepRuntimeAlive() {
|
|
341
|
+
return noExitRuntime || runtimeKeepaliveCounter > 0;
|
|
342
|
+
}
|
|
343
|
+
function preRun() {
|
|
344
|
+
if (Module["preRun"]) {
|
|
345
|
+
if (typeof Module["preRun"] == "function")
|
|
346
|
+
Module["preRun"] = [Module["preRun"]];
|
|
347
|
+
while (Module["preRun"].length) {
|
|
348
|
+
addOnPreRun(Module["preRun"].shift());
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
callRuntimeCallbacks(__ATPRERUN__);
|
|
352
|
+
}
|
|
353
|
+
function initRuntime() {
|
|
354
|
+
runtimeInitialized = true;
|
|
355
|
+
callRuntimeCallbacks(__ATINIT__);
|
|
356
|
+
}
|
|
357
|
+
function exitRuntime() {
|
|
358
|
+
runtimeExited = true;
|
|
359
|
+
}
|
|
360
|
+
function postRun() {
|
|
361
|
+
if (Module["postRun"]) {
|
|
362
|
+
if (typeof Module["postRun"] == "function")
|
|
363
|
+
Module["postRun"] = [Module["postRun"]];
|
|
364
|
+
while (Module["postRun"].length) {
|
|
365
|
+
addOnPostRun(Module["postRun"].shift());
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
callRuntimeCallbacks(__ATPOSTRUN__);
|
|
369
|
+
}
|
|
370
|
+
function addOnPreRun(cb) {
|
|
371
|
+
__ATPRERUN__.unshift(cb);
|
|
372
|
+
}
|
|
373
|
+
function addOnInit(cb) {
|
|
374
|
+
__ATINIT__.unshift(cb);
|
|
375
|
+
}
|
|
376
|
+
function addOnPostRun(cb) {
|
|
377
|
+
__ATPOSTRUN__.unshift(cb);
|
|
378
|
+
}
|
|
379
|
+
var runDependencies = 0;
|
|
380
|
+
var runDependencyWatcher = null;
|
|
381
|
+
var dependenciesFulfilled = null;
|
|
382
|
+
function getUniqueRunDependency(id) {
|
|
383
|
+
return id;
|
|
384
|
+
}
|
|
385
|
+
function addRunDependency(id) {
|
|
386
|
+
runDependencies++;
|
|
387
|
+
if (Module["monitorRunDependencies"]) {
|
|
388
|
+
Module["monitorRunDependencies"](runDependencies);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function removeRunDependency(id) {
|
|
392
|
+
runDependencies--;
|
|
393
|
+
if (Module["monitorRunDependencies"]) {
|
|
394
|
+
Module["monitorRunDependencies"](runDependencies);
|
|
395
|
+
}
|
|
396
|
+
if (runDependencies == 0) {
|
|
397
|
+
if (runDependencyWatcher !== null) {
|
|
398
|
+
clearInterval(runDependencyWatcher);
|
|
399
|
+
runDependencyWatcher = null;
|
|
400
|
+
}
|
|
401
|
+
if (dependenciesFulfilled) {
|
|
402
|
+
var callback = dependenciesFulfilled;
|
|
403
|
+
dependenciesFulfilled = null;
|
|
404
|
+
callback();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
Module["preloadedImages"] = {};
|
|
409
|
+
Module["preloadedAudios"] = {};
|
|
410
|
+
function abort(what) {
|
|
411
|
+
{
|
|
412
|
+
if (Module["onAbort"]) {
|
|
413
|
+
Module["onAbort"](what);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
what = "Aborted(" + what + ")";
|
|
417
|
+
err(what);
|
|
418
|
+
ABORT = true;
|
|
419
|
+
EXITSTATUS = 1;
|
|
420
|
+
what += ". Build with -s ASSERTIONS=1 for more info.";
|
|
421
|
+
var e = new WebAssembly.RuntimeError(what);
|
|
422
|
+
readyPromiseReject(e);
|
|
423
|
+
throw e;
|
|
424
|
+
}
|
|
425
|
+
var dataURIPrefix = "data:application/octet-stream;base64,";
|
|
426
|
+
function isDataURI(filename) {
|
|
427
|
+
return filename.startsWith(dataURIPrefix);
|
|
428
|
+
}
|
|
429
|
+
function isFileURI(filename) {
|
|
430
|
+
return filename.startsWith("file://");
|
|
431
|
+
}
|
|
432
|
+
function getBinary(file) {
|
|
433
|
+
try {
|
|
434
|
+
if (file == wasmBinaryFile && wasmBinary) {
|
|
435
|
+
return new Uint8Array(wasmBinary);
|
|
436
|
+
}
|
|
437
|
+
if (readBinary) {
|
|
438
|
+
return readBinary(file);
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
throw "both async and sync fetching of the wasm failed";
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
catch (err) {
|
|
445
|
+
abort(err);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
function getBinaryPromise() {
|
|
449
|
+
if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
|
|
450
|
+
if (typeof fetch === "function" && !isFileURI(wasmBinaryFile)) {
|
|
451
|
+
return fetch(wasmBinaryFile, {
|
|
452
|
+
credentials: "same-origin",
|
|
453
|
+
})
|
|
454
|
+
.then(function (response) {
|
|
455
|
+
if (!response["ok"]) {
|
|
456
|
+
throw ("failed to load wasm binary file at '" + wasmBinaryFile + "'");
|
|
457
|
+
}
|
|
458
|
+
return response["arrayBuffer"]();
|
|
459
|
+
})
|
|
460
|
+
.catch(function () {
|
|
461
|
+
return getBinary(wasmBinaryFile);
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
if (readAsync) {
|
|
466
|
+
return new Promise(function (resolve, reject) {
|
|
467
|
+
readAsync(wasmBinaryFile, function (response) {
|
|
468
|
+
resolve(new Uint8Array(response));
|
|
469
|
+
}, reject);
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
return Promise.resolve().then(function () {
|
|
475
|
+
return getBinary(wasmBinaryFile);
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
function createWasm() {
|
|
479
|
+
var info = {
|
|
480
|
+
a: asmLibraryArg,
|
|
481
|
+
};
|
|
482
|
+
function receiveInstance(instance, module) {
|
|
483
|
+
var exports = instance.exports;
|
|
484
|
+
Module["asm"] = exports;
|
|
485
|
+
wasmMemory = Module["asm"]["p"];
|
|
486
|
+
updateGlobalBufferAndViews(wasmMemory.buffer);
|
|
487
|
+
wasmTable = Module["asm"]["r"];
|
|
488
|
+
addOnInit(Module["asm"]["q"]);
|
|
489
|
+
removeRunDependency("wasm-instantiate");
|
|
490
|
+
}
|
|
491
|
+
addRunDependency("wasm-instantiate");
|
|
492
|
+
function receiveInstantiationResult(result) {
|
|
493
|
+
receiveInstance(result["instance"]);
|
|
494
|
+
}
|
|
495
|
+
function instantiateArrayBuffer(receiver) {
|
|
496
|
+
return getBinaryPromise()
|
|
497
|
+
.then(function (binary) {
|
|
498
|
+
return WebAssembly.instantiate(binary, info);
|
|
499
|
+
})
|
|
500
|
+
.then(function (instance) {
|
|
501
|
+
return instance;
|
|
502
|
+
})
|
|
503
|
+
.then(receiver, function (reason) {
|
|
504
|
+
err("failed to asynchronously prepare wasm: " + reason);
|
|
505
|
+
abort(reason);
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
function instantiateAsync() {
|
|
509
|
+
if (!wasmBinary &&
|
|
510
|
+
typeof WebAssembly.instantiateStreaming === "function" &&
|
|
511
|
+
!isDataURI(wasmBinaryFile) &&
|
|
512
|
+
!isFileURI(wasmBinaryFile) &&
|
|
513
|
+
typeof fetch === "function") {
|
|
514
|
+
return fetch(wasmBinaryFile, {
|
|
515
|
+
credentials: "same-origin",
|
|
516
|
+
}).then(function (response) {
|
|
517
|
+
var result = WebAssembly.instantiateStreaming(response, info);
|
|
518
|
+
return result.then(receiveInstantiationResult, function (reason) {
|
|
519
|
+
err("wasm streaming compile failed: " + reason);
|
|
520
|
+
err("falling back to ArrayBuffer instantiation");
|
|
521
|
+
return instantiateArrayBuffer(receiveInstantiationResult);
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
return instantiateArrayBuffer(receiveInstantiationResult);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (Module["instantiateWasm"]) {
|
|
530
|
+
try {
|
|
531
|
+
var exports = Module["instantiateWasm"](info, receiveInstance);
|
|
532
|
+
return exports;
|
|
533
|
+
}
|
|
534
|
+
catch (e) {
|
|
535
|
+
err("Module.instantiateWasm callback failed with error: " + e);
|
|
536
|
+
return false;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
instantiateAsync().catch(readyPromiseReject);
|
|
540
|
+
return {};
|
|
541
|
+
}
|
|
542
|
+
var tempDouble;
|
|
543
|
+
var tempI64;
|
|
544
|
+
function callRuntimeCallbacks(callbacks) {
|
|
545
|
+
while (callbacks.length > 0) {
|
|
546
|
+
var callback = callbacks.shift();
|
|
547
|
+
if (typeof callback == "function") {
|
|
548
|
+
callback(Module);
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
var func = callback.func;
|
|
552
|
+
if (typeof func === "number") {
|
|
553
|
+
if (callback.arg === undefined) {
|
|
554
|
+
getWasmTableEntry(func)();
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
getWasmTableEntry(func)(callback.arg);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
func(callback.arg === undefined ? null : callback.arg);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
var wasmTableMirror = [];
|
|
566
|
+
function getWasmTableEntry(funcPtr) {
|
|
567
|
+
var func = wasmTableMirror[funcPtr];
|
|
568
|
+
if (!func) {
|
|
569
|
+
if (funcPtr >= wasmTableMirror.length)
|
|
570
|
+
wasmTableMirror.length = funcPtr + 1;
|
|
571
|
+
wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);
|
|
572
|
+
}
|
|
573
|
+
return func;
|
|
574
|
+
}
|
|
575
|
+
function ___cxa_allocate_exception(size) {
|
|
576
|
+
return _malloc(size + 16) + 16;
|
|
577
|
+
}
|
|
578
|
+
function ExceptionInfo(excPtr) {
|
|
579
|
+
this.excPtr = excPtr;
|
|
580
|
+
this.ptr = excPtr - 16;
|
|
581
|
+
this.set_type = function (type) {
|
|
582
|
+
HEAP32[(this.ptr + 4) >> 2] = type;
|
|
583
|
+
};
|
|
584
|
+
this.get_type = function () {
|
|
585
|
+
return HEAP32[(this.ptr + 4) >> 2];
|
|
586
|
+
};
|
|
587
|
+
this.set_destructor = function (destructor) {
|
|
588
|
+
HEAP32[(this.ptr + 8) >> 2] = destructor;
|
|
589
|
+
};
|
|
590
|
+
this.get_destructor = function () {
|
|
591
|
+
return HEAP32[(this.ptr + 8) >> 2];
|
|
592
|
+
};
|
|
593
|
+
this.set_refcount = function (refcount) {
|
|
594
|
+
HEAP32[this.ptr >> 2] = refcount;
|
|
595
|
+
};
|
|
596
|
+
this.set_caught = function (caught) {
|
|
597
|
+
caught = caught ? 1 : 0;
|
|
598
|
+
HEAP8[(this.ptr + 12) >> 0] = caught;
|
|
599
|
+
};
|
|
600
|
+
this.get_caught = function () {
|
|
601
|
+
return HEAP8[(this.ptr + 12) >> 0] != 0;
|
|
602
|
+
};
|
|
603
|
+
this.set_rethrown = function (rethrown) {
|
|
604
|
+
rethrown = rethrown ? 1 : 0;
|
|
605
|
+
HEAP8[(this.ptr + 13) >> 0] = rethrown;
|
|
606
|
+
};
|
|
607
|
+
this.get_rethrown = function () {
|
|
608
|
+
return HEAP8[(this.ptr + 13) >> 0] != 0;
|
|
609
|
+
};
|
|
610
|
+
this.init = function (type, destructor) {
|
|
611
|
+
this.set_type(type);
|
|
612
|
+
this.set_destructor(destructor);
|
|
613
|
+
this.set_refcount(0);
|
|
614
|
+
this.set_caught(false);
|
|
615
|
+
this.set_rethrown(false);
|
|
616
|
+
};
|
|
617
|
+
this.add_ref = function () {
|
|
618
|
+
var value = HEAP32[this.ptr >> 2];
|
|
619
|
+
HEAP32[this.ptr >> 2] = value + 1;
|
|
620
|
+
};
|
|
621
|
+
this.release_ref = function () {
|
|
622
|
+
var prev = HEAP32[this.ptr >> 2];
|
|
623
|
+
HEAP32[this.ptr >> 2] = prev - 1;
|
|
624
|
+
return prev === 1;
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
var exceptionLast = 0;
|
|
628
|
+
var uncaughtExceptionCount = 0;
|
|
629
|
+
function ___cxa_throw(ptr, type, destructor) {
|
|
630
|
+
var info = new ExceptionInfo(ptr);
|
|
631
|
+
info.init(type, destructor);
|
|
632
|
+
exceptionLast = ptr;
|
|
633
|
+
uncaughtExceptionCount++;
|
|
634
|
+
throw ptr;
|
|
635
|
+
}
|
|
636
|
+
function _abort() {
|
|
637
|
+
abort("");
|
|
638
|
+
}
|
|
639
|
+
var _emscripten_get_now = function () {
|
|
640
|
+
return performance.now();
|
|
641
|
+
};
|
|
642
|
+
var _emscripten_get_now_is_monotonic = true;
|
|
643
|
+
function setErrNo(value) {
|
|
644
|
+
HEAP32[___errno_location() >> 2] = value;
|
|
645
|
+
return value;
|
|
646
|
+
}
|
|
647
|
+
function _clock_gettime(clk_id, tp) {
|
|
648
|
+
var now;
|
|
649
|
+
if (clk_id === 0) {
|
|
650
|
+
now = Date.now();
|
|
651
|
+
}
|
|
652
|
+
else if ((clk_id === 1 || clk_id === 4) &&
|
|
653
|
+
_emscripten_get_now_is_monotonic) {
|
|
654
|
+
now = _emscripten_get_now();
|
|
655
|
+
}
|
|
656
|
+
else {
|
|
657
|
+
setErrNo(28);
|
|
658
|
+
return -1;
|
|
659
|
+
}
|
|
660
|
+
HEAP32[tp >> 2] = (now / 1e3) | 0;
|
|
661
|
+
HEAP32[(tp + 4) >> 2] = ((now % 1e3) * 1e3 * 1e3) | 0;
|
|
662
|
+
return 0;
|
|
663
|
+
}
|
|
664
|
+
function _emscripten_memcpy_big(dest, src, num) {
|
|
665
|
+
HEAPU8.copyWithin(dest, src, src + num);
|
|
666
|
+
}
|
|
667
|
+
function emscripten_realloc_buffer(size) {
|
|
668
|
+
try {
|
|
669
|
+
wasmMemory.grow((size - buffer.byteLength + 65535) >>> 16);
|
|
670
|
+
updateGlobalBufferAndViews(wasmMemory.buffer);
|
|
671
|
+
return 1;
|
|
672
|
+
}
|
|
673
|
+
catch (e) { }
|
|
674
|
+
}
|
|
675
|
+
function _emscripten_resize_heap(requestedSize) {
|
|
676
|
+
var oldSize = HEAPU8.length;
|
|
677
|
+
requestedSize = requestedSize >>> 0;
|
|
678
|
+
var maxHeapSize = 2147483648;
|
|
679
|
+
if (requestedSize > maxHeapSize) {
|
|
680
|
+
return false;
|
|
681
|
+
}
|
|
682
|
+
for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
|
|
683
|
+
var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown);
|
|
684
|
+
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
|
|
685
|
+
var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
|
|
686
|
+
var replacement = emscripten_realloc_buffer(newSize);
|
|
687
|
+
if (replacement) {
|
|
688
|
+
return true;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
return false;
|
|
692
|
+
}
|
|
693
|
+
var ENV = {};
|
|
694
|
+
function getExecutableName() {
|
|
695
|
+
return thisProgram || "./this.program";
|
|
696
|
+
}
|
|
697
|
+
function getEnvStrings() {
|
|
698
|
+
if (!getEnvStrings.strings) {
|
|
699
|
+
var lang = ((typeof navigator === "object" &&
|
|
700
|
+
navigator.languages &&
|
|
701
|
+
navigator.languages[0]) ||
|
|
702
|
+
"C").replace("-", "_") + ".UTF-8";
|
|
703
|
+
var env = {
|
|
704
|
+
USER: "web_user",
|
|
705
|
+
LOGNAME: "web_user",
|
|
706
|
+
PATH: "/",
|
|
707
|
+
PWD: "/",
|
|
708
|
+
HOME: "/home/web_user",
|
|
709
|
+
LANG: lang,
|
|
710
|
+
_: getExecutableName(),
|
|
711
|
+
};
|
|
712
|
+
for (var x in ENV) {
|
|
713
|
+
if (ENV[x] === undefined)
|
|
714
|
+
delete env[x];
|
|
715
|
+
else
|
|
716
|
+
env[x] = ENV[x];
|
|
717
|
+
}
|
|
718
|
+
var strings = [];
|
|
719
|
+
for (var x in env) {
|
|
720
|
+
strings.push(x + "=" + env[x]);
|
|
721
|
+
}
|
|
722
|
+
getEnvStrings.strings = strings;
|
|
723
|
+
}
|
|
724
|
+
return getEnvStrings.strings;
|
|
725
|
+
}
|
|
726
|
+
function getRandomDevice() {
|
|
727
|
+
if (typeof crypto === "object" &&
|
|
728
|
+
typeof crypto["getRandomValues"] === "function") {
|
|
729
|
+
var randomBuffer = new Uint8Array(1);
|
|
730
|
+
return function () {
|
|
731
|
+
crypto.getRandomValues(randomBuffer);
|
|
732
|
+
return randomBuffer[0];
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
return function () {
|
|
736
|
+
abort("randomDevice");
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
function mmapAlloc(size) {
|
|
740
|
+
abort();
|
|
741
|
+
}
|
|
742
|
+
var SYSCALLS = {
|
|
743
|
+
mappings: {},
|
|
744
|
+
DEFAULT_POLLMASK: 5,
|
|
745
|
+
varargs: undefined,
|
|
746
|
+
get: function () {
|
|
747
|
+
SYSCALLS.varargs += 4;
|
|
748
|
+
var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2];
|
|
749
|
+
return ret;
|
|
750
|
+
},
|
|
751
|
+
getStr: function (ptr) {
|
|
752
|
+
var ret = UTF8ToString(ptr);
|
|
753
|
+
return ret;
|
|
754
|
+
},
|
|
755
|
+
get64: function (low, high) {
|
|
756
|
+
return low;
|
|
757
|
+
},
|
|
758
|
+
};
|
|
759
|
+
function _environ_get(__environ, environ_buf) {
|
|
760
|
+
var bufSize = 0;
|
|
761
|
+
getEnvStrings().forEach(function (string, i) {
|
|
762
|
+
var ptr = environ_buf + bufSize;
|
|
763
|
+
HEAP32[(__environ + i * 4) >> 2] = ptr;
|
|
764
|
+
writeAsciiToMemory(string, ptr);
|
|
765
|
+
bufSize += string.length + 1;
|
|
766
|
+
});
|
|
767
|
+
return 0;
|
|
768
|
+
}
|
|
769
|
+
function _environ_sizes_get(penviron_count, penviron_buf_size) {
|
|
770
|
+
var strings = getEnvStrings();
|
|
771
|
+
HEAP32[penviron_count >> 2] = strings.length;
|
|
772
|
+
var bufSize = 0;
|
|
773
|
+
strings.forEach(function (string) {
|
|
774
|
+
bufSize += string.length + 1;
|
|
775
|
+
});
|
|
776
|
+
HEAP32[penviron_buf_size >> 2] = bufSize;
|
|
777
|
+
return 0;
|
|
778
|
+
}
|
|
779
|
+
function _exit(status) {
|
|
780
|
+
exit(status);
|
|
781
|
+
}
|
|
782
|
+
function __arraySum(array, index) {
|
|
783
|
+
var sum = 0;
|
|
784
|
+
for (var i = 0; i <= index; sum += array[i++]) { }
|
|
785
|
+
return sum;
|
|
786
|
+
}
|
|
787
|
+
function intArrayFromString(stringy, dontAddNull, length) {
|
|
788
|
+
var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
|
|
789
|
+
var u8array = new Array(len);
|
|
790
|
+
var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
|
|
791
|
+
if (dontAddNull)
|
|
792
|
+
u8array.length = numBytesWritten;
|
|
793
|
+
return u8array;
|
|
794
|
+
}
|
|
795
|
+
var asmLibraryArg = {
|
|
796
|
+
a: ___cxa_allocate_exception,
|
|
797
|
+
b: ___cxa_throw,
|
|
798
|
+
c: _abort,
|
|
799
|
+
n: _clock_gettime,
|
|
800
|
+
f: _emscripten_get_now,
|
|
801
|
+
l: _emscripten_memcpy_big,
|
|
802
|
+
m: _emscripten_resize_heap,
|
|
803
|
+
i: _environ_get,
|
|
804
|
+
j: _environ_sizes_get,
|
|
805
|
+
d: _exit,
|
|
806
|
+
e: function noop() { },
|
|
807
|
+
g: function noop() { },
|
|
808
|
+
h: function noop() { },
|
|
809
|
+
k: function noop() { },
|
|
810
|
+
o: function noop() { },
|
|
811
|
+
};
|
|
812
|
+
var asm = createWasm();
|
|
813
|
+
var ___wasm_call_ctors = (Module["___wasm_call_ctors"] = function () {
|
|
814
|
+
return (___wasm_call_ctors = Module["___wasm_call_ctors"] =
|
|
815
|
+
Module["asm"]["q"]).apply(null, arguments);
|
|
816
|
+
});
|
|
817
|
+
var _construct = (Module["_construct"] = function () {
|
|
818
|
+
return (_construct = Module["_construct"] = Module["asm"]["s"]).apply(null, arguments);
|
|
819
|
+
});
|
|
820
|
+
var _destroy = (Module["_destroy"] = function () {
|
|
821
|
+
return (_destroy = Module["_destroy"] = Module["asm"]["t"]).apply(null, arguments);
|
|
822
|
+
});
|
|
823
|
+
var _node_calc_v3 = (Module["_node_calc_v3"] = function () {
|
|
824
|
+
return (_node_calc_v3 = Module["_node_calc_v3"] =
|
|
825
|
+
Module["asm"]["u"]).apply(null, arguments);
|
|
826
|
+
});
|
|
827
|
+
var _malloc = (Module["_malloc"] = function () {
|
|
828
|
+
return (_malloc = Module["_malloc"] = Module["asm"]["v"]).apply(null, arguments);
|
|
829
|
+
});
|
|
830
|
+
var ___errno_location = (Module["___errno_location"] = function () {
|
|
831
|
+
return (___errno_location = Module["___errno_location"] =
|
|
832
|
+
Module["asm"]["w"]).apply(null, arguments);
|
|
833
|
+
});
|
|
834
|
+
var _free = (Module["_free"] = function () {
|
|
835
|
+
return (_free = Module["_free"] = Module["asm"]["x"]).apply(null, arguments);
|
|
836
|
+
});
|
|
837
|
+
var stackSave = (Module["stackSave"] = function () {
|
|
838
|
+
return (stackSave = Module["stackSave"] = Module["asm"]["y"]).apply(null, arguments);
|
|
839
|
+
});
|
|
840
|
+
var stackRestore = (Module["stackRestore"] = function () {
|
|
841
|
+
return (stackRestore = Module["stackRestore"] = Module["asm"]["z"]).apply(null, arguments);
|
|
842
|
+
});
|
|
843
|
+
var stackAlloc = (Module["stackAlloc"] = function () {
|
|
844
|
+
return (stackAlloc = Module["stackAlloc"] = Module["asm"]["A"]).apply(null, arguments);
|
|
845
|
+
});
|
|
846
|
+
Module["ccall"] = ccall;
|
|
847
|
+
Module["cwrap"] = cwrap;
|
|
848
|
+
Module["getValue"] = getValue;
|
|
849
|
+
var calledRun;
|
|
850
|
+
function ExitStatus(status) {
|
|
851
|
+
this.name = "ExitStatus";
|
|
852
|
+
this.message = "Program terminated with exit(" + status + ")";
|
|
853
|
+
this.status = status;
|
|
854
|
+
}
|
|
855
|
+
dependenciesFulfilled = function runCaller() {
|
|
856
|
+
if (!calledRun)
|
|
857
|
+
run();
|
|
858
|
+
if (!calledRun)
|
|
859
|
+
dependenciesFulfilled = runCaller;
|
|
860
|
+
};
|
|
861
|
+
function run(args) {
|
|
862
|
+
args = args || arguments_;
|
|
863
|
+
if (runDependencies > 0) {
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
preRun();
|
|
867
|
+
if (runDependencies > 0) {
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
function doRun() {
|
|
871
|
+
if (calledRun)
|
|
872
|
+
return;
|
|
873
|
+
calledRun = true;
|
|
874
|
+
Module["calledRun"] = true;
|
|
875
|
+
if (ABORT)
|
|
876
|
+
return;
|
|
877
|
+
initRuntime();
|
|
878
|
+
readyPromiseResolve(Module);
|
|
879
|
+
if (Module["onRuntimeInitialized"])
|
|
880
|
+
Module["onRuntimeInitialized"]();
|
|
881
|
+
postRun();
|
|
882
|
+
}
|
|
883
|
+
if (Module["setStatus"]) {
|
|
884
|
+
Module["setStatus"]("Running...");
|
|
885
|
+
setTimeout(function () {
|
|
886
|
+
setTimeout(function () {
|
|
887
|
+
Module["setStatus"]("");
|
|
888
|
+
}, 1);
|
|
889
|
+
doRun();
|
|
890
|
+
}, 1);
|
|
891
|
+
}
|
|
892
|
+
else {
|
|
893
|
+
doRun();
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
Module["run"] = run;
|
|
897
|
+
function exit(status, implicit) {
|
|
898
|
+
EXITSTATUS = status;
|
|
899
|
+
if (keepRuntimeAlive()) {
|
|
900
|
+
}
|
|
901
|
+
else {
|
|
902
|
+
exitRuntime();
|
|
903
|
+
}
|
|
904
|
+
procExit(status);
|
|
905
|
+
}
|
|
906
|
+
function procExit(code) {
|
|
907
|
+
EXITSTATUS = code;
|
|
908
|
+
if (!keepRuntimeAlive()) {
|
|
909
|
+
if (Module["onExit"])
|
|
910
|
+
Module["onExit"](code);
|
|
911
|
+
ABORT = true;
|
|
912
|
+
}
|
|
913
|
+
quit_(code, new ExitStatus(code));
|
|
914
|
+
}
|
|
915
|
+
if (Module["preInit"]) {
|
|
916
|
+
if (typeof Module["preInit"] == "function")
|
|
917
|
+
Module["preInit"] = [Module["preInit"]];
|
|
918
|
+
while (Module["preInit"].length > 0) {
|
|
919
|
+
Module["preInit"].pop()();
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
run();
|
|
923
|
+
return Module.ready;
|
|
924
|
+
};
|
|
925
|
+
}
|
|
926
|
+
//# sourceMappingURL=runtime.template.js.map
|