porffor 0.19.6 → 0.19.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.
@@ -1231,12 +1231,7 @@ const asmFunc = (name, { wasm, params, locals: localTypes, globals: globalTypes
1231
1231
  return func;
1232
1232
  };
1233
1233
 
1234
- const includeBuiltin = (scope, builtin) => {
1235
- const code = builtinFuncs[builtin];
1236
- if (code.wasm) return asmFunc(builtin, code);
1237
-
1238
- return code.body.map(x => generate(scope, x));
1239
- };
1234
+ const includeBuiltin = (scope, builtin) => asmFunc(builtin, builtinFuncs[builtin]);
1240
1235
 
1241
1236
  const generateLogicExp = (scope, decl) => {
1242
1237
  return performLogicOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right));
@@ -4243,8 +4238,8 @@ const generateArray = (scope, decl, global = false, name = '$undeclared', initEm
4243
4238
  };
4244
4239
 
4245
4240
  const generateObject = (scope, decl, global = false, name = '$undeclared') => {
4246
- if (!funcIndex.Map) includeBuiltin(scope, 'Map');
4247
- if (!funcIndex.__Map_prototype_set) includeBuiltin(scope, '__Map_prototype_set');
4241
+ includeBuiltin(scope, 'Map');
4242
+ includeBuiltin(scope, '__Map_prototype_set');
4248
4243
 
4249
4244
  // todo: optimize const objects
4250
4245
  const tmp = localTmp(scope, `#objectexpr${randId()}`);
@@ -4262,7 +4257,7 @@ const generateObject = (scope, decl, global = false, name = '$undeclared') => {
4262
4257
 
4263
4258
  for (const x of decl.properties) {
4264
4259
  const { method, shorthand, computed, kind, key, value } = x;
4265
- if (method || shorthand || kind !== 'init' || key.type !== 'Identifier') return todo(scope, 'complex objects are not supported yet', true);
4260
+ if (kind !== 'init') return todo(scope, 'complex objects are not supported yet', true);
4266
4261
 
4267
4262
  const k = computed ? key : {
4268
4263
  type: 'Literal',
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.19.6+432f446a1",
4
+ "version": "0.19.8+92c5cf593",
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.19.6+432f446a1';
3
+ globalThis.version = '0.19.8+92c5cf593';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {