porffor 0.49.3 → 0.49.4

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/compiler/wrap.js CHANGED
@@ -384,7 +384,7 @@ export default (source, module = undefined, customImports = {}, print = str => p
384
384
 
385
385
  const backtrace = (funcInd, blobOffset) => {
386
386
  if (funcInd == null || blobOffset == null ||
387
- Number.isNaN(funcInd) || Number.isNaN(blobOffset)) return false;
387
+ Number.isNaN(funcInd) || Number.isNaN(blobOffset) || Prefs.backtrace === false) return false;
388
388
 
389
389
  // convert blob offset -> function wasm offset
390
390
  const func = funcs.find(x => x.asmIndex === funcInd);
@@ -500,15 +500,10 @@ export default (source, module = undefined, customImports = {}, print = str => p
500
500
  continue;
501
501
  }
502
502
 
503
- const name = x === 'm' ? 'main' : x;
504
- const func = funcs.find(x => x.name === name);
505
-
506
- const exp = instance.exports[x];
507
- exports[func.name] = exp;
508
-
509
- exports[func.name] = function() {
503
+ const wasm = instance.exports[x];
504
+ exports[x === 'm' ? 'main' : x] = function() {
510
505
  try {
511
- const ret = exp.apply(this, arguments);
506
+ const ret = wasm.apply(this, arguments);
512
507
  if (ret == null) return undefined;
513
508
 
514
509
  if (rawValues) return { value: ret[0], type: ret[1], js: porfToJSValue({ memory, funcs, pages }, ret[0], ret[1]) };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
4
- "version": "0.49.3",
4
+ "version": "0.49.4",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/runner/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.49.3';
3
+ globalThis.version = '0.49.4';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {