@keymanapp/kmc-kmn 18.0.29-alpha → 18.0.29-alpha-local
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/build/src/compiler/compiler.js +1 -4
- package/build/src/compiler/compiler.js.map +1 -1
- package/build/src/compiler/kmn-compiler-messages.js +1 -4
- package/build/src/compiler/kmn-compiler-messages.js.map +1 -1
- package/build/src/compiler/osk.js +1 -4
- package/build/src/compiler/osk.js.map +1 -1
- package/build/src/import/kmcmplib/wasm-host.d.ts +1 -1
- package/build/src/import/kmcmplib/wasm-host.d.ts.map +1 -1
- package/build/src/import/kmcmplib/wasm-host.js +900 -1019
- package/build/src/import/kmcmplib/wasm-host.js.map +1 -1
- package/build/src/import/kmcmplib/wasm-host.wasm +0 -0
- package/build/src/kmw-compiler/compiler-globals.js +1 -4
- package/build/src/kmw-compiler/compiler-globals.js.map +1 -1
- package/build/src/kmw-compiler/constants.js +1 -4
- package/build/src/kmw-compiler/constants.js.map +1 -1
- package/build/src/kmw-compiler/javascript-strings.js +1 -4
- package/build/src/kmw-compiler/javascript-strings.js.map +1 -1
- package/build/src/kmw-compiler/keymanweb-key-codes.js +1 -4
- package/build/src/kmw-compiler/keymanweb-key-codes.js.map +1 -1
- package/build/src/kmw-compiler/kmw-compiler-messages.js +1 -4
- package/build/src/kmw-compiler/kmw-compiler-messages.js.map +1 -1
- package/build/src/kmw-compiler/kmw-compiler.js +1 -4
- package/build/src/kmw-compiler/kmw-compiler.js.map +1 -1
- package/build/src/kmw-compiler/util.js +1 -4
- package/build/src/kmw-compiler/util.js.map +1 -1
- package/build/src/kmw-compiler/validate-layout-file.js +1 -4
- package/build/src/kmw-compiler/validate-layout-file.js.map +1 -1
- package/build/src/kmw-compiler/visual-keyboard-compiler.js +1 -4
- package/build/src/kmw-compiler/visual-keyboard-compiler.js.map +1 -1
- package/build/src/main.js +1 -4
- package/build/src/main.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c211f816-44aa-5eab-8f12-fbd1b87e723f")}catch(e){}}();
|
|
3
1
|
var Module = (() => {
|
|
4
2
|
var _scriptDir = import.meta.url;
|
|
5
|
-
return (async function (
|
|
3
|
+
return (async function (moduleArg = {}) {
|
|
6
4
|
// include: shell.js
|
|
7
5
|
// The Module object: Our interface to the outside world. We import
|
|
8
6
|
// and export values on it. There are various ways Module can be used:
|
|
@@ -17,10 +15,10 @@ var Module = (() => {
|
|
|
17
15
|
// after the generated code, you will need to define var Module = {};
|
|
18
16
|
// before the code. Then that object will be used in the code, and you
|
|
19
17
|
// can continue to use Module afterwards as well.
|
|
20
|
-
var Module =
|
|
18
|
+
var Module = moduleArg;
|
|
21
19
|
// Set up the promise that indicates the Module is initialized
|
|
22
20
|
var readyPromiseResolve, readyPromiseReject;
|
|
23
|
-
Module['ready'] = new Promise(
|
|
21
|
+
Module['ready'] = new Promise((resolve, reject) => {
|
|
24
22
|
readyPromiseResolve = resolve;
|
|
25
23
|
readyPromiseReject = reject;
|
|
26
24
|
});
|
|
@@ -55,7 +53,7 @@ var Module = (() => {
|
|
|
55
53
|
return scriptDirectory + path;
|
|
56
54
|
}
|
|
57
55
|
// Hooks that are implemented differently in different runtime environments.
|
|
58
|
-
var read_, readAsync, readBinary
|
|
56
|
+
var read_, readAsync, readBinary;
|
|
59
57
|
if (ENVIRONMENT_IS_NODE) {
|
|
60
58
|
// `require()` is no-op in an ESM module, use `createRequire()` to construct
|
|
61
59
|
// the require()` function. This is only necessary for multi-environment
|
|
@@ -91,42 +89,27 @@ var Module = (() => {
|
|
|
91
89
|
}
|
|
92
90
|
return ret;
|
|
93
91
|
};
|
|
94
|
-
readAsync = (filename, onload, onerror) => {
|
|
92
|
+
readAsync = (filename, onload, onerror, binary = true) => {
|
|
95
93
|
// See the comment in the `read_` function.
|
|
96
94
|
filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename);
|
|
97
|
-
fs.readFile(filename,
|
|
95
|
+
fs.readFile(filename, binary ? undefined : 'utf8', (err, data) => {
|
|
98
96
|
if (err)
|
|
99
97
|
onerror(err);
|
|
100
98
|
else
|
|
101
|
-
onload(data.buffer);
|
|
99
|
+
onload(binary ? data.buffer : data);
|
|
102
100
|
});
|
|
103
101
|
};
|
|
104
102
|
// end include: node_shell_read.js
|
|
105
|
-
if (process.argv.length > 1) {
|
|
103
|
+
if (!Module['thisProgram'] && process.argv.length > 1) {
|
|
106
104
|
thisProgram = process.argv[1].replace(/\\/g, '/');
|
|
107
105
|
}
|
|
108
106
|
arguments_ = process.argv.slice(2);
|
|
109
107
|
// MODULARIZE will export the module in the proper place outside, we don't need to export here
|
|
110
|
-
process.on('uncaughtException', function (ex) {
|
|
111
|
-
// suppress ExitStatus exceptions from showing an error
|
|
112
|
-
if (ex !== 'unwind' && !(ex instanceof ExitStatus) && !(ex.context instanceof ExitStatus)) {
|
|
113
|
-
throw ex;
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
// Without this older versions of node (< v15) will log unhandled rejections
|
|
117
|
-
// but return 0, which is not normally the desired behaviour. This is
|
|
118
|
-
// not be needed with node v15 and about because it is now the default
|
|
119
|
-
// behaviour:
|
|
120
|
-
// See https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
|
|
121
|
-
var nodeMajor = process.versions.node.split(".")[0];
|
|
122
|
-
if (nodeMajor < 15) {
|
|
123
|
-
process.on('unhandledRejection', function (reason) { throw reason; });
|
|
124
|
-
}
|
|
125
108
|
quit_ = (status, toThrow) => {
|
|
126
109
|
process.exitCode = status;
|
|
127
110
|
throw toThrow;
|
|
128
111
|
};
|
|
129
|
-
Module['inspect'] =
|
|
112
|
+
Module['inspect'] = () => '[Emscripten Module object]';
|
|
130
113
|
}
|
|
131
114
|
else
|
|
132
115
|
// Note that this includes Node.js workers when relevant (pthreads is enabled).
|
|
@@ -191,12 +174,11 @@ var Module = (() => {
|
|
|
191
174
|
};
|
|
192
175
|
// end include: web_or_worker_shell_read.js
|
|
193
176
|
}
|
|
194
|
-
setWindowTitle = (title) => document.title = title;
|
|
195
177
|
}
|
|
196
178
|
else {
|
|
197
179
|
}
|
|
198
180
|
var out = Module['print'] || console.log.bind(console);
|
|
199
|
-
var err = Module['printErr'] || console.
|
|
181
|
+
var err = Module['printErr'] || console.error.bind(console);
|
|
200
182
|
// Merge back in the overrides
|
|
201
183
|
Object.assign(Module, moduleOverrides);
|
|
202
184
|
// Free the object hierarchy contained in the overrides, this lets the GC
|
|
@@ -251,202 +233,6 @@ var Module = (() => {
|
|
|
251
233
|
abort(text);
|
|
252
234
|
}
|
|
253
235
|
}
|
|
254
|
-
// include: runtime_strings.js
|
|
255
|
-
// runtime_strings.js: String related runtime functions that are part of both
|
|
256
|
-
// MINIMAL_RUNTIME and regular runtime.
|
|
257
|
-
var UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined;
|
|
258
|
-
/**
|
|
259
|
-
* Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
|
|
260
|
-
* array that contains uint8 values, returns a copy of that string as a
|
|
261
|
-
* Javascript String object.
|
|
262
|
-
* heapOrArray is either a regular array, or a JavaScript typed array view.
|
|
263
|
-
* @param {number} idx
|
|
264
|
-
* @param {number=} maxBytesToRead
|
|
265
|
-
* @return {string}
|
|
266
|
-
*/
|
|
267
|
-
function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) {
|
|
268
|
-
var endIdx = idx + maxBytesToRead;
|
|
269
|
-
var endPtr = idx;
|
|
270
|
-
// TextDecoder needs to know the byte length in advance, it doesn't stop on
|
|
271
|
-
// null terminator by itself. Also, use the length info to avoid running tiny
|
|
272
|
-
// strings through TextDecoder, since .subarray() allocates garbage.
|
|
273
|
-
// (As a tiny code save trick, compare endPtr against endIdx using a negation,
|
|
274
|
-
// so that undefined means Infinity)
|
|
275
|
-
while (heapOrArray[endPtr] && !(endPtr >= endIdx))
|
|
276
|
-
++endPtr;
|
|
277
|
-
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
|
|
278
|
-
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
|
|
279
|
-
}
|
|
280
|
-
var str = '';
|
|
281
|
-
// If building with TextDecoder, we have already computed the string length
|
|
282
|
-
// above, so test loop end condition against that
|
|
283
|
-
while (idx < endPtr) {
|
|
284
|
-
// For UTF8 byte structure, see:
|
|
285
|
-
// http://en.wikipedia.org/wiki/UTF-8#Description
|
|
286
|
-
// https://www.ietf.org/rfc/rfc2279.txt
|
|
287
|
-
// https://tools.ietf.org/html/rfc3629
|
|
288
|
-
var u0 = heapOrArray[idx++];
|
|
289
|
-
if (!(u0 & 0x80)) {
|
|
290
|
-
str += String.fromCharCode(u0);
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
var u1 = heapOrArray[idx++] & 63;
|
|
294
|
-
if ((u0 & 0xE0) == 0xC0) {
|
|
295
|
-
str += String.fromCharCode(((u0 & 31) << 6) | u1);
|
|
296
|
-
continue;
|
|
297
|
-
}
|
|
298
|
-
var u2 = heapOrArray[idx++] & 63;
|
|
299
|
-
if ((u0 & 0xF0) == 0xE0) {
|
|
300
|
-
u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);
|
|
304
|
-
}
|
|
305
|
-
if (u0 < 0x10000) {
|
|
306
|
-
str += String.fromCharCode(u0);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
var ch = u0 - 0x10000;
|
|
310
|
-
str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
return str;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
|
|
317
|
-
* emscripten HEAP, returns a copy of that string as a Javascript String object.
|
|
318
|
-
*
|
|
319
|
-
* @param {number} ptr
|
|
320
|
-
* @param {number=} maxBytesToRead - An optional length that specifies the
|
|
321
|
-
* maximum number of bytes to read. You can omit this parameter to scan the
|
|
322
|
-
* string until the first \0 byte. If maxBytesToRead is passed, and the string
|
|
323
|
-
* at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
|
|
324
|
-
* string will cut short at that byte index (i.e. maxBytesToRead will not
|
|
325
|
-
* produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing
|
|
326
|
-
* frequent uses of UTF8ToString() with and without maxBytesToRead may throw
|
|
327
|
-
* JS JIT optimizations off, so it is worth to consider consistently using one
|
|
328
|
-
* @return {string}
|
|
329
|
-
*/
|
|
330
|
-
function UTF8ToString(ptr, maxBytesToRead) {
|
|
331
|
-
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '';
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Copies the given Javascript String object 'str' to the given byte array at
|
|
335
|
-
* address 'outIdx', encoded in UTF8 form and null-terminated. The copy will
|
|
336
|
-
* require at most str.length*4+1 bytes of space in the HEAP. Use the function
|
|
337
|
-
* lengthBytesUTF8 to compute the exact number of bytes (excluding null
|
|
338
|
-
* terminator) that this function will write.
|
|
339
|
-
*
|
|
340
|
-
* @param {string} str - The Javascript string to copy.
|
|
341
|
-
* @param {ArrayBufferView|Array<number>} heap - The array to copy to. Each
|
|
342
|
-
* index in this array is assumed
|
|
343
|
-
* to be one 8-byte element.
|
|
344
|
-
* @param {number} outIdx - The starting offset in the array to begin the copying.
|
|
345
|
-
* @param {number} maxBytesToWrite - The maximum number of bytes this function
|
|
346
|
-
* can write to the array. This count should
|
|
347
|
-
* include the null terminator, i.e. if
|
|
348
|
-
* maxBytesToWrite=1, only the null terminator
|
|
349
|
-
* will be written and nothing else.
|
|
350
|
-
* maxBytesToWrite=0 does not write any bytes
|
|
351
|
-
* to the output, not even the null
|
|
352
|
-
* terminator.
|
|
353
|
-
* @return {number} The number of bytes written, EXCLUDING the null terminator.
|
|
354
|
-
*/
|
|
355
|
-
function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
|
|
356
|
-
// Parameter maxBytesToWrite is not optional. Negative values, 0, null,
|
|
357
|
-
// undefined and false each don't write out any bytes.
|
|
358
|
-
if (!(maxBytesToWrite > 0))
|
|
359
|
-
return 0;
|
|
360
|
-
var startIdx = outIdx;
|
|
361
|
-
var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
|
|
362
|
-
for (var i = 0; i < str.length; ++i) {
|
|
363
|
-
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
|
|
364
|
-
// unit, not a Unicode code point of the character! So decode
|
|
365
|
-
// UTF16->UTF32->UTF8.
|
|
366
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
367
|
-
// For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description
|
|
368
|
-
// and https://www.ietf.org/rfc/rfc2279.txt
|
|
369
|
-
// and https://tools.ietf.org/html/rfc3629
|
|
370
|
-
var u = str.charCodeAt(i); // possibly a lead surrogate
|
|
371
|
-
if (u >= 0xD800 && u <= 0xDFFF) {
|
|
372
|
-
var u1 = str.charCodeAt(++i);
|
|
373
|
-
u = 0x10000 + ((u & 0x3FF) << 10) | (u1 & 0x3FF);
|
|
374
|
-
}
|
|
375
|
-
if (u <= 0x7F) {
|
|
376
|
-
if (outIdx >= endIdx)
|
|
377
|
-
break;
|
|
378
|
-
heap[outIdx++] = u;
|
|
379
|
-
}
|
|
380
|
-
else if (u <= 0x7FF) {
|
|
381
|
-
if (outIdx + 1 >= endIdx)
|
|
382
|
-
break;
|
|
383
|
-
heap[outIdx++] = 0xC0 | (u >> 6);
|
|
384
|
-
heap[outIdx++] = 0x80 | (u & 63);
|
|
385
|
-
}
|
|
386
|
-
else if (u <= 0xFFFF) {
|
|
387
|
-
if (outIdx + 2 >= endIdx)
|
|
388
|
-
break;
|
|
389
|
-
heap[outIdx++] = 0xE0 | (u >> 12);
|
|
390
|
-
heap[outIdx++] = 0x80 | ((u >> 6) & 63);
|
|
391
|
-
heap[outIdx++] = 0x80 | (u & 63);
|
|
392
|
-
}
|
|
393
|
-
else {
|
|
394
|
-
if (outIdx + 3 >= endIdx)
|
|
395
|
-
break;
|
|
396
|
-
heap[outIdx++] = 0xF0 | (u >> 18);
|
|
397
|
-
heap[outIdx++] = 0x80 | ((u >> 12) & 63);
|
|
398
|
-
heap[outIdx++] = 0x80 | ((u >> 6) & 63);
|
|
399
|
-
heap[outIdx++] = 0x80 | (u & 63);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
// Null-terminate the pointer to the buffer.
|
|
403
|
-
heap[outIdx] = 0;
|
|
404
|
-
return outIdx - startIdx;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Copies the given Javascript String object 'str' to the emscripten HEAP at
|
|
408
|
-
* address 'outPtr', null-terminated and encoded in UTF8 form. The copy will
|
|
409
|
-
* require at most str.length*4+1 bytes of space in the HEAP.
|
|
410
|
-
* Use the function lengthBytesUTF8 to compute the exact number of bytes
|
|
411
|
-
* (excluding null terminator) that this function will write.
|
|
412
|
-
*
|
|
413
|
-
* @return {number} The number of bytes written, EXCLUDING the null terminator.
|
|
414
|
-
*/
|
|
415
|
-
function stringToUTF8(str, outPtr, maxBytesToWrite) {
|
|
416
|
-
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Returns the number of bytes the given Javascript string takes if encoded as a
|
|
420
|
-
* UTF8 byte array, EXCLUDING the null terminator byte.
|
|
421
|
-
*
|
|
422
|
-
* @param {string} str - JavaScript string to operator on
|
|
423
|
-
* @return {number} Length, in bytes, of the UTF8 encoded string.
|
|
424
|
-
*/
|
|
425
|
-
function lengthBytesUTF8(str) {
|
|
426
|
-
var len = 0;
|
|
427
|
-
for (var i = 0; i < str.length; ++i) {
|
|
428
|
-
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
|
|
429
|
-
// unit, not a Unicode code point of the character! So decode
|
|
430
|
-
// UTF16->UTF32->UTF8.
|
|
431
|
-
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
432
|
-
var c = str.charCodeAt(i); // possibly a lead surrogate
|
|
433
|
-
if (c <= 0x7F) {
|
|
434
|
-
len++;
|
|
435
|
-
}
|
|
436
|
-
else if (c <= 0x7FF) {
|
|
437
|
-
len += 2;
|
|
438
|
-
}
|
|
439
|
-
else if (c >= 0xD800 && c <= 0xDFFF) {
|
|
440
|
-
len += 4;
|
|
441
|
-
++i;
|
|
442
|
-
}
|
|
443
|
-
else {
|
|
444
|
-
len += 3;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return len;
|
|
448
|
-
}
|
|
449
|
-
// end include: runtime_strings.js
|
|
450
236
|
// Memory management
|
|
451
237
|
var HEAP,
|
|
452
238
|
/** @type {!Int8Array} */
|
|
@@ -469,19 +255,13 @@ var Module = (() => {
|
|
|
469
255
|
var b = wasmMemory.buffer;
|
|
470
256
|
Module['HEAP8'] = HEAP8 = new Int8Array(b);
|
|
471
257
|
Module['HEAP16'] = HEAP16 = new Int16Array(b);
|
|
472
|
-
Module['HEAP32'] = HEAP32 = new Int32Array(b);
|
|
473
258
|
Module['HEAPU8'] = HEAPU8 = new Uint8Array(b);
|
|
474
259
|
Module['HEAPU16'] = HEAPU16 = new Uint16Array(b);
|
|
260
|
+
Module['HEAP32'] = HEAP32 = new Int32Array(b);
|
|
475
261
|
Module['HEAPU32'] = HEAPU32 = new Uint32Array(b);
|
|
476
262
|
Module['HEAPF32'] = HEAPF32 = new Float32Array(b);
|
|
477
263
|
Module['HEAPF64'] = HEAPF64 = new Float64Array(b);
|
|
478
264
|
}
|
|
479
|
-
// include: runtime_init_table.js
|
|
480
|
-
// In regular non-RELOCATABLE mode the table is exported
|
|
481
|
-
// from the wasm module and this will be assigned once
|
|
482
|
-
// the exports are available.
|
|
483
|
-
var wasmTable;
|
|
484
|
-
// end include: runtime_init_table.js
|
|
485
265
|
// include: runtime_stack_check.js
|
|
486
266
|
// end include: runtime_stack_check.js
|
|
487
267
|
// include: runtime_assertions.js
|
|
@@ -598,7 +378,7 @@ var Module = (() => {
|
|
|
598
378
|
// TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed.
|
|
599
379
|
// See above, in the meantime, we resort to wasm code for trapping.
|
|
600
380
|
//
|
|
601
|
-
// In case abort() is called before the module is initialized,
|
|
381
|
+
// In case abort() is called before the module is initialized, wasmExports
|
|
602
382
|
// and its exported '__trap' function is not available, in which case we throw
|
|
603
383
|
// a RuntimeError.
|
|
604
384
|
//
|
|
@@ -645,57 +425,49 @@ var Module = (() => {
|
|
|
645
425
|
// Use bundler-friendly `new URL(..., import.meta.url)` pattern; works in browsers too.
|
|
646
426
|
wasmBinaryFile = new URL('wasm-host.wasm', import.meta.url).href;
|
|
647
427
|
}
|
|
648
|
-
function
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
return new Uint8Array(wasmBinary);
|
|
652
|
-
}
|
|
653
|
-
if (readBinary) {
|
|
654
|
-
return readBinary(file);
|
|
655
|
-
}
|
|
656
|
-
throw "both async and sync fetching of the wasm failed";
|
|
428
|
+
function getBinarySync(file) {
|
|
429
|
+
if (file == wasmBinaryFile && wasmBinary) {
|
|
430
|
+
return new Uint8Array(wasmBinary);
|
|
657
431
|
}
|
|
658
|
-
|
|
659
|
-
|
|
432
|
+
if (readBinary) {
|
|
433
|
+
return readBinary(file);
|
|
660
434
|
}
|
|
435
|
+
throw "both async and sync fetching of the wasm failed";
|
|
661
436
|
}
|
|
662
437
|
function getBinaryPromise(binaryFile) {
|
|
663
|
-
// If we don't have the binary yet, try to
|
|
438
|
+
// If we don't have the binary yet, try to load it asynchronously.
|
|
664
439
|
// Fetch has some additional restrictions over XHR, like it can't be used on a file:// url.
|
|
665
440
|
// See https://github.com/github/fetch/pull/92#issuecomment-140665932
|
|
666
441
|
// Cordova or Electron apps are typically loaded from a file:// url.
|
|
667
442
|
// So use fetch if it is available and the url is not a file, otherwise fall back to XHR.
|
|
668
|
-
if (!wasmBinary
|
|
443
|
+
if (!wasmBinary
|
|
444
|
+
&& (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
|
|
669
445
|
if (typeof fetch == 'function'
|
|
670
446
|
&& !isFileURI(binaryFile)) {
|
|
671
|
-
return fetch(binaryFile, { credentials: 'same-origin' }).then(
|
|
447
|
+
return fetch(binaryFile, { credentials: 'same-origin' }).then((response) => {
|
|
672
448
|
if (!response['ok']) {
|
|
673
449
|
throw "failed to load wasm binary file at '" + binaryFile + "'";
|
|
674
450
|
}
|
|
675
451
|
return response['arrayBuffer']();
|
|
676
|
-
}).catch(
|
|
677
|
-
return getBinary(binaryFile);
|
|
678
|
-
});
|
|
452
|
+
}).catch(() => getBinarySync(binaryFile));
|
|
679
453
|
}
|
|
680
|
-
else {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
});
|
|
686
|
-
}
|
|
454
|
+
else if (readAsync) {
|
|
455
|
+
// fetch is not available or url is file => try XHR (readAsync uses XHR internally)
|
|
456
|
+
return new Promise((resolve, reject) => {
|
|
457
|
+
readAsync(binaryFile, (response) => resolve(new Uint8Array(/** @type{!ArrayBuffer} */ (response))), reject);
|
|
458
|
+
});
|
|
687
459
|
}
|
|
688
460
|
}
|
|
689
|
-
// Otherwise,
|
|
690
|
-
return Promise.resolve().then(
|
|
461
|
+
// Otherwise, getBinarySync should be able to get it synchronously
|
|
462
|
+
return Promise.resolve().then(() => getBinarySync(binaryFile));
|
|
691
463
|
}
|
|
692
464
|
function instantiateArrayBuffer(binaryFile, imports, receiver) {
|
|
693
|
-
return getBinaryPromise(binaryFile).then(
|
|
465
|
+
return getBinaryPromise(binaryFile).then((binary) => {
|
|
694
466
|
return WebAssembly.instantiate(binary, imports);
|
|
695
|
-
}).then(
|
|
467
|
+
}).then((instance) => {
|
|
696
468
|
return instance;
|
|
697
|
-
}).then(receiver,
|
|
698
|
-
err(
|
|
469
|
+
}).then(receiver, (reason) => {
|
|
470
|
+
err(`failed to asynchronously prepare wasm: ${reason}`);
|
|
699
471
|
abort(reason);
|
|
700
472
|
});
|
|
701
473
|
}
|
|
@@ -713,7 +485,7 @@ var Module = (() => {
|
|
|
713
485
|
// https://github.com/emscripten-core/emscripten/pull/16917
|
|
714
486
|
!ENVIRONMENT_IS_NODE &&
|
|
715
487
|
typeof fetch == 'function') {
|
|
716
|
-
return fetch(binaryFile, { credentials: 'same-origin' }).then(
|
|
488
|
+
return fetch(binaryFile, { credentials: 'same-origin' }).then((response) => {
|
|
717
489
|
// Suppress closure warning here since the upstream definition for
|
|
718
490
|
// instantiateStreaming only allows Promise<Repsponse> rather than
|
|
719
491
|
// an actual Response.
|
|
@@ -723,15 +495,13 @@ var Module = (() => {
|
|
|
723
495
|
return result.then(callback, function (reason) {
|
|
724
496
|
// We expect the most common failure cause to be a bad MIME type for the binary,
|
|
725
497
|
// in which case falling back to ArrayBuffer instantiation should work.
|
|
726
|
-
err(
|
|
498
|
+
err(`wasm streaming compile failed: ${reason}`);
|
|
727
499
|
err('falling back to ArrayBuffer instantiation');
|
|
728
500
|
return instantiateArrayBuffer(binaryFile, imports, callback);
|
|
729
501
|
});
|
|
730
502
|
});
|
|
731
503
|
}
|
|
732
|
-
|
|
733
|
-
return instantiateArrayBuffer(binaryFile, imports, callback);
|
|
734
|
-
}
|
|
504
|
+
return instantiateArrayBuffer(binaryFile, imports, callback);
|
|
735
505
|
}
|
|
736
506
|
// Create the wasm instance.
|
|
737
507
|
// Receives the wasm imports, returns the exports.
|
|
@@ -746,14 +516,14 @@ var Module = (() => {
|
|
|
746
516
|
// performing other necessary setup
|
|
747
517
|
/** @param {WebAssembly.Module=} module*/
|
|
748
518
|
function receiveInstance(instance, module) {
|
|
749
|
-
|
|
750
|
-
Module['
|
|
751
|
-
wasmMemory =
|
|
519
|
+
wasmExports = instance.exports;
|
|
520
|
+
Module['wasmExports'] = wasmExports;
|
|
521
|
+
wasmMemory = wasmExports['memory'];
|
|
752
522
|
updateMemoryViews();
|
|
753
|
-
wasmTable =
|
|
754
|
-
addOnInit(
|
|
523
|
+
wasmTable = wasmExports['__indirect_function_table'];
|
|
524
|
+
addOnInit(wasmExports['__wasm_call_ctors']);
|
|
755
525
|
removeRunDependency('wasm-instantiate');
|
|
756
|
-
return
|
|
526
|
+
return wasmExports;
|
|
757
527
|
}
|
|
758
528
|
// wait for the pthread pool (if any)
|
|
759
529
|
addRunDependency('wasm-instantiate');
|
|
@@ -762,19 +532,21 @@ var Module = (() => {
|
|
|
762
532
|
// 'result' is a ResultObject object which has both the module and instance.
|
|
763
533
|
// receiveInstance() will swap in the exports (to Module.asm) so they can be called
|
|
764
534
|
// TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line.
|
|
765
|
-
// When the regression is fixed, can restore the above
|
|
535
|
+
// When the regression is fixed, can restore the above PTHREADS-enabled path.
|
|
766
536
|
receiveInstance(result['instance']);
|
|
767
537
|
}
|
|
768
538
|
// User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback
|
|
769
|
-
// to manually instantiate the Wasm module themselves. This allows pages to
|
|
770
|
-
// to any other async startup actions they are
|
|
771
|
-
//
|
|
539
|
+
// to manually instantiate the Wasm module themselves. This allows pages to
|
|
540
|
+
// run the instantiation parallel to any other async startup actions they are
|
|
541
|
+
// performing.
|
|
542
|
+
// Also pthreads and wasm workers initialize the wasm instance through this
|
|
543
|
+
// path.
|
|
772
544
|
if (Module['instantiateWasm']) {
|
|
773
545
|
try {
|
|
774
546
|
return Module['instantiateWasm'](info, receiveInstance);
|
|
775
547
|
}
|
|
776
548
|
catch (e) {
|
|
777
|
-
err(
|
|
549
|
+
err(`Module.instantiateWasm callback failed with error: ${e}`);
|
|
778
550
|
// If instantiation fails, reject the module ready promise.
|
|
779
551
|
readyPromiseReject(e);
|
|
780
552
|
}
|
|
@@ -811,15 +583,15 @@ var Module = (() => {
|
|
|
811
583
|
/** @constructor */
|
|
812
584
|
function ExitStatus(status) {
|
|
813
585
|
this.name = 'ExitStatus';
|
|
814
|
-
this.message =
|
|
586
|
+
this.message = `Program terminated with exit(${status})`;
|
|
815
587
|
this.status = status;
|
|
816
588
|
}
|
|
817
|
-
|
|
589
|
+
var callRuntimeCallbacks = (callbacks) => {
|
|
818
590
|
while (callbacks.length > 0) {
|
|
819
591
|
// Pass the module as the first argument.
|
|
820
592
|
callbacks.shift()(Module);
|
|
821
593
|
}
|
|
822
|
-
}
|
|
594
|
+
};
|
|
823
595
|
/**
|
|
824
596
|
* @param {number} ptr
|
|
825
597
|
* @param {string} type
|
|
@@ -832,11 +604,11 @@ var Module = (() => {
|
|
|
832
604
|
case 'i8': return HEAP8[((ptr) >> 0)];
|
|
833
605
|
case 'i16': return HEAP16[((ptr) >> 1)];
|
|
834
606
|
case 'i32': return HEAP32[((ptr) >> 2)];
|
|
835
|
-
case 'i64':
|
|
607
|
+
case 'i64': abort('to do getValue(i64) use WASM_BIGINT');
|
|
836
608
|
case 'float': return HEAPF32[((ptr) >> 2)];
|
|
837
609
|
case 'double': return HEAPF64[((ptr) >> 3)];
|
|
838
610
|
case '*': return HEAPU32[((ptr) >> 2)];
|
|
839
|
-
default: abort(
|
|
611
|
+
default: abort(`invalid type for getValue: ${type}`);
|
|
840
612
|
}
|
|
841
613
|
}
|
|
842
614
|
/**
|
|
@@ -860,9 +632,7 @@ var Module = (() => {
|
|
|
860
632
|
case 'i32':
|
|
861
633
|
HEAP32[((ptr) >> 2)] = value;
|
|
862
634
|
break;
|
|
863
|
-
case 'i64':
|
|
864
|
-
(tempI64 = [value >>> 0, (tempDouble = value, (+(Math.abs(tempDouble))) >= 1.0 ? (tempDouble > 0.0 ? ((Math.min((+(Math.floor((tempDouble) / 4294967296.0))), 4294967295.0)) | 0) >>> 0 : (~~((+(Math.ceil((tempDouble - +(((~~(tempDouble))) >>> 0)) / 4294967296.0))))) >>> 0) : 0)], HEAP32[((ptr) >> 2)] = tempI64[0], HEAP32[(((ptr) + (4)) >> 2)] = tempI64[1]);
|
|
865
|
-
break;
|
|
635
|
+
case 'i64': abort('to do setValue(i64) use WASM_BIGINT');
|
|
866
636
|
case 'float':
|
|
867
637
|
HEAPF32[((ptr) >> 2)] = value;
|
|
868
638
|
break;
|
|
@@ -872,76 +642,106 @@ var Module = (() => {
|
|
|
872
642
|
case '*':
|
|
873
643
|
HEAPU32[((ptr) >> 2)] = value;
|
|
874
644
|
break;
|
|
875
|
-
default: abort(
|
|
645
|
+
default: abort(`invalid type for setValue: ${type}`);
|
|
876
646
|
}
|
|
877
647
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
648
|
+
var UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined;
|
|
649
|
+
/**
|
|
650
|
+
* Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given
|
|
651
|
+
* array that contains uint8 values, returns a copy of that string as a
|
|
652
|
+
* Javascript String object.
|
|
653
|
+
* heapOrArray is either a regular array, or a JavaScript typed array view.
|
|
654
|
+
* @param {number} idx
|
|
655
|
+
* @param {number=} maxBytesToRead
|
|
656
|
+
* @return {string}
|
|
657
|
+
*/
|
|
658
|
+
var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
|
|
659
|
+
var endIdx = idx + maxBytesToRead;
|
|
660
|
+
var endPtr = idx;
|
|
661
|
+
// TextDecoder needs to know the byte length in advance, it doesn't stop on
|
|
662
|
+
// null terminator by itself. Also, use the length info to avoid running tiny
|
|
663
|
+
// strings through TextDecoder, since .subarray() allocates garbage.
|
|
664
|
+
// (As a tiny code save trick, compare endPtr against endIdx using a negation,
|
|
665
|
+
// so that undefined means Infinity)
|
|
666
|
+
while (heapOrArray[endPtr] && !(endPtr >= endIdx))
|
|
667
|
+
++endPtr;
|
|
668
|
+
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
|
|
669
|
+
return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
|
|
670
|
+
}
|
|
671
|
+
var str = '';
|
|
672
|
+
// If building with TextDecoder, we have already computed the string length
|
|
673
|
+
// above, so test loop end condition against that
|
|
674
|
+
while (idx < endPtr) {
|
|
675
|
+
// For UTF8 byte structure, see:
|
|
676
|
+
// http://en.wikipedia.org/wiki/UTF-8#Description
|
|
677
|
+
// https://www.ietf.org/rfc/rfc2279.txt
|
|
678
|
+
// https://tools.ietf.org/html/rfc3629
|
|
679
|
+
var u0 = heapOrArray[idx++];
|
|
680
|
+
if (!(u0 & 0x80)) {
|
|
681
|
+
str += String.fromCharCode(u0);
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
var u1 = heapOrArray[idx++] & 63;
|
|
685
|
+
if ((u0 & 0xE0) == 0xC0) {
|
|
686
|
+
str += String.fromCharCode(((u0 & 31) << 6) | u1);
|
|
687
|
+
continue;
|
|
688
|
+
}
|
|
689
|
+
var u2 = heapOrArray[idx++] & 63;
|
|
690
|
+
if ((u0 & 0xF0) == 0xE0) {
|
|
691
|
+
u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;
|
|
692
|
+
}
|
|
693
|
+
else {
|
|
694
|
+
u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);
|
|
695
|
+
}
|
|
696
|
+
if (u0 < 0x10000) {
|
|
697
|
+
str += String.fromCharCode(u0);
|
|
698
|
+
}
|
|
699
|
+
else {
|
|
700
|
+
var ch = u0 - 0x10000;
|
|
701
|
+
str += String.fromCharCode(0xD800 | (ch >> 10), 0xDC00 | (ch & 0x3FF));
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
return str;
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
* Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
|
|
708
|
+
* emscripten HEAP, returns a copy of that string as a Javascript String object.
|
|
709
|
+
*
|
|
710
|
+
* @param {number} ptr
|
|
711
|
+
* @param {number=} maxBytesToRead - An optional length that specifies the
|
|
712
|
+
* maximum number of bytes to read. You can omit this parameter to scan the
|
|
713
|
+
* string until the first 0 byte. If maxBytesToRead is passed, and the string
|
|
714
|
+
* at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the
|
|
715
|
+
* string will cut short at that byte index (i.e. maxBytesToRead will not
|
|
716
|
+
* produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing
|
|
717
|
+
* frequent uses of UTF8ToString() with and without maxBytesToRead may throw
|
|
718
|
+
* JS JIT optimizations off, so it is worth to consider consistently using one
|
|
719
|
+
* @return {string}
|
|
720
|
+
*/
|
|
721
|
+
var UTF8ToString = (ptr, maxBytesToRead) => {
|
|
722
|
+
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '';
|
|
723
|
+
};
|
|
724
|
+
var ___assert_fail = (condition, filename, line, func) => {
|
|
725
|
+
abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
|
|
726
|
+
};
|
|
881
727
|
var structRegistrations = {};
|
|
882
|
-
|
|
728
|
+
var runDestructors = (destructors) => {
|
|
883
729
|
while (destructors.length) {
|
|
884
730
|
var ptr = destructors.pop();
|
|
885
731
|
var del = destructors.pop();
|
|
886
732
|
del(ptr);
|
|
887
733
|
}
|
|
888
|
-
}
|
|
734
|
+
};
|
|
735
|
+
/** @suppress {globalThis} */
|
|
889
736
|
function simpleReadValueFromPointer(pointer) {
|
|
890
737
|
return this['fromWireType'](HEAP32[((pointer) >> 2)]);
|
|
891
738
|
}
|
|
892
739
|
var awaitingDependencies = {};
|
|
893
740
|
var registeredTypes = {};
|
|
894
741
|
var typeDependencies = {};
|
|
895
|
-
var
|
|
896
|
-
var
|
|
897
|
-
|
|
898
|
-
if (undefined === name) {
|
|
899
|
-
return '_unknown';
|
|
900
|
-
}
|
|
901
|
-
name = name.replace(/[^a-zA-Z0-9_]/g, '$');
|
|
902
|
-
var f = name.charCodeAt(0);
|
|
903
|
-
if (f >= char_0 && f <= char_9) {
|
|
904
|
-
return '_' + name;
|
|
905
|
-
}
|
|
906
|
-
return name;
|
|
907
|
-
}
|
|
908
|
-
function createNamedFunction(name, body) {
|
|
909
|
-
name = makeLegalFunctionName(name);
|
|
910
|
-
// Use an abject with a computed property name to create a new function with
|
|
911
|
-
// a name specified at runtime, but without using `new Function` or `eval`.
|
|
912
|
-
return {
|
|
913
|
-
[name]: function () {
|
|
914
|
-
return body.apply(this, arguments);
|
|
915
|
-
}
|
|
916
|
-
}[name];
|
|
917
|
-
}
|
|
918
|
-
function extendError(baseErrorType, errorName) {
|
|
919
|
-
var errorClass = createNamedFunction(errorName, function (message) {
|
|
920
|
-
this.name = errorName;
|
|
921
|
-
this.message = message;
|
|
922
|
-
var stack = (new Error(message)).stack;
|
|
923
|
-
if (stack !== undefined) {
|
|
924
|
-
this.stack = this.toString() + '\n' +
|
|
925
|
-
stack.replace(/^Error(:[^\n]*)?\n/, '');
|
|
926
|
-
}
|
|
927
|
-
});
|
|
928
|
-
errorClass.prototype = Object.create(baseErrorType.prototype);
|
|
929
|
-
errorClass.prototype.constructor = errorClass;
|
|
930
|
-
errorClass.prototype.toString = function () {
|
|
931
|
-
if (this.message === undefined) {
|
|
932
|
-
return this.name;
|
|
933
|
-
}
|
|
934
|
-
else {
|
|
935
|
-
return this.name + ': ' + this.message;
|
|
936
|
-
}
|
|
937
|
-
};
|
|
938
|
-
return errorClass;
|
|
939
|
-
}
|
|
940
|
-
var InternalError = undefined;
|
|
941
|
-
function throwInternalError(message) {
|
|
942
|
-
throw new InternalError(message);
|
|
943
|
-
}
|
|
944
|
-
function whenDependentTypesAreResolved(myTypes, dependentTypes, getTypeConverters) {
|
|
742
|
+
var InternalError;
|
|
743
|
+
var throwInternalError = (message) => { throw new InternalError(message); };
|
|
744
|
+
var whenDependentTypesAreResolved = (myTypes, dependentTypes, getTypeConverters) => {
|
|
945
745
|
myTypes.forEach(function (type) {
|
|
946
746
|
typeDependencies[type] = dependentTypes;
|
|
947
747
|
});
|
|
@@ -978,8 +778,8 @@ var Module = (() => {
|
|
|
978
778
|
if (0 === unregisteredTypes.length) {
|
|
979
779
|
onComplete(typeConverters);
|
|
980
780
|
}
|
|
981
|
-
}
|
|
982
|
-
|
|
781
|
+
};
|
|
782
|
+
var __embind_finalize_value_object = (structType) => {
|
|
983
783
|
var reg = structRegistrations[structType];
|
|
984
784
|
delete structRegistrations[structType];
|
|
985
785
|
var rawConstructor = reg.rawConstructor;
|
|
@@ -1010,7 +810,7 @@ var Module = (() => {
|
|
|
1010
810
|
});
|
|
1011
811
|
return [{
|
|
1012
812
|
name: reg.name,
|
|
1013
|
-
'fromWireType':
|
|
813
|
+
'fromWireType': (ptr) => {
|
|
1014
814
|
var rv = {};
|
|
1015
815
|
for (var i in fields) {
|
|
1016
816
|
rv[i] = fields[i].read(ptr);
|
|
@@ -1018,12 +818,12 @@ var Module = (() => {
|
|
|
1018
818
|
rawDestructor(ptr);
|
|
1019
819
|
return rv;
|
|
1020
820
|
},
|
|
1021
|
-
'toWireType':
|
|
821
|
+
'toWireType': (destructors, o) => {
|
|
1022
822
|
// todo: Here we have an opportunity for -O3 level "unsafe" optimizations:
|
|
1023
823
|
// assume all fields are present without checking.
|
|
1024
824
|
for (var fieldName in fields) {
|
|
1025
825
|
if (!(fieldName in o)) {
|
|
1026
|
-
throw new TypeError(
|
|
826
|
+
throw new TypeError(`Missing field: "${fieldName}"`);
|
|
1027
827
|
}
|
|
1028
828
|
}
|
|
1029
829
|
var ptr = rawConstructor();
|
|
@@ -1035,58 +835,43 @@ var Module = (() => {
|
|
|
1035
835
|
}
|
|
1036
836
|
return ptr;
|
|
1037
837
|
},
|
|
1038
|
-
'argPackAdvance':
|
|
838
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
1039
839
|
'readValueFromPointer': simpleReadValueFromPointer,
|
|
1040
840
|
destructorFunction: rawDestructor,
|
|
1041
841
|
}];
|
|
1042
842
|
});
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
switch (size) {
|
|
1047
|
-
case 1: return 0;
|
|
1048
|
-
case 2: return 1;
|
|
1049
|
-
case 4: return 2;
|
|
1050
|
-
case 8: return 3;
|
|
1051
|
-
default:
|
|
1052
|
-
throw new TypeError('Unknown type size: ' + size);
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
function embind_init_charCodes() {
|
|
843
|
+
};
|
|
844
|
+
var __embind_register_bigint = (primitiveType, name, size, minRange, maxRange) => { };
|
|
845
|
+
var embind_init_charCodes = () => {
|
|
1056
846
|
var codes = new Array(256);
|
|
1057
847
|
for (var i = 0; i < 256; ++i) {
|
|
1058
848
|
codes[i] = String.fromCharCode(i);
|
|
1059
849
|
}
|
|
1060
850
|
embind_charCodes = codes;
|
|
1061
|
-
}
|
|
1062
|
-
var embind_charCodes
|
|
1063
|
-
|
|
851
|
+
};
|
|
852
|
+
var embind_charCodes;
|
|
853
|
+
var readLatin1String = (ptr) => {
|
|
1064
854
|
var ret = "";
|
|
1065
855
|
var c = ptr;
|
|
1066
856
|
while (HEAPU8[c]) {
|
|
1067
857
|
ret += embind_charCodes[HEAPU8[c++]];
|
|
1068
858
|
}
|
|
1069
859
|
return ret;
|
|
1070
|
-
}
|
|
1071
|
-
var BindingError
|
|
1072
|
-
|
|
1073
|
-
throw new BindingError(message);
|
|
1074
|
-
}
|
|
860
|
+
};
|
|
861
|
+
var BindingError;
|
|
862
|
+
var throwBindingError = (message) => { throw new BindingError(message); };
|
|
1075
863
|
/** @param {Object=} options */
|
|
1076
|
-
function
|
|
1077
|
-
if (!('argPackAdvance' in registeredInstance)) {
|
|
1078
|
-
throw new TypeError('registerType registeredInstance requires argPackAdvance');
|
|
1079
|
-
}
|
|
864
|
+
function sharedRegisterType(rawType, registeredInstance, options = {}) {
|
|
1080
865
|
var name = registeredInstance.name;
|
|
1081
866
|
if (!rawType) {
|
|
1082
|
-
throwBindingError(
|
|
867
|
+
throwBindingError(`type "${name}" must have a positive integer typeid pointer`);
|
|
1083
868
|
}
|
|
1084
869
|
if (registeredTypes.hasOwnProperty(rawType)) {
|
|
1085
870
|
if (options.ignoreDuplicateRegistrations) {
|
|
1086
871
|
return;
|
|
1087
872
|
}
|
|
1088
873
|
else {
|
|
1089
|
-
throwBindingError(
|
|
874
|
+
throwBindingError(`Cannot register type '${name}' twice`);
|
|
1090
875
|
}
|
|
1091
876
|
}
|
|
1092
877
|
registeredTypes[rawType] = registeredInstance;
|
|
@@ -1097,11 +882,19 @@ var Module = (() => {
|
|
|
1097
882
|
callbacks.forEach((cb) => cb());
|
|
1098
883
|
}
|
|
1099
884
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
885
|
+
/** @param {Object=} options */
|
|
886
|
+
function registerType(rawType, registeredInstance, options = {}) {
|
|
887
|
+
if (!('argPackAdvance' in registeredInstance)) {
|
|
888
|
+
throw new TypeError('registerType registeredInstance requires argPackAdvance');
|
|
889
|
+
}
|
|
890
|
+
return sharedRegisterType(rawType, registeredInstance, options);
|
|
891
|
+
}
|
|
892
|
+
var GenericWireTypeSize = 8;
|
|
893
|
+
/** @suppress {globalThis} */
|
|
894
|
+
var __embind_register_bool = (rawType, name, trueValue, falseValue) => {
|
|
1102
895
|
name = readLatin1String(name);
|
|
1103
896
|
registerType(rawType, {
|
|
1104
|
-
name
|
|
897
|
+
name,
|
|
1105
898
|
'fromWireType': function (wt) {
|
|
1106
899
|
// ambiguous emscripten ABI: sometimes return values are
|
|
1107
900
|
// true or false, and sometimes integers (0 or 1)
|
|
@@ -1110,49 +903,14 @@ var Module = (() => {
|
|
|
1110
903
|
'toWireType': function (destructors, o) {
|
|
1111
904
|
return o ? trueValue : falseValue;
|
|
1112
905
|
},
|
|
1113
|
-
'argPackAdvance':
|
|
906
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
1114
907
|
'readValueFromPointer': function (pointer) {
|
|
1115
|
-
|
|
1116
|
-
var heap;
|
|
1117
|
-
if (size === 1) {
|
|
1118
|
-
heap = HEAP8;
|
|
1119
|
-
}
|
|
1120
|
-
else if (size === 2) {
|
|
1121
|
-
heap = HEAP16;
|
|
1122
|
-
}
|
|
1123
|
-
else if (size === 4) {
|
|
1124
|
-
heap = HEAP32;
|
|
1125
|
-
}
|
|
1126
|
-
else {
|
|
1127
|
-
throw new TypeError("Unknown boolean type size: " + name);
|
|
1128
|
-
}
|
|
1129
|
-
return this['fromWireType'](heap[pointer >> shift]);
|
|
908
|
+
return this['fromWireType'](HEAPU8[pointer]);
|
|
1130
909
|
},
|
|
1131
910
|
destructorFunction: null, // This type does not need a destructor
|
|
1132
911
|
});
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
if (!(this instanceof ClassHandle)) {
|
|
1136
|
-
return false;
|
|
1137
|
-
}
|
|
1138
|
-
if (!(other instanceof ClassHandle)) {
|
|
1139
|
-
return false;
|
|
1140
|
-
}
|
|
1141
|
-
var leftClass = this.$$.ptrType.registeredClass;
|
|
1142
|
-
var left = this.$$.ptr;
|
|
1143
|
-
var rightClass = other.$$.ptrType.registeredClass;
|
|
1144
|
-
var right = other.$$.ptr;
|
|
1145
|
-
while (leftClass.baseClass) {
|
|
1146
|
-
left = leftClass.upcast(left);
|
|
1147
|
-
leftClass = leftClass.baseClass;
|
|
1148
|
-
}
|
|
1149
|
-
while (rightClass.baseClass) {
|
|
1150
|
-
right = rightClass.upcast(right);
|
|
1151
|
-
rightClass = rightClass.baseClass;
|
|
1152
|
-
}
|
|
1153
|
-
return leftClass === rightClass && left === right;
|
|
1154
|
-
}
|
|
1155
|
-
function shallowCopyInternalPointer(o) {
|
|
912
|
+
};
|
|
913
|
+
var shallowCopyInternalPointer = (o) => {
|
|
1156
914
|
return {
|
|
1157
915
|
count: o.count,
|
|
1158
916
|
deleteScheduled: o.deleteScheduled,
|
|
@@ -1162,31 +920,31 @@ var Module = (() => {
|
|
|
1162
920
|
smartPtr: o.smartPtr,
|
|
1163
921
|
smartPtrType: o.smartPtrType,
|
|
1164
922
|
};
|
|
1165
|
-
}
|
|
1166
|
-
|
|
923
|
+
};
|
|
924
|
+
var throwInstanceAlreadyDeleted = (obj) => {
|
|
1167
925
|
function getInstanceTypeName(handle) {
|
|
1168
926
|
return handle.$$.ptrType.registeredClass.name;
|
|
1169
927
|
}
|
|
1170
928
|
throwBindingError(getInstanceTypeName(obj) + ' instance already deleted');
|
|
1171
|
-
}
|
|
929
|
+
};
|
|
1172
930
|
var finalizationRegistry = false;
|
|
1173
|
-
|
|
1174
|
-
|
|
931
|
+
var detachFinalizer = (handle) => { };
|
|
932
|
+
var runDestructor = ($$) => {
|
|
1175
933
|
if ($$.smartPtr) {
|
|
1176
934
|
$$.smartPtrType.rawDestructor($$.smartPtr);
|
|
1177
935
|
}
|
|
1178
936
|
else {
|
|
1179
937
|
$$.ptrType.registeredClass.rawDestructor($$.ptr);
|
|
1180
938
|
}
|
|
1181
|
-
}
|
|
1182
|
-
|
|
939
|
+
};
|
|
940
|
+
var releaseClassHandle = ($$) => {
|
|
1183
941
|
$$.count.value -= 1;
|
|
1184
942
|
var toDelete = 0 === $$.count.value;
|
|
1185
943
|
if (toDelete) {
|
|
1186
944
|
runDestructor($$);
|
|
1187
945
|
}
|
|
1188
|
-
}
|
|
1189
|
-
|
|
946
|
+
};
|
|
947
|
+
var downcastPointer = (ptr, ptrClass, desiredClass) => {
|
|
1190
948
|
if (ptrClass === desiredClass) {
|
|
1191
949
|
return ptr;
|
|
1192
950
|
}
|
|
@@ -1198,12 +956,12 @@ var Module = (() => {
|
|
|
1198
956
|
return null;
|
|
1199
957
|
}
|
|
1200
958
|
return desiredClass.downcast(rv);
|
|
1201
|
-
}
|
|
959
|
+
};
|
|
1202
960
|
var registeredPointers = {};
|
|
1203
|
-
|
|
961
|
+
var getInheritedInstanceCount = () => {
|
|
1204
962
|
return Object.keys(registeredInstances).length;
|
|
1205
|
-
}
|
|
1206
|
-
|
|
963
|
+
};
|
|
964
|
+
var getLiveInheritedInstances = () => {
|
|
1207
965
|
var rv = [];
|
|
1208
966
|
for (var k in registeredInstances) {
|
|
1209
967
|
if (registeredInstances.hasOwnProperty(k)) {
|
|
@@ -1211,30 +969,30 @@ var Module = (() => {
|
|
|
1211
969
|
}
|
|
1212
970
|
}
|
|
1213
971
|
return rv;
|
|
1214
|
-
}
|
|
972
|
+
};
|
|
1215
973
|
var deletionQueue = [];
|
|
1216
|
-
|
|
974
|
+
var flushPendingDeletes = () => {
|
|
1217
975
|
while (deletionQueue.length) {
|
|
1218
976
|
var obj = deletionQueue.pop();
|
|
1219
977
|
obj.$$.deleteScheduled = false;
|
|
1220
978
|
obj['delete']();
|
|
1221
979
|
}
|
|
1222
|
-
}
|
|
1223
|
-
var delayFunction
|
|
1224
|
-
|
|
980
|
+
};
|
|
981
|
+
var delayFunction;
|
|
982
|
+
var setDelayFunction = (fn) => {
|
|
1225
983
|
delayFunction = fn;
|
|
1226
984
|
if (deletionQueue.length && delayFunction) {
|
|
1227
985
|
delayFunction(flushPendingDeletes);
|
|
1228
986
|
}
|
|
1229
|
-
}
|
|
1230
|
-
|
|
987
|
+
};
|
|
988
|
+
var init_embind = () => {
|
|
1231
989
|
Module['getInheritedInstanceCount'] = getInheritedInstanceCount;
|
|
1232
990
|
Module['getLiveInheritedInstances'] = getLiveInheritedInstances;
|
|
1233
991
|
Module['flushPendingDeletes'] = flushPendingDeletes;
|
|
1234
992
|
Module['setDelayFunction'] = setDelayFunction;
|
|
1235
|
-
}
|
|
993
|
+
};
|
|
1236
994
|
var registeredInstances = {};
|
|
1237
|
-
|
|
995
|
+
var getBasestPointer = (class_, ptr) => {
|
|
1238
996
|
if (ptr === undefined) {
|
|
1239
997
|
throwBindingError('ptr should not be undefined');
|
|
1240
998
|
}
|
|
@@ -1243,12 +1001,12 @@ var Module = (() => {
|
|
|
1243
1001
|
class_ = class_.baseClass;
|
|
1244
1002
|
}
|
|
1245
1003
|
return ptr;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1004
|
+
};
|
|
1005
|
+
var getInheritedInstance = (class_, ptr) => {
|
|
1248
1006
|
ptr = getBasestPointer(class_, ptr);
|
|
1249
1007
|
return registeredInstances[ptr];
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1008
|
+
};
|
|
1009
|
+
var makeClassHandle = (prototype, record) => {
|
|
1252
1010
|
if (!record.ptrType || !record.ptr) {
|
|
1253
1011
|
throwInternalError('makeClassHandle requires ptr and ptrType');
|
|
1254
1012
|
}
|
|
@@ -1263,7 +1021,8 @@ var Module = (() => {
|
|
|
1263
1021
|
value: record,
|
|
1264
1022
|
},
|
|
1265
1023
|
}));
|
|
1266
|
-
}
|
|
1024
|
+
};
|
|
1025
|
+
/** @suppress {globalThis} */
|
|
1267
1026
|
function RegisteredPointer_fromWireType(ptr) {
|
|
1268
1027
|
// ptr is a raw pointer (or a raw smartpointer)
|
|
1269
1028
|
// rawPointer is a maybe-null raw pointer
|
|
@@ -1300,7 +1059,7 @@ var Module = (() => {
|
|
|
1300
1059
|
else {
|
|
1301
1060
|
return makeClassHandle(this.registeredClass.instancePrototype, {
|
|
1302
1061
|
ptrType: this,
|
|
1303
|
-
ptr
|
|
1062
|
+
ptr,
|
|
1304
1063
|
});
|
|
1305
1064
|
}
|
|
1306
1065
|
}
|
|
@@ -1335,7 +1094,7 @@ var Module = (() => {
|
|
|
1335
1094
|
});
|
|
1336
1095
|
}
|
|
1337
1096
|
}
|
|
1338
|
-
|
|
1097
|
+
var attachFinalizer = (handle) => {
|
|
1339
1098
|
if ('undefined' === typeof FinalizationRegistry) {
|
|
1340
1099
|
attachFinalizer = (handle) => handle;
|
|
1341
1100
|
return handle;
|
|
@@ -1359,74 +1118,117 @@ var Module = (() => {
|
|
|
1359
1118
|
};
|
|
1360
1119
|
detachFinalizer = (handle) => finalizationRegistry.unregister(handle);
|
|
1361
1120
|
return attachFinalizer(handle);
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
this.$$.count.value += 1;
|
|
1369
|
-
return this;
|
|
1370
|
-
}
|
|
1371
|
-
else {
|
|
1372
|
-
var clone = attachFinalizer(Object.create(Object.getPrototypeOf(this), {
|
|
1373
|
-
$$: {
|
|
1374
|
-
value: shallowCopyInternalPointer(this.$$),
|
|
1121
|
+
};
|
|
1122
|
+
var init_ClassHandle = () => {
|
|
1123
|
+
Object.assign(ClassHandle.prototype, {
|
|
1124
|
+
"isAliasOf"(other) {
|
|
1125
|
+
if (!(this instanceof ClassHandle)) {
|
|
1126
|
+
return false;
|
|
1375
1127
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1128
|
+
if (!(other instanceof ClassHandle)) {
|
|
1129
|
+
return false;
|
|
1130
|
+
}
|
|
1131
|
+
var leftClass = this.$$.ptrType.registeredClass;
|
|
1132
|
+
var left = this.$$.ptr;
|
|
1133
|
+
other.$$ = /** @type {Object} */ (other.$$);
|
|
1134
|
+
var rightClass = other.$$.ptrType.registeredClass;
|
|
1135
|
+
var right = other.$$.ptr;
|
|
1136
|
+
while (leftClass.baseClass) {
|
|
1137
|
+
left = leftClass.upcast(left);
|
|
1138
|
+
leftClass = leftClass.baseClass;
|
|
1139
|
+
}
|
|
1140
|
+
while (rightClass.baseClass) {
|
|
1141
|
+
right = rightClass.upcast(right);
|
|
1142
|
+
rightClass = rightClass.baseClass;
|
|
1143
|
+
}
|
|
1144
|
+
return leftClass === rightClass && left === right;
|
|
1145
|
+
},
|
|
1146
|
+
"clone"() {
|
|
1147
|
+
if (!this.$$.ptr) {
|
|
1148
|
+
throwInstanceAlreadyDeleted(this);
|
|
1149
|
+
}
|
|
1150
|
+
if (this.$$.preservePointerOnDelete) {
|
|
1151
|
+
this.$$.count.value += 1;
|
|
1152
|
+
return this;
|
|
1153
|
+
}
|
|
1154
|
+
else {
|
|
1155
|
+
var clone = attachFinalizer(Object.create(Object.getPrototypeOf(this), {
|
|
1156
|
+
$$: {
|
|
1157
|
+
value: shallowCopyInternalPointer(this.$$),
|
|
1158
|
+
}
|
|
1159
|
+
}));
|
|
1160
|
+
clone.$$.count.value += 1;
|
|
1161
|
+
clone.$$.deleteScheduled = false;
|
|
1162
|
+
return clone;
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
"delete"() {
|
|
1166
|
+
if (!this.$$.ptr) {
|
|
1167
|
+
throwInstanceAlreadyDeleted(this);
|
|
1168
|
+
}
|
|
1169
|
+
if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
|
|
1170
|
+
throwBindingError('Object already scheduled for deletion');
|
|
1171
|
+
}
|
|
1172
|
+
detachFinalizer(this);
|
|
1173
|
+
releaseClassHandle(this.$$);
|
|
1174
|
+
if (!this.$$.preservePointerOnDelete) {
|
|
1175
|
+
this.$$.smartPtr = undefined;
|
|
1176
|
+
this.$$.ptr = undefined;
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
"isDeleted"() {
|
|
1180
|
+
return !this.$$.ptr;
|
|
1181
|
+
},
|
|
1182
|
+
"deleteLater"() {
|
|
1183
|
+
if (!this.$$.ptr) {
|
|
1184
|
+
throwInstanceAlreadyDeleted(this);
|
|
1185
|
+
}
|
|
1186
|
+
if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {
|
|
1187
|
+
throwBindingError('Object already scheduled for deletion');
|
|
1188
|
+
}
|
|
1189
|
+
deletionQueue.push(this);
|
|
1190
|
+
if (deletionQueue.length === 1 && delayFunction) {
|
|
1191
|
+
delayFunction(flushPendingDeletes);
|
|
1192
|
+
}
|
|
1193
|
+
this.$$.deleteScheduled = true;
|
|
1194
|
+
return this;
|
|
1195
|
+
},
|
|
1196
|
+
});
|
|
1197
|
+
};
|
|
1198
|
+
/** @constructor */
|
|
1199
|
+
function ClassHandle() {
|
|
1398
1200
|
}
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
throwBindingError('Object already scheduled for deletion');
|
|
1201
|
+
var char_0 = 48;
|
|
1202
|
+
var char_9 = 57;
|
|
1203
|
+
var makeLegalFunctionName = (name) => {
|
|
1204
|
+
if (undefined === name) {
|
|
1205
|
+
return '_unknown';
|
|
1405
1206
|
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1207
|
+
name = name.replace(/[^a-zA-Z0-9_]/g, '$');
|
|
1208
|
+
var f = name.charCodeAt(0);
|
|
1209
|
+
if (f >= char_0 && f <= char_9) {
|
|
1210
|
+
return `_${name}`;
|
|
1409
1211
|
}
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1212
|
+
return name;
|
|
1213
|
+
};
|
|
1214
|
+
function createNamedFunction(name, body) {
|
|
1215
|
+
name = makeLegalFunctionName(name);
|
|
1216
|
+
// Use an abject with a computed property name to create a new function with
|
|
1217
|
+
// a name specified at runtime, but without using `new Function` or `eval`.
|
|
1218
|
+
return {
|
|
1219
|
+
[name]: function () {
|
|
1220
|
+
return body.apply(this, arguments);
|
|
1221
|
+
}
|
|
1222
|
+
}[name];
|
|
1421
1223
|
}
|
|
1422
|
-
|
|
1224
|
+
var ensureOverloadTable = (proto, methodName, humanName) => {
|
|
1423
1225
|
if (undefined === proto[methodName].overloadTable) {
|
|
1424
1226
|
var prevFunc = proto[methodName];
|
|
1425
1227
|
// Inject an overload resolver function that routes to the appropriate overload based on the number of arguments.
|
|
1426
1228
|
proto[methodName] = function () {
|
|
1427
1229
|
// TODO This check can be removed in -O3 level "unsafe" optimizations.
|
|
1428
1230
|
if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) {
|
|
1429
|
-
throwBindingError(
|
|
1231
|
+
throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${arguments.length}) - expects one of (${proto[methodName].overloadTable})!`);
|
|
1430
1232
|
}
|
|
1431
1233
|
return proto[methodName].overloadTable[arguments.length].apply(this, arguments);
|
|
1432
1234
|
};
|
|
@@ -1434,18 +1236,18 @@ var Module = (() => {
|
|
|
1434
1236
|
proto[methodName].overloadTable = [];
|
|
1435
1237
|
proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;
|
|
1436
1238
|
}
|
|
1437
|
-
}
|
|
1239
|
+
};
|
|
1438
1240
|
/** @param {number=} numArguments */
|
|
1439
|
-
|
|
1241
|
+
var exposePublicSymbol = (name, value, numArguments) => {
|
|
1440
1242
|
if (Module.hasOwnProperty(name)) {
|
|
1441
1243
|
if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) {
|
|
1442
|
-
throwBindingError(
|
|
1244
|
+
throwBindingError(`Cannot register public name '${name}' twice`);
|
|
1443
1245
|
}
|
|
1444
1246
|
// We are exposing a function with the same name as an existing function. Create an overload table and a function selector
|
|
1445
1247
|
// that routes between the two.
|
|
1446
1248
|
ensureOverloadTable(Module, name, name);
|
|
1447
1249
|
if (Module.hasOwnProperty(numArguments)) {
|
|
1448
|
-
throwBindingError(
|
|
1250
|
+
throwBindingError(`Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`);
|
|
1449
1251
|
}
|
|
1450
1252
|
// Add the new function into the overload table.
|
|
1451
1253
|
Module[name].overloadTable[numArguments] = value;
|
|
@@ -1456,7 +1258,7 @@ var Module = (() => {
|
|
|
1456
1258
|
Module[name].numArguments = numArguments;
|
|
1457
1259
|
}
|
|
1458
1260
|
}
|
|
1459
|
-
}
|
|
1261
|
+
};
|
|
1460
1262
|
/** @constructor */
|
|
1461
1263
|
function RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast) {
|
|
1462
1264
|
this.name = name;
|
|
@@ -1469,38 +1271,40 @@ var Module = (() => {
|
|
|
1469
1271
|
this.downcast = downcast;
|
|
1470
1272
|
this.pureVirtualFunctions = [];
|
|
1471
1273
|
}
|
|
1472
|
-
|
|
1274
|
+
var upcastPointer = (ptr, ptrClass, desiredClass) => {
|
|
1473
1275
|
while (ptrClass !== desiredClass) {
|
|
1474
1276
|
if (!ptrClass.upcast) {
|
|
1475
|
-
throwBindingError(
|
|
1277
|
+
throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`);
|
|
1476
1278
|
}
|
|
1477
1279
|
ptr = ptrClass.upcast(ptr);
|
|
1478
1280
|
ptrClass = ptrClass.baseClass;
|
|
1479
1281
|
}
|
|
1480
1282
|
return ptr;
|
|
1481
|
-
}
|
|
1283
|
+
};
|
|
1284
|
+
/** @suppress {globalThis} */
|
|
1482
1285
|
function constNoSmartPtrRawPointerToWireType(destructors, handle) {
|
|
1483
1286
|
if (handle === null) {
|
|
1484
1287
|
if (this.isReference) {
|
|
1485
|
-
throwBindingError(
|
|
1288
|
+
throwBindingError(`null is not a valid ${this.name}`);
|
|
1486
1289
|
}
|
|
1487
1290
|
return 0;
|
|
1488
1291
|
}
|
|
1489
1292
|
if (!handle.$$) {
|
|
1490
|
-
throwBindingError(
|
|
1293
|
+
throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`);
|
|
1491
1294
|
}
|
|
1492
1295
|
if (!handle.$$.ptr) {
|
|
1493
|
-
throwBindingError(
|
|
1296
|
+
throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
1494
1297
|
}
|
|
1495
1298
|
var handleClass = handle.$$.ptrType.registeredClass;
|
|
1496
1299
|
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
1497
1300
|
return ptr;
|
|
1498
1301
|
}
|
|
1302
|
+
/** @suppress {globalThis} */
|
|
1499
1303
|
function genericPointerToWireType(destructors, handle) {
|
|
1500
1304
|
var ptr;
|
|
1501
1305
|
if (handle === null) {
|
|
1502
1306
|
if (this.isReference) {
|
|
1503
|
-
throwBindingError(
|
|
1307
|
+
throwBindingError(`null is not a valid ${this.name}`);
|
|
1504
1308
|
}
|
|
1505
1309
|
if (this.isSmartPointer) {
|
|
1506
1310
|
ptr = this.rawConstructor();
|
|
@@ -1514,13 +1318,13 @@ var Module = (() => {
|
|
|
1514
1318
|
}
|
|
1515
1319
|
}
|
|
1516
1320
|
if (!handle.$$) {
|
|
1517
|
-
throwBindingError(
|
|
1321
|
+
throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`);
|
|
1518
1322
|
}
|
|
1519
1323
|
if (!handle.$$.ptr) {
|
|
1520
|
-
throwBindingError(
|
|
1324
|
+
throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
1521
1325
|
}
|
|
1522
1326
|
if (!this.isConst && handle.$$.ptrType.isConst) {
|
|
1523
|
-
throwBindingError(
|
|
1327
|
+
throwBindingError(`Cannot convert argument of type ${(handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name)} to parameter type ${this.name}`);
|
|
1524
1328
|
}
|
|
1525
1329
|
var handleClass = handle.$$.ptrType.registeredClass;
|
|
1526
1330
|
ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
@@ -1538,7 +1342,7 @@ var Module = (() => {
|
|
|
1538
1342
|
ptr = handle.$$.smartPtr;
|
|
1539
1343
|
}
|
|
1540
1344
|
else {
|
|
1541
|
-
throwBindingError(
|
|
1345
|
+
throwBindingError(`Cannot convert argument of type ${(handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name)} to parameter type ${this.name}`);
|
|
1542
1346
|
}
|
|
1543
1347
|
break;
|
|
1544
1348
|
case 1: // INTRUSIVE
|
|
@@ -1550,9 +1354,7 @@ var Module = (() => {
|
|
|
1550
1354
|
}
|
|
1551
1355
|
else {
|
|
1552
1356
|
var clonedHandle = handle['clone']();
|
|
1553
|
-
ptr = this.rawShare(ptr, Emval.toHandle(
|
|
1554
|
-
clonedHandle['delete']();
|
|
1555
|
-
}));
|
|
1357
|
+
ptr = this.rawShare(ptr, Emval.toHandle(() => clonedHandle['delete']()));
|
|
1556
1358
|
if (destructors !== null) {
|
|
1557
1359
|
destructors.push(this.rawDestructor, ptr);
|
|
1558
1360
|
}
|
|
@@ -1564,50 +1366,54 @@ var Module = (() => {
|
|
|
1564
1366
|
}
|
|
1565
1367
|
return ptr;
|
|
1566
1368
|
}
|
|
1369
|
+
/** @suppress {globalThis} */
|
|
1567
1370
|
function nonConstNoSmartPtrRawPointerToWireType(destructors, handle) {
|
|
1568
1371
|
if (handle === null) {
|
|
1569
1372
|
if (this.isReference) {
|
|
1570
|
-
throwBindingError(
|
|
1373
|
+
throwBindingError(`null is not a valid ${this.name}`);
|
|
1571
1374
|
}
|
|
1572
1375
|
return 0;
|
|
1573
1376
|
}
|
|
1574
1377
|
if (!handle.$$) {
|
|
1575
|
-
throwBindingError(
|
|
1378
|
+
throwBindingError(`Cannot pass "${embindRepr(handle)}" as a ${this.name}`);
|
|
1576
1379
|
}
|
|
1577
1380
|
if (!handle.$$.ptr) {
|
|
1578
|
-
throwBindingError(
|
|
1381
|
+
throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
1579
1382
|
}
|
|
1580
1383
|
if (handle.$$.ptrType.isConst) {
|
|
1581
|
-
throwBindingError(
|
|
1384
|
+
throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`);
|
|
1582
1385
|
}
|
|
1583
1386
|
var handleClass = handle.$$.ptrType.registeredClass;
|
|
1584
1387
|
var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);
|
|
1585
1388
|
return ptr;
|
|
1586
1389
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
}
|
|
1591
|
-
return ptr;
|
|
1592
|
-
}
|
|
1593
|
-
function RegisteredPointer_destructor(ptr) {
|
|
1594
|
-
if (this.rawDestructor) {
|
|
1595
|
-
this.rawDestructor(ptr);
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
function RegisteredPointer_deleteObject(handle) {
|
|
1599
|
-
if (handle !== null) {
|
|
1600
|
-
handle['delete']();
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
function init_RegisteredPointer() {
|
|
1604
|
-
RegisteredPointer.prototype.getPointee = RegisteredPointer_getPointee;
|
|
1605
|
-
RegisteredPointer.prototype.destructor = RegisteredPointer_destructor;
|
|
1606
|
-
RegisteredPointer.prototype['argPackAdvance'] = 8;
|
|
1607
|
-
RegisteredPointer.prototype['readValueFromPointer'] = simpleReadValueFromPointer;
|
|
1608
|
-
RegisteredPointer.prototype['deleteObject'] = RegisteredPointer_deleteObject;
|
|
1609
|
-
RegisteredPointer.prototype['fromWireType'] = RegisteredPointer_fromWireType;
|
|
1390
|
+
/** @suppress {globalThis} */
|
|
1391
|
+
function readPointer(pointer) {
|
|
1392
|
+
return this['fromWireType'](HEAPU32[((pointer) >> 2)]);
|
|
1610
1393
|
}
|
|
1394
|
+
var init_RegisteredPointer = () => {
|
|
1395
|
+
Object.assign(RegisteredPointer.prototype, {
|
|
1396
|
+
getPointee(ptr) {
|
|
1397
|
+
if (this.rawGetPointee) {
|
|
1398
|
+
ptr = this.rawGetPointee(ptr);
|
|
1399
|
+
}
|
|
1400
|
+
return ptr;
|
|
1401
|
+
},
|
|
1402
|
+
destructor(ptr) {
|
|
1403
|
+
if (this.rawDestructor) {
|
|
1404
|
+
this.rawDestructor(ptr);
|
|
1405
|
+
}
|
|
1406
|
+
},
|
|
1407
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
1408
|
+
'readValueFromPointer': readPointer,
|
|
1409
|
+
'deleteObject'(handle) {
|
|
1410
|
+
if (handle !== null) {
|
|
1411
|
+
handle['delete']();
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
'fromWireType': RegisteredPointer_fromWireType,
|
|
1415
|
+
});
|
|
1416
|
+
};
|
|
1611
1417
|
/** @constructor
|
|
1612
1418
|
@param {*=} pointeeType,
|
|
1613
1419
|
@param {*=} sharingPolicy,
|
|
@@ -1650,7 +1456,7 @@ var Module = (() => {
|
|
|
1650
1456
|
}
|
|
1651
1457
|
}
|
|
1652
1458
|
/** @param {number=} numArguments */
|
|
1653
|
-
|
|
1459
|
+
var replacePublicSymbol = (name, value, numArguments) => {
|
|
1654
1460
|
if (!Module.hasOwnProperty(name)) {
|
|
1655
1461
|
throwInternalError('Replacing nonexistant public symbol');
|
|
1656
1462
|
}
|
|
@@ -1662,13 +1468,14 @@ var Module = (() => {
|
|
|
1662
1468
|
Module[name] = value;
|
|
1663
1469
|
Module[name].argCount = numArguments;
|
|
1664
1470
|
}
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1471
|
+
};
|
|
1472
|
+
var dynCallLegacy = (sig, ptr, args) => {
|
|
1667
1473
|
var f = Module['dynCall_' + sig];
|
|
1668
1474
|
return args && args.length ? f.apply(null, [ptr].concat(args)) : f.call(null, ptr);
|
|
1669
|
-
}
|
|
1475
|
+
};
|
|
1670
1476
|
var wasmTableMirror = [];
|
|
1671
|
-
|
|
1477
|
+
var wasmTable;
|
|
1478
|
+
var getWasmTableEntry = (funcPtr) => {
|
|
1672
1479
|
var func = wasmTableMirror[funcPtr];
|
|
1673
1480
|
if (!func) {
|
|
1674
1481
|
if (funcPtr >= wasmTableMirror.length)
|
|
@@ -1676,9 +1483,9 @@ var Module = (() => {
|
|
|
1676
1483
|
wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);
|
|
1677
1484
|
}
|
|
1678
1485
|
return func;
|
|
1679
|
-
}
|
|
1486
|
+
};
|
|
1680
1487
|
/** @param {Object=} args */
|
|
1681
|
-
|
|
1488
|
+
var dynCall = (sig, ptr, args) => {
|
|
1682
1489
|
// Without WASM_BIGINT support we cannot directly call function with i64 as
|
|
1683
1490
|
// part of thier signature, so we rely the dynCall functions generated by
|
|
1684
1491
|
// wasm-emscripten-finalize
|
|
@@ -1687,37 +1494,59 @@ var Module = (() => {
|
|
|
1687
1494
|
}
|
|
1688
1495
|
var rtn = getWasmTableEntry(ptr).apply(null, args);
|
|
1689
1496
|
return rtn;
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1497
|
+
};
|
|
1498
|
+
var getDynCaller = (sig, ptr) => {
|
|
1692
1499
|
var argCache = [];
|
|
1693
1500
|
return function () {
|
|
1694
1501
|
argCache.length = 0;
|
|
1695
1502
|
Object.assign(argCache, arguments);
|
|
1696
1503
|
return dynCall(sig, ptr, argCache);
|
|
1697
1504
|
};
|
|
1698
|
-
}
|
|
1699
|
-
|
|
1505
|
+
};
|
|
1506
|
+
var embind__requireFunction = (signature, rawFunction) => {
|
|
1700
1507
|
signature = readLatin1String(signature);
|
|
1701
1508
|
function makeDynCaller() {
|
|
1702
1509
|
if (signature.includes('j')) {
|
|
1703
1510
|
return getDynCaller(signature, rawFunction);
|
|
1704
1511
|
}
|
|
1705
|
-
return getWasmTableEntry(rawFunction);
|
|
1706
|
-
}
|
|
1707
|
-
var fp = makeDynCaller();
|
|
1708
|
-
if (typeof fp != "function") {
|
|
1709
|
-
throwBindingError(
|
|
1710
|
-
}
|
|
1711
|
-
return fp;
|
|
1712
|
-
}
|
|
1713
|
-
var
|
|
1714
|
-
|
|
1512
|
+
return getWasmTableEntry(rawFunction);
|
|
1513
|
+
}
|
|
1514
|
+
var fp = makeDynCaller();
|
|
1515
|
+
if (typeof fp != "function") {
|
|
1516
|
+
throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`);
|
|
1517
|
+
}
|
|
1518
|
+
return fp;
|
|
1519
|
+
};
|
|
1520
|
+
var extendError = (baseErrorType, errorName) => {
|
|
1521
|
+
var errorClass = createNamedFunction(errorName, function (message) {
|
|
1522
|
+
this.name = errorName;
|
|
1523
|
+
this.message = message;
|
|
1524
|
+
var stack = (new Error(message)).stack;
|
|
1525
|
+
if (stack !== undefined) {
|
|
1526
|
+
this.stack = this.toString() + '\n' +
|
|
1527
|
+
stack.replace(/^Error(:[^\n]*)?\n/, '');
|
|
1528
|
+
}
|
|
1529
|
+
});
|
|
1530
|
+
errorClass.prototype = Object.create(baseErrorType.prototype);
|
|
1531
|
+
errorClass.prototype.constructor = errorClass;
|
|
1532
|
+
errorClass.prototype.toString = function () {
|
|
1533
|
+
if (this.message === undefined) {
|
|
1534
|
+
return this.name;
|
|
1535
|
+
}
|
|
1536
|
+
else {
|
|
1537
|
+
return `${this.name}: ${this.message}`;
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
return errorClass;
|
|
1541
|
+
};
|
|
1542
|
+
var UnboundTypeError;
|
|
1543
|
+
var getTypeName = (type) => {
|
|
1715
1544
|
var ptr = ___getTypeName(type);
|
|
1716
1545
|
var rv = readLatin1String(ptr);
|
|
1717
1546
|
_free(ptr);
|
|
1718
1547
|
return rv;
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1548
|
+
};
|
|
1549
|
+
var throwUnboundTypeError = (message, types) => {
|
|
1721
1550
|
var unboundTypes = [];
|
|
1722
1551
|
var seen = {};
|
|
1723
1552
|
function visit(type) {
|
|
@@ -1735,9 +1564,9 @@ var Module = (() => {
|
|
|
1735
1564
|
seen[type] = true;
|
|
1736
1565
|
}
|
|
1737
1566
|
types.forEach(visit);
|
|
1738
|
-
throw new UnboundTypeError(message
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1567
|
+
throw new UnboundTypeError(`${message}: ` + unboundTypes.map(getTypeName).join([', ']));
|
|
1568
|
+
};
|
|
1569
|
+
var __embind_register_class = (rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name, destructorSignature, rawDestructor) => {
|
|
1741
1570
|
name = readLatin1String(name);
|
|
1742
1571
|
getActualType = embind__requireFunction(getActualTypeSignature, getActualType);
|
|
1743
1572
|
if (upcast) {
|
|
@@ -1750,7 +1579,7 @@ var Module = (() => {
|
|
|
1750
1579
|
var legalFunctionName = makeLegalFunctionName(name);
|
|
1751
1580
|
exposePublicSymbol(legalFunctionName, function () {
|
|
1752
1581
|
// this code cannot run if baseClassRawType is zero
|
|
1753
|
-
throwUnboundTypeError(
|
|
1582
|
+
throwUnboundTypeError(`Cannot construct ${name} due to unbound types`, [baseClassRawType]);
|
|
1754
1583
|
});
|
|
1755
1584
|
whenDependentTypesAreResolved([rawType, rawPointerType, rawConstPointerType], baseClassRawType ? [baseClassRawType] : [], function (base) {
|
|
1756
1585
|
base = base[0];
|
|
@@ -1772,7 +1601,7 @@ var Module = (() => {
|
|
|
1772
1601
|
}
|
|
1773
1602
|
var body = registeredClass.constructor_body[arguments.length];
|
|
1774
1603
|
if (undefined === body) {
|
|
1775
|
-
throw new BindingError(
|
|
1604
|
+
throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`);
|
|
1776
1605
|
}
|
|
1777
1606
|
return body.apply(this, arguments);
|
|
1778
1607
|
});
|
|
@@ -1781,6 +1610,13 @@ var Module = (() => {
|
|
|
1781
1610
|
});
|
|
1782
1611
|
constructor.prototype = instancePrototype;
|
|
1783
1612
|
var registeredClass = new RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast);
|
|
1613
|
+
if (registeredClass.baseClass) {
|
|
1614
|
+
// Keep track of class hierarchy. Used to allow sub-classes to inherit class functions.
|
|
1615
|
+
if (registeredClass.baseClass.__derivedClasses === undefined) {
|
|
1616
|
+
registeredClass.baseClass.__derivedClasses = [];
|
|
1617
|
+
}
|
|
1618
|
+
registeredClass.baseClass.__derivedClasses.push(registeredClass);
|
|
1619
|
+
}
|
|
1784
1620
|
var referenceConverter = new RegisteredPointer(name, registeredClass, true, false, false);
|
|
1785
1621
|
var pointerConverter = new RegisteredPointer(name + '*', registeredClass, false, false, false);
|
|
1786
1622
|
var constPointerConverter = new RegisteredPointer(name + ' const*', registeredClass, false, true, false);
|
|
@@ -1791,8 +1627,8 @@ var Module = (() => {
|
|
|
1791
1627
|
replacePublicSymbol(legalFunctionName, constructor);
|
|
1792
1628
|
return [referenceConverter, pointerConverter, constPointerConverter];
|
|
1793
1629
|
});
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1630
|
+
};
|
|
1631
|
+
var heap32VectorToArray = (count, firstElement) => {
|
|
1796
1632
|
var array = [];
|
|
1797
1633
|
for (var i = 0; i < count; i++) {
|
|
1798
1634
|
// TODO(https://github.com/emscripten-core/emscripten/issues/17310):
|
|
@@ -1800,10 +1636,10 @@ var Module = (() => {
|
|
|
1800
1636
|
array.push(HEAPU32[(((firstElement) + (i * 4)) >> 2)]);
|
|
1801
1637
|
}
|
|
1802
1638
|
return array;
|
|
1803
|
-
}
|
|
1804
|
-
function
|
|
1639
|
+
};
|
|
1640
|
+
function newFunc(constructor, argumentList) {
|
|
1805
1641
|
if (!(constructor instanceof Function)) {
|
|
1806
|
-
throw new TypeError(
|
|
1642
|
+
throw new TypeError(`new_ called with constructor type ${typeof (constructor)} which is not a function`);
|
|
1807
1643
|
}
|
|
1808
1644
|
/*
|
|
1809
1645
|
* Previously, the following line was just:
|
|
@@ -1821,7 +1657,7 @@ var Module = (() => {
|
|
|
1821
1657
|
var r = constructor.apply(obj, argumentList);
|
|
1822
1658
|
return (r instanceof Object) ? r : obj;
|
|
1823
1659
|
}
|
|
1824
|
-
function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc, isAsync) {
|
|
1660
|
+
function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc, /** boolean= */ isAsync) {
|
|
1825
1661
|
// humanName: a human-readable string name for the function to be generated.
|
|
1826
1662
|
// argTypes: An array that contains the embind type objects for all types in the function signature.
|
|
1827
1663
|
// argTypes[0] is the type object for the function return value.
|
|
@@ -1830,6 +1666,7 @@ var Module = (() => {
|
|
|
1830
1666
|
// classType: The embind type object for the class to be bound, or null if this is not a method of a class.
|
|
1831
1667
|
// cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code.
|
|
1832
1668
|
// cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling.
|
|
1669
|
+
// isAsync: Optional. If true, returns an async function. Async bindings are only supported with JSPI.
|
|
1833
1670
|
var argCount = argTypes.length;
|
|
1834
1671
|
if (argCount < 2) {
|
|
1835
1672
|
throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
@@ -1856,10 +1693,11 @@ var Module = (() => {
|
|
|
1856
1693
|
argsList += (i !== 0 ? ", " : "") + "arg" + i;
|
|
1857
1694
|
argsListWired += (i !== 0 ? ", " : "") + "arg" + i + "Wired";
|
|
1858
1695
|
}
|
|
1859
|
-
var invokerFnBody =
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1696
|
+
var invokerFnBody = `
|
|
1697
|
+
return function ${makeLegalFunctionName(humanName)}(${argsList}) {
|
|
1698
|
+
if (arguments.length !== ${argCount - 2}) {
|
|
1699
|
+
throwBindingError('function ${humanName} called with ' + arguments.length + ' arguments, expected ${argCount - 2}');
|
|
1700
|
+
}`;
|
|
1863
1701
|
if (needsDestructorStack) {
|
|
1864
1702
|
invokerFnBody += "var destructors = [];\n";
|
|
1865
1703
|
}
|
|
@@ -1900,28 +1738,26 @@ var Module = (() => {
|
|
|
1900
1738
|
}
|
|
1901
1739
|
invokerFnBody += "}\n";
|
|
1902
1740
|
args1.push(invokerFnBody);
|
|
1903
|
-
|
|
1904
|
-
return invokerFunction;
|
|
1741
|
+
return newFunc(Function, args1).apply(null, args2);
|
|
1905
1742
|
}
|
|
1906
|
-
|
|
1907
|
-
assert(argCount > 0);
|
|
1743
|
+
var __embind_register_class_constructor = (rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) => {
|
|
1908
1744
|
var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
1909
1745
|
invoker = embind__requireFunction(invokerSignature, invoker);
|
|
1910
1746
|
var args = [rawConstructor];
|
|
1911
1747
|
var destructors = [];
|
|
1912
1748
|
whenDependentTypesAreResolved([], [rawClassType], function (classType) {
|
|
1913
1749
|
classType = classType[0];
|
|
1914
|
-
var humanName =
|
|
1750
|
+
var humanName = `constructor ${classType.name}`;
|
|
1915
1751
|
if (undefined === classType.registeredClass.constructor_body) {
|
|
1916
1752
|
classType.registeredClass.constructor_body = [];
|
|
1917
1753
|
}
|
|
1918
1754
|
if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) {
|
|
1919
|
-
throw new BindingError(
|
|
1755
|
+
throw new BindingError(`Cannot register multiple constructors with identical number of parameters (${argCount - 1}) for class '${classType.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
1920
1756
|
}
|
|
1921
1757
|
classType.registeredClass.constructor_body[argCount - 1] = () => {
|
|
1922
|
-
throwUnboundTypeError(
|
|
1758
|
+
throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`, rawArgTypes);
|
|
1923
1759
|
};
|
|
1924
|
-
whenDependentTypesAreResolved([], rawArgTypes,
|
|
1760
|
+
whenDependentTypesAreResolved([], rawArgTypes, (argTypes) => {
|
|
1925
1761
|
// Insert empty slot for context type (argTypes[1]).
|
|
1926
1762
|
argTypes.splice(1, 0, null);
|
|
1927
1763
|
classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor);
|
|
@@ -1929,48 +1765,44 @@ var Module = (() => {
|
|
|
1929
1765
|
});
|
|
1930
1766
|
return [];
|
|
1931
1767
|
});
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1768
|
+
};
|
|
1769
|
+
var validateThis = (this_, classType, humanName) => {
|
|
1934
1770
|
if (!(this_ instanceof Object)) {
|
|
1935
|
-
throwBindingError(humanName
|
|
1771
|
+
throwBindingError(`${humanName} with invalid "this": ${this_}`);
|
|
1936
1772
|
}
|
|
1937
1773
|
if (!(this_ instanceof classType.registeredClass.constructor)) {
|
|
1938
|
-
throwBindingError(humanName
|
|
1774
|
+
throwBindingError(`${humanName} incompatible with "this" of type ${this_.constructor.name}`);
|
|
1939
1775
|
}
|
|
1940
1776
|
if (!this_.$$.ptr) {
|
|
1941
|
-
throwBindingError(
|
|
1777
|
+
throwBindingError(`cannot call emscripten binding method ${humanName} on deleted object`);
|
|
1942
1778
|
}
|
|
1943
1779
|
// todo: kill this
|
|
1944
1780
|
return upcastPointer(this_.$$.ptr, this_.$$.ptrType.registeredClass, classType.registeredClass);
|
|
1945
|
-
}
|
|
1946
|
-
|
|
1781
|
+
};
|
|
1782
|
+
var __embind_register_class_property = (classType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) => {
|
|
1947
1783
|
fieldName = readLatin1String(fieldName);
|
|
1948
1784
|
getter = embind__requireFunction(getterSignature, getter);
|
|
1949
1785
|
whenDependentTypesAreResolved([], [classType], function (classType) {
|
|
1950
1786
|
classType = classType[0];
|
|
1951
|
-
var humanName = classType.name
|
|
1787
|
+
var humanName = `${classType.name}.${fieldName}`;
|
|
1952
1788
|
var desc = {
|
|
1953
|
-
get
|
|
1954
|
-
throwUnboundTypeError(
|
|
1789
|
+
get() {
|
|
1790
|
+
throwUnboundTypeError(`Cannot access ${humanName} due to unbound types`, [getterReturnType, setterArgumentType]);
|
|
1955
1791
|
},
|
|
1956
1792
|
enumerable: true,
|
|
1957
1793
|
configurable: true
|
|
1958
1794
|
};
|
|
1959
1795
|
if (setter) {
|
|
1960
|
-
desc.set = () => {
|
|
1961
|
-
throwUnboundTypeError('Cannot access ' + humanName + ' due to unbound types', [getterReturnType, setterArgumentType]);
|
|
1962
|
-
};
|
|
1796
|
+
desc.set = () => throwUnboundTypeError(`Cannot access ${humanName} due to unbound types`, [getterReturnType, setterArgumentType]);
|
|
1963
1797
|
}
|
|
1964
1798
|
else {
|
|
1965
|
-
desc.set = (v) =>
|
|
1966
|
-
throwBindingError(humanName + ' is a read-only property');
|
|
1967
|
-
};
|
|
1799
|
+
desc.set = (v) => throwBindingError(humanName + ' is a read-only property');
|
|
1968
1800
|
}
|
|
1969
1801
|
Object.defineProperty(classType.registeredClass.instancePrototype, fieldName, desc);
|
|
1970
1802
|
whenDependentTypesAreResolved([], (setter ? [getterReturnType, setterArgumentType] : [getterReturnType]), function (types) {
|
|
1971
1803
|
var getterReturnType = types[0];
|
|
1972
1804
|
var desc = {
|
|
1973
|
-
get
|
|
1805
|
+
get() {
|
|
1974
1806
|
var ptr = validateThis(this, classType, humanName + ' getter');
|
|
1975
1807
|
return getterReturnType['fromWireType'](getter(getterContext, ptr));
|
|
1976
1808
|
},
|
|
@@ -1991,76 +1823,94 @@ var Module = (() => {
|
|
|
1991
1823
|
});
|
|
1992
1824
|
return [];
|
|
1993
1825
|
});
|
|
1826
|
+
};
|
|
1827
|
+
function handleAllocatorInit() {
|
|
1828
|
+
Object.assign(HandleAllocator.prototype, /** @lends {HandleAllocator.prototype} */ {
|
|
1829
|
+
get(id) {
|
|
1830
|
+
return this.allocated[id];
|
|
1831
|
+
},
|
|
1832
|
+
has(id) {
|
|
1833
|
+
return this.allocated[id] !== undefined;
|
|
1834
|
+
},
|
|
1835
|
+
allocate(handle) {
|
|
1836
|
+
var id = this.freelist.pop() || this.allocated.length;
|
|
1837
|
+
this.allocated[id] = handle;
|
|
1838
|
+
return id;
|
|
1839
|
+
},
|
|
1840
|
+
free(id) {
|
|
1841
|
+
// Set the slot to `undefined` rather than using `delete` here since
|
|
1842
|
+
// apparently arrays with holes in them can be less efficient.
|
|
1843
|
+
this.allocated[id] = undefined;
|
|
1844
|
+
this.freelist.push(id);
|
|
1845
|
+
}
|
|
1846
|
+
});
|
|
1994
1847
|
}
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
emval_free_list.push(handle);
|
|
2001
|
-
}
|
|
1848
|
+
/** @constructor */
|
|
1849
|
+
function HandleAllocator() {
|
|
1850
|
+
// Reserve slot 0 so that 0 is always an invalid handle
|
|
1851
|
+
this.allocated = [undefined];
|
|
1852
|
+
this.freelist = [];
|
|
2002
1853
|
}
|
|
2003
|
-
|
|
1854
|
+
var emval_handles = new HandleAllocator();
|
|
1855
|
+
;
|
|
1856
|
+
var __emval_decref = (handle) => {
|
|
1857
|
+
if (handle >= emval_handles.reserved && 0 === --emval_handles.get(handle).refcount) {
|
|
1858
|
+
emval_handles.free(handle);
|
|
1859
|
+
}
|
|
1860
|
+
};
|
|
1861
|
+
var count_emval_handles = () => {
|
|
2004
1862
|
var count = 0;
|
|
2005
|
-
for (var i =
|
|
2006
|
-
if (
|
|
1863
|
+
for (var i = emval_handles.reserved; i < emval_handles.allocated.length; ++i) {
|
|
1864
|
+
if (emval_handles.allocated[i] !== undefined) {
|
|
2007
1865
|
++count;
|
|
2008
1866
|
}
|
|
2009
1867
|
}
|
|
2010
1868
|
return count;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
}
|
|
2018
|
-
return null;
|
|
2019
|
-
}
|
|
2020
|
-
function init_emval() {
|
|
1869
|
+
};
|
|
1870
|
+
var init_emval = () => {
|
|
1871
|
+
// reserve some special values. These never get de-allocated.
|
|
1872
|
+
// The HandleAllocator takes care of reserving zero.
|
|
1873
|
+
emval_handles.allocated.push({ value: undefined }, { value: null }, { value: true }, { value: false });
|
|
1874
|
+
emval_handles.reserved = emval_handles.allocated.length;
|
|
2021
1875
|
Module['count_emval_handles'] = count_emval_handles;
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
1876
|
+
};
|
|
1877
|
+
var Emval = {
|
|
1878
|
+
toValue: (handle) => {
|
|
2025
1879
|
if (!handle) {
|
|
2026
1880
|
throwBindingError('Cannot use deleted val. handle = ' + handle);
|
|
2027
1881
|
}
|
|
2028
|
-
return
|
|
2029
|
-
},
|
|
1882
|
+
return emval_handles.get(handle).value;
|
|
1883
|
+
},
|
|
1884
|
+
toHandle: (value) => {
|
|
2030
1885
|
switch (value) {
|
|
2031
1886
|
case undefined: return 1;
|
|
2032
1887
|
case null: return 2;
|
|
2033
1888
|
case true: return 3;
|
|
2034
1889
|
case false: return 4;
|
|
2035
1890
|
default: {
|
|
2036
|
-
|
|
2037
|
-
emval_free_list.pop() :
|
|
2038
|
-
emval_handle_array.length;
|
|
2039
|
-
emval_handle_array[handle] = { refcount: 1, value: value };
|
|
2040
|
-
return handle;
|
|
1891
|
+
return emval_handles.allocate({ refcount: 1, value: value });
|
|
2041
1892
|
}
|
|
2042
1893
|
}
|
|
2043
|
-
}
|
|
2044
|
-
|
|
1894
|
+
},
|
|
1895
|
+
};
|
|
1896
|
+
var __embind_register_emval = (rawType, name) => {
|
|
2045
1897
|
name = readLatin1String(name);
|
|
2046
1898
|
registerType(rawType, {
|
|
2047
|
-
name
|
|
2048
|
-
'fromWireType':
|
|
1899
|
+
name,
|
|
1900
|
+
'fromWireType': (handle) => {
|
|
2049
1901
|
var rv = Emval.toValue(handle);
|
|
2050
1902
|
__emval_decref(handle);
|
|
2051
1903
|
return rv;
|
|
2052
1904
|
},
|
|
2053
|
-
'toWireType':
|
|
2054
|
-
|
|
2055
|
-
},
|
|
2056
|
-
'argPackAdvance': 8,
|
|
1905
|
+
'toWireType': (destructors, value) => Emval.toHandle(value),
|
|
1906
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
2057
1907
|
'readValueFromPointer': simpleReadValueFromPointer,
|
|
2058
1908
|
destructorFunction: null, // This type does not need a destructor
|
|
2059
1909
|
// TODO: do we need a deleteObject here? write a test where
|
|
2060
1910
|
// emval is passed into JS via an interface
|
|
2061
1911
|
});
|
|
2062
|
-
}
|
|
2063
|
-
|
|
1912
|
+
};
|
|
1913
|
+
var embindRepr = (v) => {
|
|
2064
1914
|
if (v === null) {
|
|
2065
1915
|
return 'null';
|
|
2066
1916
|
}
|
|
@@ -2071,74 +1921,71 @@ var Module = (() => {
|
|
|
2071
1921
|
else {
|
|
2072
1922
|
return '' + v;
|
|
2073
1923
|
}
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
switch (
|
|
2077
|
-
case
|
|
2078
|
-
return this['fromWireType'](HEAPF32[pointer >> 2]);
|
|
1924
|
+
};
|
|
1925
|
+
var floatReadValueFromPointer = (name, width) => {
|
|
1926
|
+
switch (width) {
|
|
1927
|
+
case 4: return function (pointer) {
|
|
1928
|
+
return this['fromWireType'](HEAPF32[((pointer) >> 2)]);
|
|
2079
1929
|
};
|
|
2080
|
-
case
|
|
2081
|
-
return this['fromWireType'](HEAPF64[pointer >> 3]);
|
|
1930
|
+
case 8: return function (pointer) {
|
|
1931
|
+
return this['fromWireType'](HEAPF64[((pointer) >> 3)]);
|
|
2082
1932
|
};
|
|
2083
1933
|
default:
|
|
2084
|
-
throw new TypeError(
|
|
1934
|
+
throw new TypeError(`invalid float width (${width}): ${name}`);
|
|
2085
1935
|
}
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
var shift = getShiftFromSize(size);
|
|
1936
|
+
};
|
|
1937
|
+
var __embind_register_float = (rawType, name, size) => {
|
|
2089
1938
|
name = readLatin1String(name);
|
|
2090
1939
|
registerType(rawType, {
|
|
2091
|
-
name
|
|
2092
|
-
'fromWireType':
|
|
2093
|
-
|
|
2094
|
-
},
|
|
2095
|
-
'toWireType': function (destructors, value) {
|
|
1940
|
+
name,
|
|
1941
|
+
'fromWireType': (value) => value,
|
|
1942
|
+
'toWireType': (destructors, value) => {
|
|
2096
1943
|
// The VM will perform JS to Wasm value conversion, according to the spec:
|
|
2097
1944
|
// https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
|
|
2098
1945
|
return value;
|
|
2099
1946
|
},
|
|
2100
|
-
'argPackAdvance':
|
|
2101
|
-
'readValueFromPointer': floatReadValueFromPointer(name,
|
|
1947
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
1948
|
+
'readValueFromPointer': floatReadValueFromPointer(name, size),
|
|
2102
1949
|
destructorFunction: null, // This type does not need a destructor
|
|
2103
1950
|
});
|
|
2104
|
-
}
|
|
2105
|
-
|
|
1951
|
+
};
|
|
1952
|
+
var __embind_register_function = (name, argCount, rawArgTypesAddr, signature, rawInvoker, fn, isAsync) => {
|
|
2106
1953
|
var argTypes = heap32VectorToArray(argCount, rawArgTypesAddr);
|
|
2107
1954
|
name = readLatin1String(name);
|
|
2108
1955
|
rawInvoker = embind__requireFunction(signature, rawInvoker);
|
|
2109
1956
|
exposePublicSymbol(name, function () {
|
|
2110
|
-
throwUnboundTypeError(
|
|
1957
|
+
throwUnboundTypeError(`Cannot call ${name} due to unbound types`, argTypes);
|
|
2111
1958
|
}, argCount - 1);
|
|
2112
1959
|
whenDependentTypesAreResolved([], argTypes, function (argTypes) {
|
|
2113
1960
|
var invokerArgsArray = [argTypes[0] /* return value */, null /* no class 'this'*/].concat(argTypes.slice(1) /* actual params */);
|
|
2114
1961
|
replacePublicSymbol(name, craftInvokerFunction(name, invokerArgsArray, null /* no class 'this'*/, rawInvoker, fn, isAsync), argCount - 1);
|
|
2115
1962
|
return [];
|
|
2116
1963
|
});
|
|
2117
|
-
}
|
|
2118
|
-
|
|
1964
|
+
};
|
|
1965
|
+
var integerReadValueFromPointer = (name, width, signed) => {
|
|
2119
1966
|
// integers are quite common, so generate very specialized functions
|
|
2120
|
-
switch (
|
|
2121
|
-
case 0: return signed ?
|
|
2122
|
-
function readS8FromPointer(pointer) { return HEAP8[pointer]; } :
|
|
2123
|
-
function readU8FromPointer(pointer) { return HEAPU8[pointer]; };
|
|
1967
|
+
switch (width) {
|
|
2124
1968
|
case 1: return signed ?
|
|
2125
|
-
|
|
2126
|
-
|
|
1969
|
+
(pointer) => HEAP8[((pointer) >> 0)] :
|
|
1970
|
+
(pointer) => HEAPU8[((pointer) >> 0)];
|
|
2127
1971
|
case 2: return signed ?
|
|
2128
|
-
|
|
2129
|
-
|
|
1972
|
+
(pointer) => HEAP16[((pointer) >> 1)] :
|
|
1973
|
+
(pointer) => HEAPU16[((pointer) >> 1)];
|
|
1974
|
+
case 4: return signed ?
|
|
1975
|
+
(pointer) => HEAP32[((pointer) >> 2)] :
|
|
1976
|
+
(pointer) => HEAPU32[((pointer) >> 2)];
|
|
2130
1977
|
default:
|
|
2131
|
-
throw new TypeError(
|
|
1978
|
+
throw new TypeError(`invalid integer width (${width}): ${name}`);
|
|
2132
1979
|
}
|
|
2133
|
-
}
|
|
2134
|
-
|
|
1980
|
+
};
|
|
1981
|
+
/** @suppress {globalThis} */
|
|
1982
|
+
var __embind_register_integer = (primitiveType, name, size, minRange, maxRange) => {
|
|
2135
1983
|
name = readLatin1String(name);
|
|
2136
1984
|
// LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come
|
|
2137
1985
|
// out as 'i32 -1'. Always treat those as max u32.
|
|
2138
1986
|
if (maxRange === -1) {
|
|
2139
1987
|
maxRange = 4294967295;
|
|
2140
1988
|
}
|
|
2141
|
-
var shift = getShiftFromSize(size);
|
|
2142
1989
|
var fromWireType = (value) => value;
|
|
2143
1990
|
if (minRange === 0) {
|
|
2144
1991
|
var bitshift = 32 - 8 * size;
|
|
@@ -2163,15 +2010,15 @@ var Module = (() => {
|
|
|
2163
2010
|
};
|
|
2164
2011
|
}
|
|
2165
2012
|
registerType(primitiveType, {
|
|
2166
|
-
name
|
|
2013
|
+
name,
|
|
2167
2014
|
'fromWireType': fromWireType,
|
|
2168
2015
|
'toWireType': toWireType,
|
|
2169
|
-
'argPackAdvance':
|
|
2170
|
-
'readValueFromPointer': integerReadValueFromPointer(name,
|
|
2016
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
2017
|
+
'readValueFromPointer': integerReadValueFromPointer(name, size, minRange !== 0),
|
|
2171
2018
|
destructorFunction: null, // This type does not need a destructor
|
|
2172
2019
|
});
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2020
|
+
};
|
|
2021
|
+
var __embind_register_memory_view = (rawType, dataTypeIndex, name) => {
|
|
2175
2022
|
var typeMapping = [
|
|
2176
2023
|
Int8Array,
|
|
2177
2024
|
Uint8Array,
|
|
@@ -2184,30 +2031,108 @@ var Module = (() => {
|
|
|
2184
2031
|
];
|
|
2185
2032
|
var TA = typeMapping[dataTypeIndex];
|
|
2186
2033
|
function decodeMemoryView(handle) {
|
|
2187
|
-
|
|
2188
|
-
var
|
|
2189
|
-
|
|
2190
|
-
var data = heap[handle + 1]; // byte offset into emscripten heap
|
|
2191
|
-
return new TA(heap.buffer, data, size);
|
|
2034
|
+
var size = HEAPU32[((handle) >> 2)];
|
|
2035
|
+
var data = HEAPU32[(((handle) + (4)) >> 2)];
|
|
2036
|
+
return new TA(HEAP8.buffer, data, size);
|
|
2192
2037
|
}
|
|
2193
2038
|
name = readLatin1String(name);
|
|
2194
2039
|
registerType(rawType, {
|
|
2195
|
-
name
|
|
2040
|
+
name,
|
|
2196
2041
|
'fromWireType': decodeMemoryView,
|
|
2197
|
-
'argPackAdvance':
|
|
2042
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
2198
2043
|
'readValueFromPointer': decodeMemoryView,
|
|
2199
2044
|
}, {
|
|
2200
2045
|
ignoreDuplicateRegistrations: true,
|
|
2201
2046
|
});
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2047
|
+
};
|
|
2048
|
+
var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {
|
|
2049
|
+
// Parameter maxBytesToWrite is not optional. Negative values, 0, null,
|
|
2050
|
+
// undefined and false each don't write out any bytes.
|
|
2051
|
+
if (!(maxBytesToWrite > 0))
|
|
2052
|
+
return 0;
|
|
2053
|
+
var startIdx = outIdx;
|
|
2054
|
+
var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator.
|
|
2055
|
+
for (var i = 0; i < str.length; ++i) {
|
|
2056
|
+
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
|
|
2057
|
+
// unit, not a Unicode code point of the character! So decode
|
|
2058
|
+
// UTF16->UTF32->UTF8.
|
|
2059
|
+
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
2060
|
+
// For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description
|
|
2061
|
+
// and https://www.ietf.org/rfc/rfc2279.txt
|
|
2062
|
+
// and https://tools.ietf.org/html/rfc3629
|
|
2063
|
+
var u = str.charCodeAt(i); // possibly a lead surrogate
|
|
2064
|
+
if (u >= 0xD800 && u <= 0xDFFF) {
|
|
2065
|
+
var u1 = str.charCodeAt(++i);
|
|
2066
|
+
u = 0x10000 + ((u & 0x3FF) << 10) | (u1 & 0x3FF);
|
|
2067
|
+
}
|
|
2068
|
+
if (u <= 0x7F) {
|
|
2069
|
+
if (outIdx >= endIdx)
|
|
2070
|
+
break;
|
|
2071
|
+
heap[outIdx++] = u;
|
|
2072
|
+
}
|
|
2073
|
+
else if (u <= 0x7FF) {
|
|
2074
|
+
if (outIdx + 1 >= endIdx)
|
|
2075
|
+
break;
|
|
2076
|
+
heap[outIdx++] = 0xC0 | (u >> 6);
|
|
2077
|
+
heap[outIdx++] = 0x80 | (u & 63);
|
|
2078
|
+
}
|
|
2079
|
+
else if (u <= 0xFFFF) {
|
|
2080
|
+
if (outIdx + 2 >= endIdx)
|
|
2081
|
+
break;
|
|
2082
|
+
heap[outIdx++] = 0xE0 | (u >> 12);
|
|
2083
|
+
heap[outIdx++] = 0x80 | ((u >> 6) & 63);
|
|
2084
|
+
heap[outIdx++] = 0x80 | (u & 63);
|
|
2085
|
+
}
|
|
2086
|
+
else {
|
|
2087
|
+
if (outIdx + 3 >= endIdx)
|
|
2088
|
+
break;
|
|
2089
|
+
heap[outIdx++] = 0xF0 | (u >> 18);
|
|
2090
|
+
heap[outIdx++] = 0x80 | ((u >> 12) & 63);
|
|
2091
|
+
heap[outIdx++] = 0x80 | ((u >> 6) & 63);
|
|
2092
|
+
heap[outIdx++] = 0x80 | (u & 63);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
// Null-terminate the pointer to the buffer.
|
|
2096
|
+
heap[outIdx] = 0;
|
|
2097
|
+
return outIdx - startIdx;
|
|
2098
|
+
};
|
|
2099
|
+
var stringToUTF8 = (str, outPtr, maxBytesToWrite) => {
|
|
2100
|
+
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
2101
|
+
};
|
|
2102
|
+
var lengthBytesUTF8 = (str) => {
|
|
2103
|
+
var len = 0;
|
|
2104
|
+
for (var i = 0; i < str.length; ++i) {
|
|
2105
|
+
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code
|
|
2106
|
+
// unit, not a Unicode code point of the character! So decode
|
|
2107
|
+
// UTF16->UTF32->UTF8.
|
|
2108
|
+
// See http://unicode.org/faq/utf_bom.html#utf16-3
|
|
2109
|
+
var c = str.charCodeAt(i); // possibly a lead surrogate
|
|
2110
|
+
if (c <= 0x7F) {
|
|
2111
|
+
len++;
|
|
2112
|
+
}
|
|
2113
|
+
else if (c <= 0x7FF) {
|
|
2114
|
+
len += 2;
|
|
2115
|
+
}
|
|
2116
|
+
else if (c >= 0xD800 && c <= 0xDFFF) {
|
|
2117
|
+
len += 4;
|
|
2118
|
+
++i;
|
|
2119
|
+
}
|
|
2120
|
+
else {
|
|
2121
|
+
len += 3;
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
return len;
|
|
2125
|
+
};
|
|
2126
|
+
var __embind_register_std_string = (rawType, name) => {
|
|
2204
2127
|
name = readLatin1String(name);
|
|
2205
2128
|
var stdStringIsUTF8
|
|
2206
2129
|
//process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string<unsigned char>
|
|
2207
2130
|
= (name === "std::string");
|
|
2208
2131
|
registerType(rawType, {
|
|
2209
|
-
name
|
|
2210
|
-
|
|
2132
|
+
name,
|
|
2133
|
+
// For some method names we use string keys here since they are part of
|
|
2134
|
+
// the public/external API and/or used by the runtime-generated code.
|
|
2135
|
+
'fromWireType'(value) {
|
|
2211
2136
|
var length = HEAPU32[((value) >> 2)];
|
|
2212
2137
|
var payload = value + 4;
|
|
2213
2138
|
var str;
|
|
@@ -2240,7 +2165,7 @@ var Module = (() => {
|
|
|
2240
2165
|
_free(value);
|
|
2241
2166
|
return str;
|
|
2242
2167
|
},
|
|
2243
|
-
'toWireType'
|
|
2168
|
+
'toWireType'(destructors, value) {
|
|
2244
2169
|
if (value instanceof ArrayBuffer) {
|
|
2245
2170
|
value = new Uint8Array(value);
|
|
2246
2171
|
}
|
|
@@ -2284,14 +2209,16 @@ var Module = (() => {
|
|
|
2284
2209
|
}
|
|
2285
2210
|
return base;
|
|
2286
2211
|
},
|
|
2287
|
-
'argPackAdvance':
|
|
2288
|
-
'readValueFromPointer':
|
|
2289
|
-
destructorFunction
|
|
2212
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
2213
|
+
'readValueFromPointer': readPointer,
|
|
2214
|
+
destructorFunction(ptr) {
|
|
2215
|
+
_free(ptr);
|
|
2216
|
+
},
|
|
2290
2217
|
});
|
|
2291
|
-
}
|
|
2218
|
+
};
|
|
2292
2219
|
var UTF16Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf-16le') : undefined;
|
|
2293
2220
|
;
|
|
2294
|
-
|
|
2221
|
+
var UTF16ToString = (ptr, maxBytesToRead) => {
|
|
2295
2222
|
var endPtr = ptr;
|
|
2296
2223
|
// TextDecoder needs to know the byte length in advance, it doesn't stop on
|
|
2297
2224
|
// null terminator by itself.
|
|
@@ -2320,8 +2247,8 @@ var Module = (() => {
|
|
|
2320
2247
|
str += String.fromCharCode(codeUnit);
|
|
2321
2248
|
}
|
|
2322
2249
|
return str;
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2250
|
+
};
|
|
2251
|
+
var stringToUTF16 = (str, outPtr, maxBytesToWrite) => {
|
|
2325
2252
|
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
|
|
2326
2253
|
if (maxBytesToWrite === undefined) {
|
|
2327
2254
|
maxBytesToWrite = 0x7FFFFFFF;
|
|
@@ -2340,11 +2267,11 @@ var Module = (() => {
|
|
|
2340
2267
|
// Null-terminate the pointer to the HEAP.
|
|
2341
2268
|
HEAP16[((outPtr) >> 1)] = 0;
|
|
2342
2269
|
return outPtr - startPtr;
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2270
|
+
};
|
|
2271
|
+
var lengthBytesUTF16 = (str) => {
|
|
2345
2272
|
return str.length * 2;
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2273
|
+
};
|
|
2274
|
+
var UTF32ToString = (ptr, maxBytesToRead) => {
|
|
2348
2275
|
var i = 0;
|
|
2349
2276
|
var str = '';
|
|
2350
2277
|
// If maxBytesToRead is not passed explicitly, it will be undefined, and this
|
|
@@ -2365,8 +2292,8 @@ var Module = (() => {
|
|
|
2365
2292
|
}
|
|
2366
2293
|
}
|
|
2367
2294
|
return str;
|
|
2368
|
-
}
|
|
2369
|
-
|
|
2295
|
+
};
|
|
2296
|
+
var stringToUTF32 = (str, outPtr, maxBytesToWrite) => {
|
|
2370
2297
|
// Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed.
|
|
2371
2298
|
if (maxBytesToWrite === undefined) {
|
|
2372
2299
|
maxBytesToWrite = 0x7FFFFFFF;
|
|
@@ -2391,8 +2318,8 @@ var Module = (() => {
|
|
|
2391
2318
|
// Null-terminate the pointer to the HEAP.
|
|
2392
2319
|
HEAP32[((outPtr) >> 2)] = 0;
|
|
2393
2320
|
return outPtr - startPtr;
|
|
2394
|
-
}
|
|
2395
|
-
|
|
2321
|
+
};
|
|
2322
|
+
var lengthBytesUTF32 = (str) => {
|
|
2396
2323
|
var len = 0;
|
|
2397
2324
|
for (var i = 0; i < str.length; ++i) {
|
|
2398
2325
|
// Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap.
|
|
@@ -2403,8 +2330,8 @@ var Module = (() => {
|
|
|
2403
2330
|
len += 4;
|
|
2404
2331
|
}
|
|
2405
2332
|
return len;
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2333
|
+
};
|
|
2334
|
+
var __embind_register_std_wstring = (rawType, charSize, name) => {
|
|
2408
2335
|
name = readLatin1String(name);
|
|
2409
2336
|
var decodeString, encodeString, getHeap, lengthBytesUTF, shift;
|
|
2410
2337
|
if (charSize === 2) {
|
|
@@ -2422,10 +2349,10 @@ var Module = (() => {
|
|
|
2422
2349
|
shift = 2;
|
|
2423
2350
|
}
|
|
2424
2351
|
registerType(rawType, {
|
|
2425
|
-
name
|
|
2426
|
-
'fromWireType':
|
|
2352
|
+
name,
|
|
2353
|
+
'fromWireType': (value) => {
|
|
2427
2354
|
// Code mostly taken from _embind_register_std_string fromWireType
|
|
2428
|
-
var length = HEAPU32[value >> 2];
|
|
2355
|
+
var length = HEAPU32[((value) >> 2)];
|
|
2429
2356
|
var HEAP = getHeap();
|
|
2430
2357
|
var str;
|
|
2431
2358
|
var decodeStartPtr = value + 4;
|
|
@@ -2448,9 +2375,9 @@ var Module = (() => {
|
|
|
2448
2375
|
_free(value);
|
|
2449
2376
|
return str;
|
|
2450
2377
|
},
|
|
2451
|
-
'toWireType':
|
|
2378
|
+
'toWireType': (destructors, value) => {
|
|
2452
2379
|
if (!(typeof value == 'string')) {
|
|
2453
|
-
throwBindingError(
|
|
2380
|
+
throwBindingError(`Cannot pass non-string to C++ string type ${name}`);
|
|
2454
2381
|
}
|
|
2455
2382
|
// assumes 4-byte alignment
|
|
2456
2383
|
var length = lengthBytesUTF(value);
|
|
@@ -2462,94 +2389,92 @@ var Module = (() => {
|
|
|
2462
2389
|
}
|
|
2463
2390
|
return ptr;
|
|
2464
2391
|
},
|
|
2465
|
-
'argPackAdvance':
|
|
2392
|
+
'argPackAdvance': GenericWireTypeSize,
|
|
2466
2393
|
'readValueFromPointer': simpleReadValueFromPointer,
|
|
2467
|
-
destructorFunction
|
|
2394
|
+
destructorFunction(ptr) {
|
|
2395
|
+
_free(ptr);
|
|
2396
|
+
}
|
|
2468
2397
|
});
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2398
|
+
};
|
|
2399
|
+
var __embind_register_value_object = (rawType, name, constructorSignature, rawConstructor, destructorSignature, rawDestructor) => {
|
|
2471
2400
|
structRegistrations[rawType] = {
|
|
2472
2401
|
name: readLatin1String(name),
|
|
2473
2402
|
rawConstructor: embind__requireFunction(constructorSignature, rawConstructor),
|
|
2474
2403
|
rawDestructor: embind__requireFunction(destructorSignature, rawDestructor),
|
|
2475
2404
|
fields: [],
|
|
2476
2405
|
};
|
|
2477
|
-
}
|
|
2478
|
-
|
|
2406
|
+
};
|
|
2407
|
+
var __embind_register_value_object_field = (structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) => {
|
|
2479
2408
|
structRegistrations[structType].fields.push({
|
|
2480
2409
|
fieldName: readLatin1String(fieldName),
|
|
2481
|
-
getterReturnType
|
|
2410
|
+
getterReturnType,
|
|
2482
2411
|
getter: embind__requireFunction(getterSignature, getter),
|
|
2483
|
-
getterContext
|
|
2484
|
-
setterArgumentType
|
|
2412
|
+
getterContext,
|
|
2413
|
+
setterArgumentType,
|
|
2485
2414
|
setter: embind__requireFunction(setterSignature, setter),
|
|
2486
|
-
setterContext
|
|
2415
|
+
setterContext,
|
|
2487
2416
|
});
|
|
2488
|
-
}
|
|
2489
|
-
|
|
2417
|
+
};
|
|
2418
|
+
var __embind_register_void = (rawType, name) => {
|
|
2490
2419
|
name = readLatin1String(name);
|
|
2491
2420
|
registerType(rawType, {
|
|
2492
2421
|
isVoid: true,
|
|
2493
|
-
name
|
|
2422
|
+
name,
|
|
2494
2423
|
'argPackAdvance': 0,
|
|
2495
|
-
'fromWireType':
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
'toWireType': function (destructors, o) {
|
|
2499
|
-
// TODO: assert if anything else is given?
|
|
2500
|
-
return undefined;
|
|
2501
|
-
},
|
|
2424
|
+
'fromWireType': () => undefined,
|
|
2425
|
+
// TODO: assert if anything else is given?
|
|
2426
|
+
'toWireType': (destructors, o) => undefined,
|
|
2502
2427
|
});
|
|
2503
|
-
}
|
|
2504
|
-
|
|
2428
|
+
};
|
|
2429
|
+
var requireRegisteredType = (rawType, humanName) => {
|
|
2505
2430
|
var impl = registeredTypes[rawType];
|
|
2506
2431
|
if (undefined === impl) {
|
|
2507
2432
|
throwBindingError(humanName + " has unknown type " + getTypeName(rawType));
|
|
2508
2433
|
}
|
|
2509
2434
|
return impl;
|
|
2510
|
-
}
|
|
2511
|
-
|
|
2435
|
+
};
|
|
2436
|
+
var __emval_as = (handle, returnType, destructorsRef) => {
|
|
2512
2437
|
handle = Emval.toValue(handle);
|
|
2513
2438
|
returnType = requireRegisteredType(returnType, 'emval::as');
|
|
2514
2439
|
var destructors = [];
|
|
2515
2440
|
var rd = Emval.toHandle(destructors);
|
|
2516
2441
|
HEAPU32[((destructorsRef) >> 2)] = rd;
|
|
2517
2442
|
return returnType['toWireType'](destructors, handle);
|
|
2518
|
-
}
|
|
2519
|
-
|
|
2443
|
+
};
|
|
2444
|
+
var emval_allocateDestructors = (destructorsRef) => {
|
|
2520
2445
|
var destructors = [];
|
|
2521
2446
|
HEAPU32[((destructorsRef) >> 2)] = Emval.toHandle(destructors);
|
|
2522
2447
|
return destructors;
|
|
2523
|
-
}
|
|
2448
|
+
};
|
|
2524
2449
|
var emval_symbols = {};
|
|
2525
|
-
|
|
2450
|
+
var getStringOrSymbol = (address) => {
|
|
2526
2451
|
var symbol = emval_symbols[address];
|
|
2527
2452
|
if (symbol === undefined) {
|
|
2528
2453
|
return readLatin1String(address);
|
|
2529
2454
|
}
|
|
2530
2455
|
return symbol;
|
|
2531
|
-
}
|
|
2456
|
+
};
|
|
2532
2457
|
var emval_methodCallers = [];
|
|
2533
|
-
|
|
2458
|
+
var __emval_call_void_method = (caller, handle, methodName, args) => {
|
|
2534
2459
|
caller = emval_methodCallers[caller];
|
|
2535
2460
|
handle = Emval.toValue(handle);
|
|
2536
2461
|
methodName = getStringOrSymbol(methodName);
|
|
2537
2462
|
caller(handle, methodName, null, args);
|
|
2538
|
-
}
|
|
2539
|
-
|
|
2463
|
+
};
|
|
2464
|
+
var emval_addMethodCaller = (caller) => {
|
|
2540
2465
|
var id = emval_methodCallers.length;
|
|
2541
2466
|
emval_methodCallers.push(caller);
|
|
2542
2467
|
return id;
|
|
2543
|
-
}
|
|
2544
|
-
|
|
2468
|
+
};
|
|
2469
|
+
var emval_lookupTypes = (argCount, argTypes) => {
|
|
2545
2470
|
var a = new Array(argCount);
|
|
2546
2471
|
for (var i = 0; i < argCount; ++i) {
|
|
2547
2472
|
a[i] = requireRegisteredType(HEAPU32[(((argTypes) + (i * 4)) >> 2)], "parameter " + i);
|
|
2548
2473
|
}
|
|
2549
2474
|
return a;
|
|
2550
|
-
}
|
|
2551
|
-
var emval_registeredMethods =
|
|
2552
|
-
|
|
2475
|
+
};
|
|
2476
|
+
var emval_registeredMethods = {};
|
|
2477
|
+
var __emval_get_method_caller = (argCount, argTypes) => {
|
|
2553
2478
|
var types = emval_lookupTypes(argCount, argTypes);
|
|
2554
2479
|
var retType = types[0];
|
|
2555
2480
|
var signatureName = retType.name + "_$" + types.slice(1).map(function (t) { return t.name; }).join("_") + "$";
|
|
@@ -2588,55 +2513,53 @@ var Module = (() => {
|
|
|
2588
2513
|
functionBody +=
|
|
2589
2514
|
"};\n";
|
|
2590
2515
|
params.push(functionBody);
|
|
2591
|
-
var invokerFunction =
|
|
2516
|
+
var invokerFunction = newFunc(Function, params).apply(null, args);
|
|
2592
2517
|
returnId = emval_addMethodCaller(invokerFunction);
|
|
2593
2518
|
emval_registeredMethods[signatureName] = returnId;
|
|
2594
2519
|
return returnId;
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2520
|
+
};
|
|
2521
|
+
var __emval_get_property = (handle, key) => {
|
|
2597
2522
|
handle = Emval.toValue(handle);
|
|
2598
2523
|
key = Emval.toValue(key);
|
|
2599
2524
|
return Emval.toHandle(handle[key]);
|
|
2600
|
-
}
|
|
2601
|
-
|
|
2525
|
+
};
|
|
2526
|
+
var __emval_incref = (handle) => {
|
|
2602
2527
|
if (handle > 4) {
|
|
2603
|
-
|
|
2528
|
+
emval_handles.get(handle).refcount += 1;
|
|
2604
2529
|
}
|
|
2605
|
-
}
|
|
2606
|
-
|
|
2530
|
+
};
|
|
2531
|
+
var __emval_new_array = () => {
|
|
2607
2532
|
return Emval.toHandle([]);
|
|
2608
|
-
}
|
|
2609
|
-
|
|
2533
|
+
};
|
|
2534
|
+
var __emval_new_cstring = (v) => {
|
|
2610
2535
|
return Emval.toHandle(getStringOrSymbol(v));
|
|
2611
|
-
}
|
|
2612
|
-
|
|
2536
|
+
};
|
|
2537
|
+
var __emval_run_destructors = (handle) => {
|
|
2613
2538
|
var destructors = Emval.toValue(handle);
|
|
2614
2539
|
runDestructors(destructors);
|
|
2615
2540
|
__emval_decref(handle);
|
|
2616
|
-
}
|
|
2617
|
-
|
|
2541
|
+
};
|
|
2542
|
+
var __emval_take_value = (type, arg) => {
|
|
2618
2543
|
type = requireRegisteredType(type, '_emval_take_value');
|
|
2619
2544
|
var v = type['readValueFromPointer'](arg);
|
|
2620
2545
|
return Emval.toHandle(v);
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2546
|
+
};
|
|
2547
|
+
var _abort = () => {
|
|
2623
2548
|
abort('');
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
return 2147483648;
|
|
2634
|
-
}
|
|
2635
|
-
function emscripten_realloc_buffer(size) {
|
|
2549
|
+
};
|
|
2550
|
+
var _emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num);
|
|
2551
|
+
var getHeapMax = () =>
|
|
2552
|
+
// Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate
|
|
2553
|
+
// full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side
|
|
2554
|
+
// for any code that deals with heap sizes, which would require special
|
|
2555
|
+
// casing all heap size related code to treat 0 specially.
|
|
2556
|
+
2147483648;
|
|
2557
|
+
var growMemory = (size) => {
|
|
2636
2558
|
var b = wasmMemory.buffer;
|
|
2559
|
+
var pages = (size - b.byteLength + 65535) / 65536;
|
|
2637
2560
|
try {
|
|
2638
2561
|
// round size grow request up to wasm page size (fixed 64KB per spec)
|
|
2639
|
-
wasmMemory.grow(
|
|
2562
|
+
wasmMemory.grow(pages); // .grow() takes a delta compared to the previous size
|
|
2640
2563
|
updateMemoryViews();
|
|
2641
2564
|
return 1 /*success*/;
|
|
2642
2565
|
}
|
|
@@ -2644,10 +2567,11 @@ var Module = (() => {
|
|
|
2644
2567
|
}
|
|
2645
2568
|
// implicit 0 return to save code size (caller will cast "undefined" into 0
|
|
2646
2569
|
// anyhow)
|
|
2647
|
-
}
|
|
2648
|
-
|
|
2570
|
+
};
|
|
2571
|
+
var _emscripten_resize_heap = (requestedSize) => {
|
|
2649
2572
|
var oldSize = HEAPU8.length;
|
|
2650
|
-
|
|
2573
|
+
// With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.
|
|
2574
|
+
requestedSize >>>= 0;
|
|
2651
2575
|
// With multithreaded builds, races can happen (another thread might increase the size
|
|
2652
2576
|
// in between), so return a failure, and let the caller retry.
|
|
2653
2577
|
// Memory resize rules:
|
|
@@ -2672,7 +2596,7 @@ var Module = (() => {
|
|
|
2672
2596
|
if (requestedSize > maxHeapSize) {
|
|
2673
2597
|
return false;
|
|
2674
2598
|
}
|
|
2675
|
-
|
|
2599
|
+
var alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple;
|
|
2676
2600
|
// Loop through potential heap size increases. If we attempt a too eager
|
|
2677
2601
|
// reservation that fails, cut down on the attempted size and reserve a
|
|
2678
2602
|
// smaller bump instead. (max 3 times, chosen somewhat arbitrarily)
|
|
@@ -2681,18 +2605,18 @@ var Module = (() => {
|
|
|
2681
2605
|
// but limit overreserving (default to capping at +96MB overgrowth at most)
|
|
2682
2606
|
overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
|
|
2683
2607
|
var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
|
|
2684
|
-
var replacement =
|
|
2608
|
+
var replacement = growMemory(newSize);
|
|
2685
2609
|
if (replacement) {
|
|
2686
2610
|
return true;
|
|
2687
2611
|
}
|
|
2688
2612
|
}
|
|
2689
2613
|
return false;
|
|
2690
|
-
}
|
|
2614
|
+
};
|
|
2691
2615
|
var ENV = {};
|
|
2692
|
-
|
|
2616
|
+
var getExecutableName = () => {
|
|
2693
2617
|
return thisProgram || './this.program';
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2618
|
+
};
|
|
2619
|
+
var getEnvStrings = () => {
|
|
2696
2620
|
if (!getEnvStrings.strings) {
|
|
2697
2621
|
// Default values.
|
|
2698
2622
|
// Browser language detection #8751
|
|
@@ -2718,67 +2642,69 @@ var Module = (() => {
|
|
|
2718
2642
|
}
|
|
2719
2643
|
var strings = [];
|
|
2720
2644
|
for (var x in env) {
|
|
2721
|
-
strings.push(x
|
|
2645
|
+
strings.push(`${x}=${env[x]}`);
|
|
2722
2646
|
}
|
|
2723
2647
|
getEnvStrings.strings = strings;
|
|
2724
2648
|
}
|
|
2725
2649
|
return getEnvStrings.strings;
|
|
2726
|
-
}
|
|
2727
|
-
|
|
2728
|
-
function writeAsciiToMemory(str, buffer, dontAddNull) {
|
|
2650
|
+
};
|
|
2651
|
+
var stringToAscii = (str, buffer) => {
|
|
2729
2652
|
for (var i = 0; i < str.length; ++i) {
|
|
2730
2653
|
HEAP8[((buffer++) >> 0)] = str.charCodeAt(i);
|
|
2731
2654
|
}
|
|
2732
|
-
// Null-terminate the
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2655
|
+
// Null-terminate the string
|
|
2656
|
+
HEAP8[((buffer) >> 0)] = 0;
|
|
2657
|
+
};
|
|
2658
|
+
var SYSCALLS = {
|
|
2659
|
+
varargs: undefined,
|
|
2660
|
+
get() {
|
|
2661
|
+
// the `+` prepended here is necessary to convince the JSCompiler that varargs is indeed a number.
|
|
2662
|
+
var ret = HEAP32[((+SYSCALLS.varargs) >> 2)];
|
|
2737
2663
|
SYSCALLS.varargs += 4;
|
|
2738
|
-
var ret = HEAP32[(((SYSCALLS.varargs) - (4)) >> 2)];
|
|
2739
2664
|
return ret;
|
|
2740
|
-
},
|
|
2665
|
+
},
|
|
2666
|
+
getp() { return SYSCALLS.get(); },
|
|
2667
|
+
getStr(ptr) {
|
|
2741
2668
|
var ret = UTF8ToString(ptr);
|
|
2742
2669
|
return ret;
|
|
2743
|
-
}
|
|
2744
|
-
|
|
2670
|
+
},
|
|
2671
|
+
};
|
|
2672
|
+
var _environ_get = (__environ, environ_buf) => {
|
|
2745
2673
|
var bufSize = 0;
|
|
2746
|
-
getEnvStrings().forEach(
|
|
2674
|
+
getEnvStrings().forEach((string, i) => {
|
|
2747
2675
|
var ptr = environ_buf + bufSize;
|
|
2748
2676
|
HEAPU32[(((__environ) + (i * 4)) >> 2)] = ptr;
|
|
2749
|
-
|
|
2677
|
+
stringToAscii(string, ptr);
|
|
2750
2678
|
bufSize += string.length + 1;
|
|
2751
2679
|
});
|
|
2752
2680
|
return 0;
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2681
|
+
};
|
|
2682
|
+
var _environ_sizes_get = (penviron_count, penviron_buf_size) => {
|
|
2755
2683
|
var strings = getEnvStrings();
|
|
2756
2684
|
HEAPU32[((penviron_count) >> 2)] = strings.length;
|
|
2757
2685
|
var bufSize = 0;
|
|
2758
|
-
strings.forEach(
|
|
2759
|
-
bufSize += string.length + 1;
|
|
2760
|
-
});
|
|
2686
|
+
strings.forEach((string) => bufSize += string.length + 1);
|
|
2761
2687
|
HEAPU32[((penviron_buf_size) >> 2)] = bufSize;
|
|
2762
2688
|
return 0;
|
|
2763
|
-
}
|
|
2764
|
-
|
|
2689
|
+
};
|
|
2690
|
+
var isLeapYear = (year) => {
|
|
2765
2691
|
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
2766
|
-
}
|
|
2767
|
-
|
|
2692
|
+
};
|
|
2693
|
+
var arraySum = (array, index) => {
|
|
2768
2694
|
var sum = 0;
|
|
2769
2695
|
for (var i = 0; i <= index; sum += array[i++]) {
|
|
2770
2696
|
// no-op
|
|
2771
2697
|
}
|
|
2772
2698
|
return sum;
|
|
2773
|
-
}
|
|
2774
|
-
var
|
|
2775
|
-
var
|
|
2776
|
-
|
|
2699
|
+
};
|
|
2700
|
+
var MONTH_DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2701
|
+
var MONTH_DAYS_REGULAR = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2702
|
+
var addDays = (date, days) => {
|
|
2777
2703
|
var newDate = new Date(date.getTime());
|
|
2778
2704
|
while (days > 0) {
|
|
2779
|
-
var leap =
|
|
2705
|
+
var leap = isLeapYear(newDate.getFullYear());
|
|
2780
2706
|
var currentMonth = newDate.getMonth();
|
|
2781
|
-
var daysInCurrentMonth = (leap ?
|
|
2707
|
+
var daysInCurrentMonth = (leap ? MONTH_DAYS_LEAP : MONTH_DAYS_REGULAR)[currentMonth];
|
|
2782
2708
|
if (days > daysInCurrentMonth - newDate.getDate()) {
|
|
2783
2709
|
// we spill over to next month
|
|
2784
2710
|
days -= (daysInCurrentMonth - newDate.getDate() + 1);
|
|
@@ -2798,7 +2724,7 @@ var Module = (() => {
|
|
|
2798
2724
|
}
|
|
2799
2725
|
}
|
|
2800
2726
|
return newDate;
|
|
2801
|
-
}
|
|
2727
|
+
};
|
|
2802
2728
|
/** @type {function(string, boolean=, number=)} */
|
|
2803
2729
|
function intArrayFromString(stringy, dontAddNull, length) {
|
|
2804
2730
|
var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
|
|
@@ -2808,13 +2734,13 @@ var Module = (() => {
|
|
|
2808
2734
|
u8array.length = numBytesWritten;
|
|
2809
2735
|
return u8array;
|
|
2810
2736
|
}
|
|
2811
|
-
|
|
2737
|
+
var writeArrayToMemory = (array, buffer) => {
|
|
2812
2738
|
HEAP8.set(array, buffer);
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2739
|
+
};
|
|
2740
|
+
var _strftime = (s, maxsize, format, tm) => {
|
|
2815
2741
|
// size_t strftime(char *restrict s, size_t maxsize, const char *restrict format, const struct tm *restrict timeptr);
|
|
2816
2742
|
// http://pubs.opengroup.org/onlinepubs/009695399/functions/strftime.html
|
|
2817
|
-
var tm_zone =
|
|
2743
|
+
var tm_zone = HEAPU32[(((tm) + (40)) >> 2)];
|
|
2818
2744
|
var date = {
|
|
2819
2745
|
tm_sec: HEAP32[((tm) >> 2)],
|
|
2820
2746
|
tm_min: HEAP32[(((tm) + (4)) >> 2)],
|
|
@@ -2907,7 +2833,7 @@ var Module = (() => {
|
|
|
2907
2833
|
}
|
|
2908
2834
|
}
|
|
2909
2835
|
function getWeekBasedYear(date) {
|
|
2910
|
-
var thisDate =
|
|
2836
|
+
var thisDate = addDays(new Date(date.tm_year + 1900, 0, 1), date.tm_yday);
|
|
2911
2837
|
var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4);
|
|
2912
2838
|
var janFourthNextYear = new Date(thisDate.getFullYear() + 1, 0, 4);
|
|
2913
2839
|
var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear);
|
|
@@ -2922,29 +2848,17 @@ var Module = (() => {
|
|
|
2922
2848
|
return thisDate.getFullYear() - 1;
|
|
2923
2849
|
}
|
|
2924
2850
|
var EXPANSION_RULES_2 = {
|
|
2925
|
-
'%a':
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
'%
|
|
2929
|
-
|
|
2930
|
-
},
|
|
2931
|
-
'%b': function (date) {
|
|
2932
|
-
return MONTHS[date.tm_mon].substring(0, 3);
|
|
2933
|
-
},
|
|
2934
|
-
'%B': function (date) {
|
|
2935
|
-
return MONTHS[date.tm_mon];
|
|
2936
|
-
},
|
|
2937
|
-
'%C': function (date) {
|
|
2851
|
+
'%a': (date) => WEEKDAYS[date.tm_wday].substring(0, 3),
|
|
2852
|
+
'%A': (date) => WEEKDAYS[date.tm_wday],
|
|
2853
|
+
'%b': (date) => MONTHS[date.tm_mon].substring(0, 3),
|
|
2854
|
+
'%B': (date) => MONTHS[date.tm_mon],
|
|
2855
|
+
'%C': (date) => {
|
|
2938
2856
|
var year = date.tm_year + 1900;
|
|
2939
2857
|
return leadingNulls((year / 100) | 0, 2);
|
|
2940
2858
|
},
|
|
2941
|
-
'%d':
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
'%e': function (date) {
|
|
2945
|
-
return leadingSomething(date.tm_mday, 2, ' ');
|
|
2946
|
-
},
|
|
2947
|
-
'%g': function (date) {
|
|
2859
|
+
'%d': (date) => leadingNulls(date.tm_mday, 2),
|
|
2860
|
+
'%e': (date) => leadingSomething(date.tm_mday, 2, ' '),
|
|
2861
|
+
'%g': (date) => {
|
|
2948
2862
|
// %g, %G, and %V give values according to the ISO 8601:2000 standard week-based year.
|
|
2949
2863
|
// In this system, weeks begin on a Monday and week 1 of the year is the week that includes
|
|
2950
2864
|
// January 4th, which is also the week that includes the first Thursday of the year, and
|
|
@@ -2956,13 +2870,9 @@ var Module = (() => {
|
|
|
2956
2870
|
// Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and %V is replaced by 01.
|
|
2957
2871
|
return getWeekBasedYear(date).toString().substring(2);
|
|
2958
2872
|
},
|
|
2959
|
-
'%G':
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
'%H': function (date) {
|
|
2963
|
-
return leadingNulls(date.tm_hour, 2);
|
|
2964
|
-
},
|
|
2965
|
-
'%I': function (date) {
|
|
2873
|
+
'%G': (date) => getWeekBasedYear(date),
|
|
2874
|
+
'%H': (date) => leadingNulls(date.tm_hour, 2),
|
|
2875
|
+
'%I': (date) => {
|
|
2966
2876
|
var twelveHour = date.tm_hour;
|
|
2967
2877
|
if (twelveHour == 0)
|
|
2968
2878
|
twelveHour = 12;
|
|
@@ -2970,39 +2880,27 @@ var Module = (() => {
|
|
|
2970
2880
|
twelveHour -= 12;
|
|
2971
2881
|
return leadingNulls(twelveHour, 2);
|
|
2972
2882
|
},
|
|
2973
|
-
'%j':
|
|
2883
|
+
'%j': (date) => {
|
|
2974
2884
|
// Day of the year (001-366)
|
|
2975
|
-
return leadingNulls(date.tm_mday +
|
|
2976
|
-
},
|
|
2977
|
-
'%m': function (date) {
|
|
2978
|
-
return leadingNulls(date.tm_mon + 1, 2);
|
|
2979
|
-
},
|
|
2980
|
-
'%M': function (date) {
|
|
2981
|
-
return leadingNulls(date.tm_min, 2);
|
|
2982
|
-
},
|
|
2983
|
-
'%n': function () {
|
|
2984
|
-
return '\n';
|
|
2885
|
+
return leadingNulls(date.tm_mday + arraySum(isLeapYear(date.tm_year + 1900) ? MONTH_DAYS_LEAP : MONTH_DAYS_REGULAR, date.tm_mon - 1), 3);
|
|
2985
2886
|
},
|
|
2986
|
-
'%
|
|
2887
|
+
'%m': (date) => leadingNulls(date.tm_mon + 1, 2),
|
|
2888
|
+
'%M': (date) => leadingNulls(date.tm_min, 2),
|
|
2889
|
+
'%n': () => '\n',
|
|
2890
|
+
'%p': (date) => {
|
|
2987
2891
|
if (date.tm_hour >= 0 && date.tm_hour < 12) {
|
|
2988
2892
|
return 'AM';
|
|
2989
2893
|
}
|
|
2990
2894
|
return 'PM';
|
|
2991
2895
|
},
|
|
2992
|
-
'%S':
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
'%
|
|
2996
|
-
return '\t';
|
|
2997
|
-
},
|
|
2998
|
-
'%u': function (date) {
|
|
2999
|
-
return date.tm_wday || 7;
|
|
3000
|
-
},
|
|
3001
|
-
'%U': function (date) {
|
|
2896
|
+
'%S': (date) => leadingNulls(date.tm_sec, 2),
|
|
2897
|
+
'%t': () => '\t',
|
|
2898
|
+
'%u': (date) => date.tm_wday || 7,
|
|
2899
|
+
'%U': (date) => {
|
|
3002
2900
|
var days = date.tm_yday + 7 - date.tm_wday;
|
|
3003
2901
|
return leadingNulls(Math.floor(days / 7), 2);
|
|
3004
2902
|
},
|
|
3005
|
-
'%V':
|
|
2903
|
+
'%V': (date) => {
|
|
3006
2904
|
// Replaced by the week number of the year (Monday as the first day of the week)
|
|
3007
2905
|
// as a decimal number [01,53]. If the week containing 1 January has four
|
|
3008
2906
|
// or more days in the new year, then it is considered week 1.
|
|
@@ -3019,7 +2917,7 @@ var Module = (() => {
|
|
|
3019
2917
|
// If 31 December of prev year a Thursday, or Friday of a
|
|
3020
2918
|
// leap year, then the prev year has 53 weeks.
|
|
3021
2919
|
var dec31 = (date.tm_wday + 7 - date.tm_yday - 1) % 7;
|
|
3022
|
-
if (dec31 == 4 || (dec31 == 5 &&
|
|
2920
|
+
if (dec31 == 4 || (dec31 == 5 && isLeapYear(date.tm_year % 400 - 1))) {
|
|
3023
2921
|
val++;
|
|
3024
2922
|
}
|
|
3025
2923
|
}
|
|
@@ -3027,27 +2925,23 @@ var Module = (() => {
|
|
|
3027
2925
|
// If 1 January is not a Thursday, and not a Wednesday of a
|
|
3028
2926
|
// leap year, then this year has only 52 weeks.
|
|
3029
2927
|
var jan1 = (date.tm_wday + 371 - date.tm_yday) % 7;
|
|
3030
|
-
if (jan1 != 4 && (jan1 != 3 || !
|
|
2928
|
+
if (jan1 != 4 && (jan1 != 3 || !isLeapYear(date.tm_year)))
|
|
3031
2929
|
val = 1;
|
|
3032
2930
|
}
|
|
3033
2931
|
return leadingNulls(val, 2);
|
|
3034
2932
|
},
|
|
3035
|
-
'%w':
|
|
3036
|
-
|
|
3037
|
-
},
|
|
3038
|
-
'%W': function (date) {
|
|
2933
|
+
'%w': (date) => date.tm_wday,
|
|
2934
|
+
'%W': (date) => {
|
|
3039
2935
|
var days = date.tm_yday + 7 - ((date.tm_wday + 6) % 7);
|
|
3040
2936
|
return leadingNulls(Math.floor(days / 7), 2);
|
|
3041
2937
|
},
|
|
3042
|
-
'%y':
|
|
2938
|
+
'%y': (date) => {
|
|
3043
2939
|
// Replaced by the last two digits of the year as a decimal number [00,99]. [ tm_year]
|
|
3044
2940
|
return (date.tm_year + 1900).toString().substring(2);
|
|
3045
2941
|
},
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
},
|
|
3050
|
-
'%z': function (date) {
|
|
2942
|
+
// Replaced by the year as a decimal number (for example, 1997). [ tm_year]
|
|
2943
|
+
'%Y': (date) => date.tm_year + 1900,
|
|
2944
|
+
'%z': (date) => {
|
|
3051
2945
|
// Replaced by the offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ).
|
|
3052
2946
|
// For example, "-0430" means 4 hours 30 minutes behind UTC (west of Greenwich).
|
|
3053
2947
|
var off = date.tm_gmtoff;
|
|
@@ -3057,12 +2951,8 @@ var Module = (() => {
|
|
|
3057
2951
|
off = (off / 60) * 100 + (off % 60);
|
|
3058
2952
|
return (ahead ? '+' : '-') + String("0000" + off).slice(-4);
|
|
3059
2953
|
},
|
|
3060
|
-
'%Z':
|
|
3061
|
-
|
|
3062
|
-
},
|
|
3063
|
-
'%%': function () {
|
|
3064
|
-
return '%';
|
|
3065
|
-
}
|
|
2954
|
+
'%Z': (date) => date.tm_zone,
|
|
2955
|
+
'%%': () => '%'
|
|
3066
2956
|
};
|
|
3067
2957
|
// Replace %% with a pair of NULLs (which cannot occur in a C string), then
|
|
3068
2958
|
// re-inject them after processing.
|
|
@@ -3079,130 +2969,122 @@ var Module = (() => {
|
|
|
3079
2969
|
}
|
|
3080
2970
|
writeArrayToMemory(bytes, s);
|
|
3081
2971
|
return bytes.length - 1;
|
|
3082
|
-
}
|
|
3083
|
-
|
|
2972
|
+
};
|
|
2973
|
+
var _strftime_l = (s, maxsize, format, tm, loc) => {
|
|
3084
2974
|
return _strftime(s, maxsize, format, tm); // no locale support yet
|
|
3085
|
-
}
|
|
3086
|
-
InternalError = Module['InternalError'] =
|
|
3087
|
-
|
|
2975
|
+
};
|
|
2976
|
+
InternalError = Module['InternalError'] = class InternalError extends Error {
|
|
2977
|
+
constructor(message) { super(message); this.name = 'InternalError'; }
|
|
2978
|
+
};
|
|
3088
2979
|
embind_init_charCodes();
|
|
3089
|
-
BindingError = Module['BindingError'] =
|
|
3090
|
-
|
|
2980
|
+
BindingError = Module['BindingError'] = class BindingError extends Error {
|
|
2981
|
+
constructor(message) { super(message); this.name = 'BindingError'; }
|
|
2982
|
+
};
|
|
3091
2983
|
init_ClassHandle();
|
|
3092
2984
|
init_embind();
|
|
3093
2985
|
;
|
|
3094
2986
|
init_RegisteredPointer();
|
|
3095
2987
|
UnboundTypeError = Module['UnboundTypeError'] = extendError(Error, 'UnboundTypeError');
|
|
3096
2988
|
;
|
|
2989
|
+
handleAllocatorInit();
|
|
3097
2990
|
init_emval();
|
|
3098
2991
|
;
|
|
3099
2992
|
var wasmImports = {
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
var
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
var
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
var
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
var
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
var
|
|
3191
|
-
return (dynCall_iiiiij = Module["dynCall_iiiiij"] = Module["asm"]["dynCall_iiiiij"]).apply(null, arguments);
|
|
3192
|
-
};
|
|
3193
|
-
/** @type {function(...*):?} */
|
|
3194
|
-
var dynCall_iiiiijj = Module["dynCall_iiiiijj"] = function () {
|
|
3195
|
-
return (dynCall_iiiiijj = Module["dynCall_iiiiijj"] = Module["asm"]["dynCall_iiiiijj"]).apply(null, arguments);
|
|
3196
|
-
};
|
|
3197
|
-
/** @type {function(...*):?} */
|
|
3198
|
-
var dynCall_iiiiiijj = Module["dynCall_iiiiiijj"] = function () {
|
|
3199
|
-
return (dynCall_iiiiiijj = Module["dynCall_iiiiiijj"] = Module["asm"]["dynCall_iiiiiijj"]).apply(null, arguments);
|
|
3200
|
-
};
|
|
3201
|
-
var ___start_em_js = Module['___start_em_js'] = 59072;
|
|
3202
|
-
var ___stop_em_js = Module['___stop_em_js'] = 59768;
|
|
2993
|
+
/** @export */
|
|
2994
|
+
__assert_fail: ___assert_fail,
|
|
2995
|
+
/** @export */
|
|
2996
|
+
_embind_finalize_value_object: __embind_finalize_value_object,
|
|
2997
|
+
/** @export */
|
|
2998
|
+
_embind_register_bigint: __embind_register_bigint,
|
|
2999
|
+
/** @export */
|
|
3000
|
+
_embind_register_bool: __embind_register_bool,
|
|
3001
|
+
/** @export */
|
|
3002
|
+
_embind_register_class: __embind_register_class,
|
|
3003
|
+
/** @export */
|
|
3004
|
+
_embind_register_class_constructor: __embind_register_class_constructor,
|
|
3005
|
+
/** @export */
|
|
3006
|
+
_embind_register_class_property: __embind_register_class_property,
|
|
3007
|
+
/** @export */
|
|
3008
|
+
_embind_register_emval: __embind_register_emval,
|
|
3009
|
+
/** @export */
|
|
3010
|
+
_embind_register_float: __embind_register_float,
|
|
3011
|
+
/** @export */
|
|
3012
|
+
_embind_register_function: __embind_register_function,
|
|
3013
|
+
/** @export */
|
|
3014
|
+
_embind_register_integer: __embind_register_integer,
|
|
3015
|
+
/** @export */
|
|
3016
|
+
_embind_register_memory_view: __embind_register_memory_view,
|
|
3017
|
+
/** @export */
|
|
3018
|
+
_embind_register_std_string: __embind_register_std_string,
|
|
3019
|
+
/** @export */
|
|
3020
|
+
_embind_register_std_wstring: __embind_register_std_wstring,
|
|
3021
|
+
/** @export */
|
|
3022
|
+
_embind_register_value_object: __embind_register_value_object,
|
|
3023
|
+
/** @export */
|
|
3024
|
+
_embind_register_value_object_field: __embind_register_value_object_field,
|
|
3025
|
+
/** @export */
|
|
3026
|
+
_embind_register_void: __embind_register_void,
|
|
3027
|
+
/** @export */
|
|
3028
|
+
_emval_as: __emval_as,
|
|
3029
|
+
/** @export */
|
|
3030
|
+
_emval_call_void_method: __emval_call_void_method,
|
|
3031
|
+
/** @export */
|
|
3032
|
+
_emval_decref: __emval_decref,
|
|
3033
|
+
/** @export */
|
|
3034
|
+
_emval_get_method_caller: __emval_get_method_caller,
|
|
3035
|
+
/** @export */
|
|
3036
|
+
_emval_get_property: __emval_get_property,
|
|
3037
|
+
/** @export */
|
|
3038
|
+
_emval_incref: __emval_incref,
|
|
3039
|
+
/** @export */
|
|
3040
|
+
_emval_new_array: __emval_new_array,
|
|
3041
|
+
/** @export */
|
|
3042
|
+
_emval_new_cstring: __emval_new_cstring,
|
|
3043
|
+
/** @export */
|
|
3044
|
+
_emval_run_destructors: __emval_run_destructors,
|
|
3045
|
+
/** @export */
|
|
3046
|
+
_emval_take_value: __emval_take_value,
|
|
3047
|
+
/** @export */
|
|
3048
|
+
abort: _abort,
|
|
3049
|
+
/** @export */
|
|
3050
|
+
emscripten_memcpy_js: _emscripten_memcpy_js,
|
|
3051
|
+
/** @export */
|
|
3052
|
+
emscripten_resize_heap: _emscripten_resize_heap,
|
|
3053
|
+
/** @export */
|
|
3054
|
+
environ_get: _environ_get,
|
|
3055
|
+
/** @export */
|
|
3056
|
+
environ_sizes_get: _environ_sizes_get,
|
|
3057
|
+
/** @export */
|
|
3058
|
+
strftime_l: _strftime_l,
|
|
3059
|
+
/** @export */
|
|
3060
|
+
wasm_loadfileproc: wasm_loadfileproc,
|
|
3061
|
+
/** @export */
|
|
3062
|
+
wasm_msgproc: wasm_msgproc
|
|
3063
|
+
};
|
|
3064
|
+
var wasmExports = createWasm();
|
|
3065
|
+
var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports['__wasm_call_ctors'])();
|
|
3066
|
+
var _kmcmp_CompileKeyboard = Module['_kmcmp_CompileKeyboard'] = (a0, a1, a2, a3, a4, a5) => (_kmcmp_CompileKeyboard = Module['_kmcmp_CompileKeyboard'] = wasmExports['kmcmp_CompileKeyboard'])(a0, a1, a2, a3, a4, a5);
|
|
3067
|
+
var _kmcmp_parseUnicodeSet = Module['_kmcmp_parseUnicodeSet'] = (a0, a1, a2) => (_kmcmp_parseUnicodeSet = Module['_kmcmp_parseUnicodeSet'] = wasmExports['kmcmp_parseUnicodeSet'])(a0, a1, a2);
|
|
3068
|
+
var _malloc = (a0) => (_malloc = wasmExports['malloc'])(a0);
|
|
3069
|
+
var _free = (a0) => (_free = wasmExports['free'])(a0);
|
|
3070
|
+
var ___getTypeName = (a0) => (___getTypeName = wasmExports['__getTypeName'])(a0);
|
|
3071
|
+
var __embind_initialize_bindings = Module['__embind_initialize_bindings'] = () => (__embind_initialize_bindings = Module['__embind_initialize_bindings'] = wasmExports['_embind_initialize_bindings'])();
|
|
3072
|
+
var ___errno_location = () => (___errno_location = wasmExports['__errno_location'])();
|
|
3073
|
+
var ___trap = () => (___trap = wasmExports['__trap'])();
|
|
3074
|
+
var setTempRet0 = (a0) => (setTempRet0 = wasmExports['setTempRet0'])(a0);
|
|
3075
|
+
var stackSave = () => (stackSave = wasmExports['stackSave'])();
|
|
3076
|
+
var stackRestore = (a0) => (stackRestore = wasmExports['stackRestore'])(a0);
|
|
3077
|
+
var stackAlloc = (a0) => (stackAlloc = wasmExports['stackAlloc'])(a0);
|
|
3078
|
+
var dynCall_viijii = Module['dynCall_viijii'] = (a0, a1, a2, a3, a4, a5, a6) => (dynCall_viijii = Module['dynCall_viijii'] = wasmExports['dynCall_viijii'])(a0, a1, a2, a3, a4, a5, a6);
|
|
3079
|
+
var dynCall_iiiiij = Module['dynCall_iiiiij'] = (a0, a1, a2, a3, a4, a5, a6) => (dynCall_iiiiij = Module['dynCall_iiiiij'] = wasmExports['dynCall_iiiiij'])(a0, a1, a2, a3, a4, a5, a6);
|
|
3080
|
+
var dynCall_iiiiijj = Module['dynCall_iiiiijj'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8) => (dynCall_iiiiijj = Module['dynCall_iiiiijj'] = wasmExports['dynCall_iiiiijj'])(a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
|
3081
|
+
var dynCall_iiiiiijj = Module['dynCall_iiiiiijj'] = (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) => (dynCall_iiiiiijj = Module['dynCall_iiiiiijj'] = wasmExports['dynCall_iiiiiijj'])(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
|
3082
|
+
var ___start_em_js = Module['___start_em_js'] = 59184;
|
|
3083
|
+
var ___stop_em_js = Module['___stop_em_js'] = 59880;
|
|
3203
3084
|
// include: postamble.js
|
|
3204
3085
|
// === Auto-generated postamble setup entry stuff ===
|
|
3205
|
-
Module[
|
|
3086
|
+
Module['wasmExports'] = wasmExports;
|
|
3087
|
+
Module['UTF8ToString'] = UTF8ToString;
|
|
3206
3088
|
var calledRun;
|
|
3207
3089
|
dependenciesFulfilled = function runCaller() {
|
|
3208
3090
|
// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
|
|
@@ -3257,9 +3139,8 @@ var Module = (() => {
|
|
|
3257
3139
|
}
|
|
3258
3140
|
run();
|
|
3259
3141
|
// end include: postamble.js
|
|
3260
|
-
return
|
|
3142
|
+
return moduleArg.ready;
|
|
3261
3143
|
});
|
|
3262
3144
|
})();
|
|
3263
3145
|
export default Module;
|
|
3264
|
-
//# sourceMappingURL=wasm-host.js.map
|
|
3265
|
-
//# debugId=c211f816-44aa-5eab-8f12-fbd1b87e723f
|
|
3146
|
+
//# sourceMappingURL=wasm-host.js.map
|