porffor 0.57.8 → 0.57.9

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.
@@ -2703,7 +2703,7 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
2703
2703
 
2704
2704
  if (
2705
2705
  func?.returns?.length === 0 ||
2706
- (idx === importedFuncs[name] && importedFuncs[importedFuncs[name]]?.returns === 0)
2706
+ (idx === importedFuncs[name] && importedFuncs[importedFuncs[name]]?.returns?.length === 0)
2707
2707
  ) {
2708
2708
  out.push(number(UNDEFINED));
2709
2709
  }
@@ -5750,7 +5750,7 @@ const generateMember = (scope, decl, _global, _name) => {
5750
5750
  if (func) return withType(scope, [ number(countLength(func, name)) ], TYPES.number);
5751
5751
 
5752
5752
  if (Object.hasOwn(builtinFuncs, name)) return withType(scope, [ number(countLength(builtinFuncs[name], name)) ], TYPES.number);
5753
- if (Object.hasOwn(importedFuncs, name)) return withType(scope, [ number(importedFuncs[name].params.length ?? importedFuncs[name].params) ], TYPES.number);
5753
+ if (Object.hasOwn(importedFuncs, name)) return withType(scope, [ number(importedFuncs[name].params.length) ], TYPES.number);
5754
5754
  if (Object.hasOwn(internalConstrs, name)) return withType(scope, [ number(internalConstrs[name].length ?? 0) ], TYPES.number);
5755
5755
  }
5756
5756
 
@@ -102,8 +102,8 @@ export default (wasm, name = '', ind = 0, locals = {}, params = [], returns = []
102
102
  const callFunc = funcs.find(x => x.index === idx);
103
103
  if (callFunc) out += ` ;; $${callFunc.name} ${makeSignature(callFunc.params, callFunc.returns)}`;
104
104
  if (globalThis.importFuncs && idx < importFuncs.length) {
105
- const importFunc = importFuncs[idx];
106
- out += ` ;; import ${importFunc.name} ${makeSignature(typeof importFunc.params === 'object' ? importFunc.params : new Array(importFunc.params).fill(valtypeBinary), new Array(importFunc.returns).fill(valtypeBinary),)}`;
105
+ const importFunc = globalThis.importFuncs[idx];
106
+ out += ` ;; import ${importFunc.name} ${makeSignature(importFunc.params, importFunc.returns)}`;
107
107
  }
108
108
  }
109
109
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "An ahead-of-time JavaScript compiler",
4
- "version": "0.57.8",
4
+ "version": "0.57.9",
5
5
  "author": "Oliver Medhurst <honk@goose.icu>",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/runtime/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.57.8';
3
+ globalThis.version = '0.57.9';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {