porffor 0.42.7 → 0.42.8

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.
@@ -399,9 +399,19 @@ const generateIdent = (scope, decl) => {
399
399
 
400
400
  if (local?.idx === undefined) {
401
401
  if (name === 'arguments' && scope.name !== 'main' && !scope.arrow) {
402
- // todo: stub arguments as [] for now :)
402
+ // todo: not compliant
403
+ let len = countLength(scope);
404
+ const names = new Array(len);
405
+ const off = scope.constr ? 4 : 0;
406
+ for (const x in scope.locals) {
407
+ const i = scope.locals[x].idx - off;
408
+ if (i >= 0 && i % 2 === 0 && i < len * 2) {
409
+ names[i / 2] = x;
410
+ }
411
+ }
412
+
403
413
  return generateArray(scope, {
404
- elements: []
414
+ elements: names.map(x => ({ type: 'Identifier', name: x }))
405
415
  }, false, '#arguments');
406
416
  }
407
417
 
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.42.7+5472762e8",
4
+ "version": "0.42.8+06fc0f2c7",
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.42.7+5472762e8';
3
+ globalThis.version = '0.42.8+06fc0f2c7';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
package/r.js DELETED
@@ -1,4 +0,0 @@
1
- const foo = (a, b, c, d) => console.log(a, b, c, d);
2
-
3
- const arr = [ 7, 8, 9 ];
4
- foo(1, ...arr);