Skip to content

Commit d60e99d

Browse files
thadkfddemora
andcommitted
2021-versioned anypia and node-testable version
Co-authored-by: Fellipe Demoraes <58346374+fddemora@users.noreply.github.com>
1 parent 75d443b commit d60e99d

3 files changed

Lines changed: 16 additions & 13 deletions

File tree

gatsby-node.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ exports.onCreateWebpackConfig = ({ stage, actions }) => {
1111

1212
//allow us to not use ENVIRONMENT=web when compiling anypia-js, test it
1313
// https://stackoverflow.com/questions/59487224/webpack-throws-error-with-emscripten-cant-resolve-fs
14-
"node": { "fs": "empty" }
14+
"node": { "fs": "empty" },
15+
"resolve": { fallback: { "path": false, "fs": false, "crypto": false } }
1516
})
1617
}

src/library/anypiajs.mjs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ import 'core-js/modules/es6.typed-array.uint8-clamped-array'
1010
// See: https://stackoverflow.com/questions/63592691/core-js-cannot-resolve-core-js-modules-es6-typed-uint32-array/63592692#63592692
1111

1212
var Module = (function() {
13-
var _scriptDir = '/anypiajs-20201.wasm';
13+
var _scriptDir = '/anypiajs-20211-versioned2.wasm';
1414

1515
return (
1616
function(Module) {
1717
Module = Module || {};
1818

1919

2020

21+
22+
2123
// The Module object: Our interface to the outside world. We import
2224
// and export values on it. There are various ways Module can be used:
2325
// 1. Not defined. We create it here
@@ -1462,11 +1464,11 @@ function updateGlobalBufferAndViews(buf) {
14621464
}
14631465

14641466
var STATIC_BASE = 1024,
1465-
STACK_BASE = 74496,
1467+
STACK_BASE = 74512,
14661468
STACKTOP = STACK_BASE,
1467-
STACK_MAX = 5317376,
1468-
DYNAMIC_BASE = 5317376,
1469-
DYNAMICTOP_PTR = 74288;
1469+
STACK_MAX = 5317392,
1470+
DYNAMIC_BASE = 5317392,
1471+
DYNAMICTOP_PTR = 74304;
14701472

14711473
assert(STACK_BASE % 16 === 0, 'stack must start aligned');
14721474
assert(DYNAMIC_BASE % 16 === 0, 'heap must start aligned');
@@ -1890,7 +1892,7 @@ function createExportWrapper(name, fixedasm) {
18901892
};
18911893
}
18921894

1893-
var wasmBinaryFile = 'anypiajs-20201.wasm';
1895+
var wasmBinaryFile = 'anypiajs-20211-versioned2.wasm';
18941896
if (!isDataURI(wasmBinaryFile)) {
18951897
wasmBinaryFile = locateFile(wasmBinaryFile);
18961898
}
@@ -2043,7 +2045,7 @@ var ASM_CONSTS = [];
20432045

20442046

20452047

2046-
// STATICTOP = STATIC_BASE + 73472;
2048+
// STATICTOP = STATIC_BASE + 73488;
20472049
/* global initializers */ __ATINIT__.push({ func: function() { globalCtors() } });
20482050

20492051

@@ -2054,7 +2056,7 @@ var ASM_CONSTS = [];
20542056

20552057

20562058
/* no memory initializer */
2057-
var tempDoublePtr = 74480;
2059+
var tempDoublePtr = 74496;
20582060

20592061
function copyTempFloat(ptr) { // functions, because inlining this code increases code size too much
20602062
HEAP8[tempDoublePtr] = HEAP8[ptr];
@@ -6344,7 +6346,7 @@ function copyTempDouble(ptr) {
63446346
}
63456347

63466348

6347-
var ___tm_timezone=(stringToUTF8("GMT", 74384, 4), 74384);
6349+
var ___tm_timezone=(stringToUTF8("GMT", 74400, 4), 74400);
63486350

63496351
function _tzset() {
63506352
// TODO: Use (malleable) environment variables instead of system settings.
@@ -7085,8 +7087,8 @@ var dynCall_viiiiii = Module["dynCall_viiiiii"] = createExportWrapper("dynCall_v
70857087

70867088
/** @type {function(...*):?} */
70877089
var dynCall_viijii = Module["dynCall_viijii"] = createExportWrapper("dynCall_viijii");
7088-
Module['__ZZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKvE5__fmt'] = 62847;
7089-
Module['__ZZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwmE5__fmt'] = 62858;;
7090+
Module['__ZZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwPKvE5__fmt'] = 62863;
7091+
Module['__ZZNKSt3__27num_putIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_putES4_RNS_8ios_baseEwmE5__fmt'] = 62874;;
70907092

70917093

70927094

@@ -7112,7 +7114,7 @@ if (!Object.getOwnPropertyDescriptor(Module, "addOnPreRun")) Module["addOnPreRun
71127114
if (!Object.getOwnPropertyDescriptor(Module, "addOnInit")) Module["addOnInit"] = function() { abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
71137115
if (!Object.getOwnPropertyDescriptor(Module, "addOnPreMain")) Module["addOnPreMain"] = function() { abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
71147116
if (!Object.getOwnPropertyDescriptor(Module, "addOnExit")) Module["addOnExit"] = function() { abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
7115-
if (!Object.getOwnPropertyDescriptor(Module, "addOnPostRun")) Module["addOnPostRun"] = function() { abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
7117+
Module["addOnPostRun"] = addOnPostRun;
71167118
if (!Object.getOwnPropertyDescriptor(Module, "writeStringToMemory")) Module["writeStringToMemory"] = function() { abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
71177119
if (!Object.getOwnPropertyDescriptor(Module, "writeArrayToMemory")) Module["writeArrayToMemory"] = function() { abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
71187120
if (!Object.getOwnPropertyDescriptor(Module, "writeAsciiToMemory")) Module["writeAsciiToMemory"] = function() { abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") };
1.63 MB
Binary file not shown.

0 commit comments

Comments
 (0)