funicular 0.4.0 → 0.5.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +429 -1
- data/demo/local_notes.html +207 -0
- data/docs/architecture.md +181 -3
- data/docs/local_database.md +1035 -0
- data/lib/funicular/assets/funicular.rb +14 -0
- data/lib/funicular/configuration.rb +65 -0
- data/lib/funicular/epoch_header.rb +69 -0
- data/lib/funicular/epoch_stamping.rb +66 -0
- data/lib/funicular/helpers/picoruby_helper.rb +96 -1
- data/lib/funicular/railtie.rb +30 -0
- data/lib/funicular/schema.rb +45 -12
- data/lib/funicular/session_epoch.rb +110 -0
- data/lib/funicular/ssr/runtime.rb +57 -12
- data/lib/funicular/ssr.rb +25 -0
- data/lib/funicular/testing/node_runner.mjs +19 -0
- data/lib/funicular/testing.rb +47 -0
- data/lib/funicular/vendor/mrbc/VERSION +1 -1
- data/lib/funicular/vendor/mrbc/mrbc.js +69 -115
- data/lib/funicular/vendor/mrbc/mrbc.wasm +0 -0
- data/lib/funicular/vendor/picoruby/VERSION +1 -1
- data/lib/funicular/vendor/picoruby/debug/picoruby.js +170 -120
- data/lib/funicular/vendor/picoruby/debug/picoruby.wasm +0 -0
- data/lib/funicular/vendor/picoruby/dist/picoruby.js +1 -1
- data/lib/funicular/vendor/picoruby/dist/picoruby.wasm +0 -0
- data/lib/funicular/vendor/picoruby-test-node/VERSION +1 -1
- data/lib/funicular/vendor/picoruby-test-node/picoruby.js +2 -7201
- data/lib/funicular/vendor/picoruby-test-node/picoruby.wasm +0 -0
- data/lib/funicular/version.rb +1 -1
- data/lib/funicular.rb +1 -0
- data/lib/tasks/funicular.rake +10 -2
- data/minitest/callback_error_visibility_test.rb +48 -0
- data/minitest/configuration_test.rb +78 -0
- data/minitest/dsl_test.rb +27 -0
- data/minitest/epoch_header_test.rb +149 -0
- data/minitest/epoch_stamping_test.rb +225 -0
- data/minitest/fixtures/funicular_app/components/probe_component.rb +15 -0
- data/minitest/navigation_guard_test.rb +65 -0
- data/minitest/picoruby_helper_test.rb +236 -0
- data/minitest/schema_test.rb +47 -0
- data/minitest/session_epoch_test.rb +122 -0
- data/minitest/ssr_database_test.rb +78 -0
- data/minitest/ssr_reload_test.rb +106 -0
- data/minitest/ssr_test.rb +41 -0
- data/minitest/testing_ensure_compiled_test.rb +52 -0
- data/minitest/validations_test.rb +35 -5
- data/mrbgem.rake +2 -0
- data/mrblib/cable.rb +1 -1
- data/mrblib/component.rb +113 -1
- data/mrblib/db.rb +3116 -0
- data/mrblib/file_upload.rb +17 -7
- data/mrblib/funicular.rb +136 -17
- data/mrblib/http.rb +84 -107
- data/mrblib/model.rb +1178 -23
- data/mrblib/relation.rb +342 -0
- data/mrblib/router.rb +45 -4
- data/mrblib/styles.rb +20 -0
- data/sig/component.rbs +7 -0
- data/sig/db.rbs +328 -0
- data/sig/funicular.rbs +5 -0
- data/sig/http.rbs +8 -21
- data/sig/model.rbs +101 -7
- data/sig/relation.rbs +44 -0
- data/sig/router.rbs +1 -0
- data/sig/styles.rbs +1 -0
- metadata +19 -2
- data/lib/funicular/vendor/picoruby-test-node/picoruby.wasm.map +0 -1
|
@@ -508,13 +508,13 @@ function updateMemoryViews() {
|
|
|
508
508
|
HEAP8 = new Int8Array(b);
|
|
509
509
|
HEAP16 = new Int16Array(b);
|
|
510
510
|
HEAPU8 = new Uint8Array(b);
|
|
511
|
-
|
|
511
|
+
|
|
512
512
|
HEAP32 = new Int32Array(b);
|
|
513
513
|
HEAPU32 = new Uint32Array(b);
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
|
|
515
|
+
|
|
516
516
|
HEAP64 = new BigInt64Array(b);
|
|
517
|
-
|
|
517
|
+
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
// include: memoryprofiler.js
|
|
@@ -784,36 +784,15 @@ async function createWasm() {
|
|
|
784
784
|
}
|
|
785
785
|
}
|
|
786
786
|
|
|
787
|
-
/** @type {!Int16Array} */
|
|
788
|
-
var HEAP16;
|
|
789
|
-
|
|
790
787
|
/** @type {!Int32Array} */
|
|
791
788
|
var HEAP32;
|
|
792
789
|
|
|
793
|
-
/** not-@type {!BigInt64Array} */
|
|
794
|
-
var HEAP64;
|
|
795
|
-
|
|
796
790
|
/** @type {!Int8Array} */
|
|
797
791
|
var HEAP8;
|
|
798
792
|
|
|
799
|
-
/** @type {!Float32Array} */
|
|
800
|
-
var HEAPF32;
|
|
801
|
-
|
|
802
|
-
/** @type {!Float64Array} */
|
|
803
|
-
var HEAPF64;
|
|
804
|
-
|
|
805
|
-
/** @type {!Uint16Array} */
|
|
806
|
-
var HEAPU16;
|
|
807
|
-
|
|
808
793
|
/** @type {!Uint32Array} */
|
|
809
794
|
var HEAPU32;
|
|
810
795
|
|
|
811
|
-
/** not-@type {!BigUint64Array} */
|
|
812
|
-
var HEAPU64;
|
|
813
|
-
|
|
814
|
-
/** @type {!Uint8Array} */
|
|
815
|
-
var HEAPU8;
|
|
816
|
-
|
|
817
796
|
var callRuntimeCallbacks = (callbacks) => {
|
|
818
797
|
while (callbacks.length > 0) {
|
|
819
798
|
// Pass the module as the first argument.
|
|
@@ -827,26 +806,6 @@ async function createWasm() {
|
|
|
827
806
|
var addOnPreRun = (cb) => onPreRuns.push(cb);
|
|
828
807
|
|
|
829
808
|
|
|
830
|
-
|
|
831
|
-
/**
|
|
832
|
-
* @param {number} ptr
|
|
833
|
-
* @param {string} type
|
|
834
|
-
*/
|
|
835
|
-
function getValue(ptr, type = 'i8') {
|
|
836
|
-
if (type.endsWith('*')) type = '*';
|
|
837
|
-
switch (type) {
|
|
838
|
-
case 'i1': return HEAP8[ptr];
|
|
839
|
-
case 'i8': return HEAP8[ptr];
|
|
840
|
-
case 'i16': return HEAP16[((ptr)>>1)];
|
|
841
|
-
case 'i32': return HEAP32[((ptr)>>2)];
|
|
842
|
-
case 'i64': return HEAP64[((ptr)>>3)];
|
|
843
|
-
case 'float': return HEAPF32[((ptr)>>2)];
|
|
844
|
-
case 'double': return HEAPF64[((ptr)>>3)];
|
|
845
|
-
case '*': return HEAPU32[((ptr)>>2)];
|
|
846
|
-
default: abort(`invalid type for getValue: ${type}`);
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
|
|
850
809
|
var noExitRuntime = false;
|
|
851
810
|
|
|
852
811
|
function ptrToString(ptr) {
|
|
@@ -856,27 +815,6 @@ async function createWasm() {
|
|
|
856
815
|
return '0x' + ptr.toString(16).padStart(8, '0');
|
|
857
816
|
}
|
|
858
817
|
|
|
859
|
-
|
|
860
|
-
/**
|
|
861
|
-
* @param {number} ptr
|
|
862
|
-
* @param {number} value
|
|
863
|
-
* @param {string} type
|
|
864
|
-
*/
|
|
865
|
-
function setValue(ptr, value, type = 'i8') {
|
|
866
|
-
if (type.endsWith('*')) type = '*';
|
|
867
|
-
switch (type) {
|
|
868
|
-
case 'i1': HEAP8[ptr] = value; break;
|
|
869
|
-
case 'i8': HEAP8[ptr] = value; break;
|
|
870
|
-
case 'i16': HEAP16[((ptr)>>1)] = value; break;
|
|
871
|
-
case 'i32': HEAP32[((ptr)>>2)] = value; break;
|
|
872
|
-
case 'i64': HEAP64[((ptr)>>3)] = BigInt(value); break;
|
|
873
|
-
case 'float': HEAPF32[((ptr)>>2)] = value; break;
|
|
874
|
-
case 'double': HEAPF64[((ptr)>>3)] = value; break;
|
|
875
|
-
case '*': HEAPU32[((ptr)>>2)] = value; break;
|
|
876
|
-
default: abort(`invalid type for setValue: ${type}`);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
|
|
880
818
|
var stackRestore = (val) => __emscripten_stack_restore(val);
|
|
881
819
|
|
|
882
820
|
var stackSave = () => _emscripten_stack_get_current();
|
|
@@ -960,6 +898,9 @@ async function createWasm() {
|
|
|
960
898
|
return str;
|
|
961
899
|
};
|
|
962
900
|
|
|
901
|
+
/** @type {!Uint8Array} */
|
|
902
|
+
var HEAPU8;
|
|
903
|
+
|
|
963
904
|
/**
|
|
964
905
|
* Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the
|
|
965
906
|
* emscripten HEAP, returns a copy of that string as a Javascript String object.
|
|
@@ -1199,7 +1140,7 @@ async function createWasm() {
|
|
|
1199
1140
|
} catch (e) {
|
|
1200
1141
|
throw new FS.ErrnoError(29);
|
|
1201
1142
|
}
|
|
1202
|
-
if (result === undefined && bytesRead
|
|
1143
|
+
if (result === undefined && !bytesRead) {
|
|
1203
1144
|
throw new FS.ErrnoError(6);
|
|
1204
1145
|
}
|
|
1205
1146
|
if (result === null || result === undefined) break;
|
|
@@ -1299,6 +1240,7 @@ async function createWasm() {
|
|
|
1299
1240
|
if (ptr) zeroMemory(ptr, size);
|
|
1300
1241
|
return ptr;
|
|
1301
1242
|
};
|
|
1243
|
+
|
|
1302
1244
|
var MEMFS = {
|
|
1303
1245
|
ops_table:null,
|
|
1304
1246
|
mount(mount) {
|
|
@@ -1442,7 +1384,7 @@ async function createWasm() {
|
|
|
1442
1384
|
return attr;
|
|
1443
1385
|
},
|
|
1444
1386
|
setattr(node, attr) {
|
|
1445
|
-
for (const key of [
|
|
1387
|
+
for (const key of ['mode', 'atime', 'mtime', 'ctime']) {
|
|
1446
1388
|
if (attr[key] != null) {
|
|
1447
1389
|
node[key] = attr[key];
|
|
1448
1390
|
}
|
|
@@ -1528,10 +1470,10 @@ async function createWasm() {
|
|
|
1528
1470
|
node.mtime = node.ctime = Date.now();
|
|
1529
1471
|
|
|
1530
1472
|
if (canOwn) {
|
|
1531
|
-
assert(position
|
|
1473
|
+
assert(!position, 'canOwn must imply no weird position inside the file');
|
|
1532
1474
|
node.contents = buffer.subarray(offset, offset + length);
|
|
1533
1475
|
node.usedBytes = length;
|
|
1534
|
-
} else if (node.usedBytes
|
|
1476
|
+
} else if (!node.usedBytes && !position) { // If this is a simple first write to an empty file, do a fast set since we don't need to care about old data.
|
|
1535
1477
|
node.contents = buffer.slice(offset, offset + length);
|
|
1536
1478
|
node.usedBytes = length;
|
|
1537
1479
|
} else {
|
|
@@ -1758,26 +1700,27 @@ async function createWasm() {
|
|
|
1758
1700
|
'ESTRPIPE': 135,
|
|
1759
1701
|
};
|
|
1760
1702
|
|
|
1703
|
+
|
|
1761
1704
|
var NODEFS = {
|
|
1762
1705
|
isWindows:false,
|
|
1763
1706
|
staticInit() {
|
|
1764
1707
|
NODEFS.isWindows = !!process.platform.match(/^win/);
|
|
1765
|
-
var flags = process.binding(
|
|
1708
|
+
var flags = process.binding('constants')['fs'];
|
|
1766
1709
|
NODEFS.flagsForNodeMap = {
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1710
|
+
'1024': flags['O_APPEND'],
|
|
1711
|
+
'64': flags['O_CREAT'],
|
|
1712
|
+
'128': flags['O_EXCL'],
|
|
1713
|
+
'256': flags['O_NOCTTY'],
|
|
1714
|
+
'0': flags['O_RDONLY'],
|
|
1715
|
+
'2': flags['O_RDWR'],
|
|
1716
|
+
'4096': flags['O_SYNC'],
|
|
1717
|
+
'512': flags['O_TRUNC'],
|
|
1718
|
+
'1': flags['O_WRONLY'],
|
|
1719
|
+
'131072': flags['O_NOFOLLOW'],
|
|
1777
1720
|
};
|
|
1778
1721
|
// The 0 define must match on both sides, as otherwise we would not
|
|
1779
1722
|
// know to add it.
|
|
1780
|
-
assert(NODEFS.flagsForNodeMap[
|
|
1723
|
+
assert(NODEFS.flagsForNodeMap['0'] === 0);
|
|
1781
1724
|
},
|
|
1782
1725
|
convertNodeCode(e) {
|
|
1783
1726
|
var code = e.code;
|
|
@@ -1892,7 +1835,7 @@ async function createWasm() {
|
|
|
1892
1835
|
// update the common node structure mode as well
|
|
1893
1836
|
node.mode = attr.mode;
|
|
1894
1837
|
}
|
|
1895
|
-
if (typeof (attr.atime ?? attr.mtime) ===
|
|
1838
|
+
if (typeof (attr.atime ?? attr.mtime) === 'number') {
|
|
1896
1839
|
// Unfortunately, we have to stat the current value if we don't want
|
|
1897
1840
|
// to change it. On top of that, since the times don't round trip
|
|
1898
1841
|
// this will only keep the value nearly unchanged not exactly
|
|
@@ -1994,7 +1937,7 @@ async function createWasm() {
|
|
|
1994
1937
|
},
|
|
1995
1938
|
close(stream) {
|
|
1996
1939
|
NODEFS.tryFSOperation(() => {
|
|
1997
|
-
if (stream.nfd &&
|
|
1940
|
+
if (stream.nfd && !--stream.shared.refcount) {
|
|
1998
1941
|
fs.closeSync(stream.nfd);
|
|
1999
1942
|
}
|
|
2000
1943
|
});
|
|
@@ -2337,7 +2280,7 @@ async function createWasm() {
|
|
|
2337
2280
|
assert(id, 'addRunDependency requires an ID')
|
|
2338
2281
|
assert(!runDependencyTracking[id]);
|
|
2339
2282
|
runDependencyTracking[id] = 1;
|
|
2340
|
-
if (runDependencyWatcher
|
|
2283
|
+
if (!runDependencyWatcher && globalThis.setInterval) {
|
|
2341
2284
|
// Check for missing dependencies every few seconds
|
|
2342
2285
|
runDependencyWatcher = setInterval(() => {
|
|
2343
2286
|
if (ABORT) {
|
|
@@ -2404,6 +2347,7 @@ async function createWasm() {
|
|
|
2404
2347
|
var FS_createPreloadedFile = (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) => {
|
|
2405
2348
|
FS_preloadFile(parent, name, url, canRead, canWrite, dontCreateFile, canOwn, preFinish).then(onload).catch(onerror);
|
|
2406
2349
|
};
|
|
2350
|
+
|
|
2407
2351
|
var FS = {
|
|
2408
2352
|
root:null,
|
|
2409
2353
|
mounts:[],
|
|
@@ -3395,7 +3339,7 @@ async function createWasm() {
|
|
|
3395
3339
|
});
|
|
3396
3340
|
},
|
|
3397
3341
|
open(path, flags, mode = 0o666) {
|
|
3398
|
-
if (path ===
|
|
3342
|
+
if (path === '') {
|
|
3399
3343
|
throw new FS.ErrnoError(44);
|
|
3400
3344
|
}
|
|
3401
3345
|
flags = FS_modeStringToFlags(flags);
|
|
@@ -3409,7 +3353,7 @@ async function createWasm() {
|
|
|
3409
3353
|
if (typeof path == 'object') {
|
|
3410
3354
|
node = path;
|
|
3411
3355
|
} else {
|
|
3412
|
-
isDirPath = path.endsWith(
|
|
3356
|
+
isDirPath = path.endsWith('/');
|
|
3413
3357
|
// noent_okay makes it so that if the final component of the path
|
|
3414
3358
|
// doesn't exist, lookupPath returns `node: undefined`. `path` will be
|
|
3415
3359
|
// updated to point to the target of all symlinks.
|
|
@@ -3591,8 +3535,8 @@ async function createWasm() {
|
|
|
3591
3535
|
// to write to file opened in read-only mode with MAP_PRIVATE flag,
|
|
3592
3536
|
// as all modifications will be visible only in the memory of
|
|
3593
3537
|
// the current process.
|
|
3594
|
-
if ((prot & 2)
|
|
3595
|
-
&& (flags & 2)
|
|
3538
|
+
if ((prot & 2)
|
|
3539
|
+
&& !(flags & 2)
|
|
3596
3540
|
&& (stream.flags & 2097155) !== 2) {
|
|
3597
3541
|
throw new FS.ErrnoError(2);
|
|
3598
3542
|
}
|
|
@@ -3685,7 +3629,7 @@ async function createWasm() {
|
|
|
3685
3629
|
// use a buffer to avoid overhead of individual crypto calls per byte
|
|
3686
3630
|
var randomBuffer = new Uint8Array(1024), randomLeft = 0;
|
|
3687
3631
|
var randomByte = () => {
|
|
3688
|
-
if (randomLeft
|
|
3632
|
+
if (!randomLeft) {
|
|
3689
3633
|
randomFill(randomBuffer);
|
|
3690
3634
|
randomLeft = randomBuffer.byteLength;
|
|
3691
3635
|
}
|
|
@@ -3902,7 +3846,7 @@ async function createWasm() {
|
|
|
3902
3846
|
} catch (e) {
|
|
3903
3847
|
throw new FS.ErrnoError(29);
|
|
3904
3848
|
}
|
|
3905
|
-
if (result === undefined && bytesRead
|
|
3849
|
+
if (result === undefined && !bytesRead) {
|
|
3906
3850
|
throw new FS.ErrnoError(6);
|
|
3907
3851
|
}
|
|
3908
3852
|
if (result === null || result === undefined) break;
|
|
@@ -3933,7 +3877,7 @@ async function createWasm() {
|
|
|
3933
3877
|
forceLoadFile(obj) {
|
|
3934
3878
|
if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
|
|
3935
3879
|
if (globalThis.XMLHttpRequest) {
|
|
3936
|
-
abort(
|
|
3880
|
+
abort('Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.');
|
|
3937
3881
|
} else { // Command-line.
|
|
3938
3882
|
try {
|
|
3939
3883
|
obj.contents = readBinary(obj.url);
|
|
@@ -3964,11 +3908,11 @@ async function createWasm() {
|
|
|
3964
3908
|
var xhr = new XMLHttpRequest();
|
|
3965
3909
|
xhr.open('HEAD', url, false);
|
|
3966
3910
|
xhr.send(null);
|
|
3967
|
-
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort(
|
|
3968
|
-
var datalength = Number(xhr.getResponseHeader(
|
|
3911
|
+
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort(`Couldn't load ${url}. Status: ${xhr.status}`);
|
|
3912
|
+
var datalength = Number(xhr.getResponseHeader('Content-length'));
|
|
3969
3913
|
var header;
|
|
3970
|
-
var hasByteServing = (header = xhr.getResponseHeader(
|
|
3971
|
-
var usesGzip = (header = xhr.getResponseHeader(
|
|
3914
|
+
var hasByteServing = (header = xhr.getResponseHeader('Accept-Ranges')) && header === 'bytes';
|
|
3915
|
+
var usesGzip = (header = xhr.getResponseHeader('Content-Encoding')) && header === 'gzip';
|
|
3972
3916
|
|
|
3973
3917
|
var chunkSize = 1024*1024; // Chunk size in bytes
|
|
3974
3918
|
|
|
@@ -3982,7 +3926,7 @@ async function createWasm() {
|
|
|
3982
3926
|
// TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
|
|
3983
3927
|
var xhr = new XMLHttpRequest();
|
|
3984
3928
|
xhr.open('GET', url, false);
|
|
3985
|
-
if (datalength !== chunkSize) xhr.setRequestHeader(
|
|
3929
|
+
if (datalength !== chunkSize) xhr.setRequestHeader('Range', `bytes=${from}-${to}`);
|
|
3986
3930
|
|
|
3987
3931
|
// Some hints to the browser that we want binary data.
|
|
3988
3932
|
xhr.responseType = 'arraybuffer';
|
|
@@ -3991,7 +3935,7 @@ async function createWasm() {
|
|
|
3991
3935
|
}
|
|
3992
3936
|
|
|
3993
3937
|
xhr.send(null);
|
|
3994
|
-
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort(
|
|
3938
|
+
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) abort(`Couldn't load ${url}. Status: ${xhr.status}`);
|
|
3995
3939
|
if (xhr.response !== undefined) {
|
|
3996
3940
|
return new Uint8Array(/** @type{Array<number>} */(xhr.response || []));
|
|
3997
3941
|
}
|
|
@@ -4014,7 +3958,7 @@ async function createWasm() {
|
|
|
4014
3958
|
chunkSize = datalength = 1; // this will force getter(0)/doXHR do download the whole file
|
|
4015
3959
|
datalength = this.getter(0).length;
|
|
4016
3960
|
chunkSize = datalength;
|
|
4017
|
-
out(
|
|
3961
|
+
out('LazyFiles on gzip forces download of the whole file when length is accessed');
|
|
4018
3962
|
}
|
|
4019
3963
|
|
|
4020
3964
|
this._length = datalength;
|
|
@@ -4104,6 +4048,12 @@ async function createWasm() {
|
|
|
4104
4048
|
},
|
|
4105
4049
|
};
|
|
4106
4050
|
|
|
4051
|
+
|
|
4052
|
+
|
|
4053
|
+
|
|
4054
|
+
|
|
4055
|
+
/** not-@type {!BigInt64Array} */
|
|
4056
|
+
var HEAP64;
|
|
4107
4057
|
var SYSCALLS = {
|
|
4108
4058
|
currentUmask:18,
|
|
4109
4059
|
calculateAt(dirfd, path, allowEmpty) {
|
|
@@ -4181,6 +4131,9 @@ async function createWasm() {
|
|
|
4181
4131
|
return ret;
|
|
4182
4132
|
},
|
|
4183
4133
|
};
|
|
4134
|
+
|
|
4135
|
+
/** @type {!Int16Array} */
|
|
4136
|
+
var HEAP16;
|
|
4184
4137
|
function ___syscall_fcntl64(fd, cmd, varargs) {
|
|
4185
4138
|
SYSCALLS.varargs = varargs;
|
|
4186
4139
|
try {
|
|
@@ -4234,6 +4187,9 @@ async function createWasm() {
|
|
|
4234
4187
|
|
|
4235
4188
|
|
|
4236
4189
|
|
|
4190
|
+
|
|
4191
|
+
|
|
4192
|
+
|
|
4237
4193
|
function ___syscall_ioctl(fd, op, varargs) {
|
|
4238
4194
|
SYSCALLS.varargs = varargs;
|
|
4239
4195
|
try {
|
|
@@ -4398,9 +4354,10 @@ async function createWasm() {
|
|
|
4398
4354
|
} catch(e) {
|
|
4399
4355
|
err(`growMemory: Attempted to grow heap from ${oldHeapSize} bytes to ${size} bytes, but got error: ${e}`);
|
|
4400
4356
|
}
|
|
4401
|
-
// implicit 0 return to save code size (caller will cast
|
|
4357
|
+
// implicit 0 return to save code size (caller will cast 'undefined' into 0
|
|
4402
4358
|
// anyhow)
|
|
4403
4359
|
};
|
|
4360
|
+
|
|
4404
4361
|
var _emscripten_resize_heap = (requestedSize) => {
|
|
4405
4362
|
var oldSize = HEAPU8.length;
|
|
4406
4363
|
// With CAN_ADDRESS_2GB or MEMORY64, pointers are already unsigned.
|
|
@@ -4498,6 +4455,7 @@ async function createWasm() {
|
|
|
4498
4455
|
}
|
|
4499
4456
|
|
|
4500
4457
|
|
|
4458
|
+
|
|
4501
4459
|
/** @param {number=} offset */
|
|
4502
4460
|
var doReadv = (stream, iov, iovcnt, offset) => {
|
|
4503
4461
|
var ret = 0;
|
|
@@ -4527,6 +4485,7 @@ async function createWasm() {
|
|
|
4527
4485
|
return ret;
|
|
4528
4486
|
};
|
|
4529
4487
|
|
|
4488
|
+
|
|
4530
4489
|
function _fd_read(fd, iov, iovcnt, pnum) {
|
|
4531
4490
|
try {
|
|
4532
4491
|
|
|
@@ -4542,6 +4501,7 @@ async function createWasm() {
|
|
|
4542
4501
|
|
|
4543
4502
|
|
|
4544
4503
|
|
|
4504
|
+
|
|
4545
4505
|
function _fd_seek(fd, offset, whence, newOffset) {
|
|
4546
4506
|
offset = bigintToI53Checked(offset);
|
|
4547
4507
|
|
|
@@ -4552,7 +4512,7 @@ async function createWasm() {
|
|
|
4552
4512
|
var stream = SYSCALLS.getStreamFromFD(fd);
|
|
4553
4513
|
FS.llseek(stream, offset, whence);
|
|
4554
4514
|
HEAP64[((newOffset)>>3)] = BigInt(stream.position);
|
|
4555
|
-
if (stream.getdents && offset
|
|
4515
|
+
if (stream.getdents && !offset && whence === 0) stream.getdents = null; // reset readdir state
|
|
4556
4516
|
return 0;
|
|
4557
4517
|
} catch (e) {
|
|
4558
4518
|
if (typeof FS == 'undefined' || !(e.name === 'ErrnoError')) throw e;
|
|
@@ -4561,6 +4521,8 @@ async function createWasm() {
|
|
|
4561
4521
|
;
|
|
4562
4522
|
}
|
|
4563
4523
|
|
|
4524
|
+
|
|
4525
|
+
|
|
4564
4526
|
/** @param {number=} offset */
|
|
4565
4527
|
var doWritev = (stream, iov, iovcnt, offset) => {
|
|
4566
4528
|
// Gather all iovecs into one contiguous buffer and issue a single
|
|
@@ -4586,6 +4548,7 @@ async function createWasm() {
|
|
|
4586
4548
|
return FS.write(stream, view, 0, total, offset);
|
|
4587
4549
|
};
|
|
4588
4550
|
|
|
4551
|
+
|
|
4589
4552
|
function _fd_write(fd, iov, iovcnt, pnum) {
|
|
4590
4553
|
try {
|
|
4591
4554
|
|
|
@@ -4620,6 +4583,7 @@ async function createWasm() {
|
|
|
4620
4583
|
};
|
|
4621
4584
|
|
|
4622
4585
|
|
|
4586
|
+
|
|
4623
4587
|
var stringToUTF8 = (str, outPtr, maxBytesToWrite) => {
|
|
4624
4588
|
assert(typeof maxBytesToWrite == 'number', 'stringToUTF8 requires a third parameter that specifies the length of the output buffer');
|
|
4625
4589
|
return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);
|
|
@@ -4633,6 +4597,7 @@ async function createWasm() {
|
|
|
4633
4597
|
return ret;
|
|
4634
4598
|
};
|
|
4635
4599
|
|
|
4600
|
+
|
|
4636
4601
|
var wasmTableMirror = [];
|
|
4637
4602
|
|
|
4638
4603
|
|
|
@@ -4653,7 +4618,7 @@ async function createWasm() {
|
|
|
4653
4618
|
if (ENVIRONMENT_IS_NODE) { NODEFS.staticInit(); };
|
|
4654
4619
|
|
|
4655
4620
|
if (!ENVIRONMENT_IS_NODE) {
|
|
4656
|
-
throw new Error(
|
|
4621
|
+
throw new Error('NODERAWFS is currently only supported on Node.js environment.')
|
|
4657
4622
|
}
|
|
4658
4623
|
var nodeTTY = require('node:tty');
|
|
4659
4624
|
function _wrapNodeError(func) {
|
|
@@ -4792,6 +4757,8 @@ if (Module['printErr']) err = Module['printErr'];
|
|
|
4792
4757
|
'getFunctionAddress',
|
|
4793
4758
|
'addFunction',
|
|
4794
4759
|
'removeFunction',
|
|
4760
|
+
'setValue',
|
|
4761
|
+
'getValue',
|
|
4795
4762
|
'intArrayToString',
|
|
4796
4763
|
'AsciiToString',
|
|
4797
4764
|
'stringToAscii',
|
|
@@ -4863,10 +4830,6 @@ if (Module['printErr']) err = Module['printErr'];
|
|
|
4863
4830
|
'addPromise',
|
|
4864
4831
|
'idsToPromises',
|
|
4865
4832
|
'makePromiseCallback',
|
|
4866
|
-
'ExceptionInfo',
|
|
4867
|
-
'findMatchingCatch',
|
|
4868
|
-
'incrementUncaughtExceptionCount',
|
|
4869
|
-
'decrementUncaughtExceptionCount',
|
|
4870
4833
|
'Browser_asyncPrepareDataCounter',
|
|
4871
4834
|
'isLeapYear',
|
|
4872
4835
|
'ydayFromDate',
|
|
@@ -4899,14 +4862,10 @@ if (Module['printErr']) err = Module['printErr'];
|
|
|
4899
4862
|
'writeGLArray',
|
|
4900
4863
|
'registerWebGlEventCallback',
|
|
4901
4864
|
'runAndAbortIfError',
|
|
4902
|
-
'ALLOC_NORMAL',
|
|
4903
|
-
'ALLOC_STACK',
|
|
4904
|
-
'allocate',
|
|
4905
4865
|
'writeStringToMemory',
|
|
4906
4866
|
'writeAsciiToMemory',
|
|
4907
4867
|
'allocateUTF8',
|
|
4908
4868
|
'allocateUTF8OnStack',
|
|
4909
|
-
'demangle',
|
|
4910
4869
|
'stackTrace',
|
|
4911
4870
|
'getNativeTypeSize',
|
|
4912
4871
|
];
|
|
@@ -4965,8 +4924,6 @@ missingLibrarySymbols.forEach(missingLibrarySymbol)
|
|
|
4965
4924
|
'addOnPostRun',
|
|
4966
4925
|
'freeTableIndexes',
|
|
4967
4926
|
'functionsInTableMap',
|
|
4968
|
-
'setValue',
|
|
4969
|
-
'getValue',
|
|
4970
4927
|
'PATH',
|
|
4971
4928
|
'PATH_FS',
|
|
4972
4929
|
'UTF8Decoder',
|
|
@@ -4992,11 +4949,8 @@ missingLibrarySymbols.forEach(missingLibrarySymbol)
|
|
|
4992
4949
|
'emClearImmediate_deps',
|
|
4993
4950
|
'emClearImmediate',
|
|
4994
4951
|
'promiseMap',
|
|
4995
|
-
'uncaughtExceptionCount',
|
|
4996
|
-
'exceptionCaught',
|
|
4997
4952
|
'Browser',
|
|
4998
4953
|
'requestFullscreen',
|
|
4999
|
-
'requestFullScreen',
|
|
5000
4954
|
'setCanvasSize',
|
|
5001
4955
|
'getUserMedia',
|
|
5002
4956
|
'createContext',
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
4.0.
|
|
1
|
+
4.0.3
|