porffor 0.55.15 → 0.55.16

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.
@@ -230,7 +230,7 @@ ${funcs.map(x => {
230
230
  .replace(/\"local","(.*?)",(.*?)\]/g, (_, name, valtype) => `loc('${name}',${valtype})]`)
231
231
  .replace(/\[16,"(.*?)"]/g, (_, name) => `[16,builtin('${name}')]`)
232
232
  .replace(/\[(68|65),"funcref","(.*?)"]/g, (_1, op, name) => op === '65' ? `...i32ify(funcRef('${name}'))` : `...funcRef('${name}')`)
233
- .replace(/\[(68|65),"str","(.*?)",(.*?)]/g, (_1, op, str, forceBytestring) => op === '65' ? `...i32ify(makeString(_,${JSON.stringify(str)},${forceBytestring ? 1 : 0}))` : `...makeString(_,${JSON.stringify(str)},${forceBytestring ? 1 : 0})`)
233
+ .replace(/\[(68|65),"str","(.*?)",(.*?)]/g, (_1, op, str, forceBytestring) => op === '65' ? `...i32ify(makeString(_,"${str}",${forceBytestring ? 1 : 0}))` : `...makeString(_,"${str}",${forceBytestring ? 1 : 0})`)
234
234
  .replace(/\["throw","(.*?)","(.*?)"\]/g, (_, constructor, message) => `...internalThrow(_,'${constructor}',\`${message}\`)`)
235
235
  .replace(/\["get object","(.*?)"\]/g, (_, objName) => `...generateIdent(_,{name:'${objName}'})`)
236
236
  .replace(/\[null,"typeswitch case start",\[(.*?)\]\],/g, (_, types) => `...t([${types}],()=>[`)
package/compiler/wrap.js CHANGED
@@ -335,6 +335,20 @@ ${flags & 0b0001 ? ` get func idx: ${get}
335
335
  return out;
336
336
  }
337
337
 
338
+ case TYPES.bigint: {
339
+ const negative = read(Uint8Array, memory, value, 1)[0] !== 0;
340
+ const len = read(Uint16Array, memory, value + 2, 1)[0];
341
+ const digits = read(Uint32Array, memory, value + 4, len);
342
+
343
+ console.log(digits);
344
+
345
+ let result = 0n;
346
+ for (let i = 0; i < digits.length; i++) {
347
+ result = result * 0x100000000n + BigInt(digits[i]);
348
+ }
349
+ return negative ? -result : result;
350
+ }
351
+
338
352
  default: return value;
339
353
  }
340
354
  };
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.55.15",
4
+ "version": "0.55.16",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/r.cjs CHANGED
@@ -1,7 +1,3 @@
1
- const x = new Date();
2
- console.log(x.constructor === Date);
3
-
4
-
5
1
  // let o = { set foo(x) { console.log('set foo', x); }, __proto__: { set bar(x) { console.log('set bar', x); } } };
6
2
 
7
3
  // o.foo = 1;
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.55.15';
3
+ globalThis.version = '0.55.16';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {