porffor 0.28.8 → 0.28.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.
@@ -5500,7 +5500,7 @@ const objectHack = node => {
5500
5500
  };
5501
5501
 
5502
5502
  const generateFunc = (scope, decl) => {
5503
- const name = decl.id ? decl.id.name : `anonymous${uniqId()}`;
5503
+ const name = decl.id ? decl.id.name : `#anonymous${uniqId()}`;
5504
5504
  const params = decl.params ?? [];
5505
5505
 
5506
5506
  // TODO: share scope/locals between !!!
@@ -216,7 +216,10 @@ ${funcs.map(x => {
216
216
 
217
217
  const locals = Object.entries(x.locals).sort((a,b) => a[1].idx - b[1].idx)
218
218
 
219
- return ` this.${x.name} = {
219
+ // todo: check for other identifier unsafe characters
220
+ const name = x.name.includes('#') ? `['${x.name}']` : `.${x.name}`;
221
+
222
+ return ` this${name} = {
220
223
  wasm: ${rewriteWasm(x.wasm)},
221
224
  params: ${JSON.stringify(x.params)}, typedParams: 1,
222
225
  returns: ${JSON.stringify(x.returns)}, ${x.returnType != null ? `returnType: ${JSON.stringify(x.returnType)}` : 'typedReturns: 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.28.8+a0f4bd584",
4
+ "version": "0.28.9+b6f291238",
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.28.8+a0f4bd584';
3
+ globalThis.version = '0.28.9+b6f291238';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {