porffor 0.50.16 → 0.50.18

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.
@@ -5193,11 +5193,16 @@ const generateThrow = (scope, decl) => {
5193
5193
  ];
5194
5194
  }
5195
5195
 
5196
- return [
5197
- ...generate(scope, decl.argument),
5198
- ...getNodeType(scope, decl.argument),
5199
- [ Opcodes.throw, globalThis.precompile ? 1 : 0 ]
5200
- ];
5196
+ const out = generate(scope, decl.argument);
5197
+ const lastOp = out.at(-1);
5198
+ if (lastOp[0] === Opcodes.local_set && lastOp[1] === scope.locals['#last_type']?.idx) {
5199
+ out.pop();
5200
+ } else {
5201
+ out.push(...getNodeType(scope, decl.argument));
5202
+ }
5203
+
5204
+ out.push([ Opcodes.throw, globalThis.precompile ? 1 : 0 ]);
5205
+ return out;
5201
5206
  };
5202
5207
 
5203
5208
  const generateTry = (scope, decl) => {
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.50.16",
4
+ "version": "0.50.18",
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.50.16';
3
+ globalThis.version = '0.50.18';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {