porffor 0.24.3 → 0.24.4

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.
@@ -522,10 +522,11 @@ export const __Number_prototype_valueOf = (_this: number) => {
522
522
  };
523
523
 
524
524
 
525
- export const parseInt = (input: string|bytestring, radix: number): f64 => {
525
+ export const parseInt = (input: string|bytestring, radix: any): f64 => {
526
526
  // todo/perf: optimize this instead of doing a naive algo (https://kholdstare.github.io/technical/2020/05/26/faster-integer-parsing.html)
527
527
  // todo/perf: use i32s here once that becomes not annoying
528
528
 
529
+ radix = ecma262.ToIntegerOrInfinity(radix);
529
530
  if (radix == 0) radix = 10;
530
531
  if (radix < 2 || radix > 36) return NaN;
531
532
 
@@ -658,4 +659,4 @@ export const parseInt = (input: string|bytestring, radix: number): f64 => {
658
659
  return n;
659
660
  };
660
661
 
661
- export const __Number_parseInt = (input: string|bytestring, radix: number): f64 => parseInt(input, radix);
662
+ export const __Number_parseInt = (input: any, radix: any): f64 => parseInt(input, radix);
@@ -1681,13 +1681,13 @@ export const BuiltinFuncs = function() {
1681
1681
  locals: [], localNames: ["_this","_this#type"],
1682
1682
  };
1683
1683
  this.parseInt = {
1684
- wasm: (scope, {builtin}) => [[32,2],[68,0,0,0,0,0,0,0,0],[97],[4,64],[68,0,0,0,0,0,0,36,64],[33,2],[11],[32,2],[68,0,0,0,0,0,0,0,64],[99],[34,4],[69],[4,127],[32,2],[68,0,0,0,0,0,0,66,64],[100],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[68,0,0,0,0,0,0,248,127],[65,1],[15],[11],[68,0,0,0,0,0,0,77,64],[33,6],[32,2],[68,0,0,0,0,0,0,36,64],[99],[4,64],[68,0,0,0,0,0,0,72,64],[32,2],[160],[33,6],[11],[68,0,0,0,0,0,0,248,127],[33,7],[32,0],[34,8],[252,2],[40,0,0],[183],[33,9],[32,8],[33,10],[68,0,0,0,0,0,0,0,0],[33,11],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,96,104,64],[97],[4,64],[32,10],[32,9],[160],[33,12],[32,10],[252,2],[45,0,4],[183],[34,13],[68,0,0,0,0,0,128,69,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,128,70,64],[97],[4,64],[68,0,0,0,0,0,0,240,63],[33,11],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,0,72,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,240,63],[160],[252,2],[45,0,4],[183],[34,14],[68,0,0,0,0,0,0,94,64],[97],[34,4],[69],[4,127],[32,14],[68,0,0,0,0,0,0,86,64],[97],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[68,0,0,0,0,0,0,48,64],[33,2],[11],[11],[3,64],[32,10],[32,12],[99],[4,64],[32,10],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[252,2],[45,0,4],[183],[34,15],[68,0,0,0,0,0,0,72,64],[102],[34,4],[4,127],[32,15],[32,6],[99],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,0,72,64],[161],[160],[33,7],[5],[32,2],[68,0,0,0,0,0,0,36,64],[100],[4,64],[32,15],[68,0,0,0,0,0,64,88,64],[102],[34,4],[4,127],[32,15],[68,0,0,0,0,0,192,85,64],[32,2],[160],[99],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,192,85,64],[161],[160],[33,7],[5],[32,15],[68,0,0,0,0,0,64,80,64],[102],[34,4],[4,127],[32,15],[68,0,0,0,0,0,128,75,64],[32,2],[160],[99],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,128,75,64],[161],[160],[33,7],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[32,10],[32,9],[68,0,0,0,0,0,0,0,64],[162],[160],[33,12],[32,10],[252,2],[47,0,4],[183],[34,13],[68,0,0,0,0,0,128,69,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,128,70,64],[97],[4,64],[68,0,0,0,0,0,0,240,63],[33,11],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,0,72,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,0,64],[160],[252,2],[47,0,4],[183],[34,14],[68,0,0,0,0,0,0,94,64],[97],[34,4],[69],[4,127],[32,14],[68,0,0,0,0,0,0,86,64],[97],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,10],[68,0,0,0,0,0,0,16,64],[160],[33,10],[68,0,0,0,0,0,0,48,64],[33,2],[11],[11],[3,64],[32,10],[32,12],[99],[4,64],[32,10],[252,2],[47,0,4],[183],[33,15],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[32,15],[68,0,0,0,0,0,0,72,64],[102],[34,4],[4,127],[32,15],[32,6],[99],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,0,72,64],[161],[160],[33,7],[5],[32,2],[68,0,0,0,0,0,0,36,64],[100],[4,64],[32,15],[68,0,0,0,0,0,64,88,64],[102],[34,4],[4,127],[32,15],[68,0,0,0,0,0,192,85,64],[32,2],[160],[99],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,192,85,64],[161],[160],[33,7],[5],[32,15],[68,0,0,0,0,0,64,80,64],[102],[34,4],[4,127],[32,15],[68,0,0,0,0,0,128,75,64],[32,2],[160],[99],[65,2],[33,5],[5],[32,4],[65,2],[33,5],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,128,75,64],[161],[160],[33,7],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15]],
1684
+ wasm: (scope, {builtin}) => [[32,2],[32,3],[16, ...builtin('__ecma262_ToIntegerOrInfinity')],[33,3],[34,2],[68,0,0,0,0,0,0,0,0],[97],[4,64],[68,0,0,0,0,0,0,36,64],[34,2],[65,1],[33,3],[26],[11],[32,2],[68,0,0,0,0,0,0,0,64],[99],[34,5],[69],[4,127],[32,2],[68,0,0,0,0,0,0,66,64],[100],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[68,0,0,0,0,0,0,248,127],[65,1],[15],[11],[68,0,0,0,0,0,0,77,64],[33,6],[32,2],[68,0,0,0,0,0,0,36,64],[99],[4,64],[68,0,0,0,0,0,0,72,64],[32,2],[160],[33,6],[11],[68,0,0,0,0,0,0,248,127],[33,7],[32,0],[34,8],[252,2],[40,0,0],[183],[33,9],[32,8],[33,10],[68,0,0,0,0,0,0,0,0],[33,11],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,96,104,64],[97],[4,64],[32,10],[32,9],[160],[33,12],[32,10],[252,2],[45,0,4],[183],[34,13],[68,0,0,0,0,0,128,69,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,128,70,64],[97],[4,64],[68,0,0,0,0,0,0,240,63],[33,11],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,0,72,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,240,63],[160],[252,2],[45,0,4],[183],[34,14],[68,0,0,0,0,0,0,94,64],[97],[34,5],[69],[4,127],[32,14],[68,0,0,0,0,0,0,86,64],[97],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[68,0,0,0,0,0,0,48,64],[34,2],[65,1],[33,3],[26],[11],[11],[3,64],[32,10],[32,12],[99],[4,64],[32,10],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[252,2],[45,0,4],[183],[34,15],[68,0,0,0,0,0,0,72,64],[102],[34,5],[4,127],[32,15],[32,6],[99],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,0,72,64],[161],[160],[33,7],[5],[32,2],[68,0,0,0,0,0,0,36,64],[100],[4,64],[32,15],[68,0,0,0,0,0,64,88,64],[102],[34,5],[4,127],[32,15],[68,0,0,0,0,0,192,85,64],[32,2],[160],[99],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,192,85,64],[161],[160],[33,7],[5],[32,15],[68,0,0,0,0,0,64,80,64],[102],[34,5],[4,127],[32,15],[68,0,0,0,0,0,128,75,64],[32,2],[160],[99],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,128,75,64],[161],[160],[33,7],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[32,10],[32,9],[68,0,0,0,0,0,0,0,64],[162],[160],[33,12],[32,10],[252,2],[47,0,4],[183],[34,13],[68,0,0,0,0,0,128,69,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,128,70,64],[97],[4,64],[68,0,0,0,0,0,0,240,63],[33,11],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[11],[32,13],[68,0,0,0,0,0,0,72,64],[97],[4,64],[32,10],[68,0,0,0,0,0,0,0,64],[160],[252,2],[47,0,4],[183],[34,14],[68,0,0,0,0,0,0,94,64],[97],[34,5],[69],[4,127],[32,14],[68,0,0,0,0,0,0,86,64],[97],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,10],[68,0,0,0,0,0,0,16,64],[160],[33,10],[68,0,0,0,0,0,0,48,64],[34,2],[65,1],[33,3],[26],[11],[11],[3,64],[32,10],[32,12],[99],[4,64],[32,10],[252,2],[47,0,4],[183],[33,15],[32,10],[68,0,0,0,0,0,0,0,64],[160],[33,10],[32,15],[68,0,0,0,0,0,0,72,64],[102],[34,5],[4,127],[32,15],[32,6],[99],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,0,72,64],[161],[160],[33,7],[5],[32,2],[68,0,0,0,0,0,0,36,64],[100],[4,64],[32,15],[68,0,0,0,0,0,64,88,64],[102],[34,5],[4,127],[32,15],[68,0,0,0,0,0,192,85,64],[32,2],[160],[99],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,192,85,64],[161],[160],[33,7],[5],[32,15],[68,0,0,0,0,0,64,80,64],[102],[34,5],[4,127],[32,15],[68,0,0,0,0,0,128,75,64],[32,2],[160],[99],[65,2],[33,4],[5],[32,5],[65,2],[33,4],[11],[4,64],[32,7],[16, ...builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[33,7],[11],[32,7],[32,2],[162],[34,7],[32,15],[68,0,0,0,0,0,128,75,64],[161],[160],[33,7],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,1],[15],[11],[32,7],[65,1],[15]],
1685
1685
  params: [124,127,124,127], typedParams: 1,
1686
1686
  returns: [124,127], typedReturns: 1,
1687
- locals: [127,127,124,124,124,124,124,124,124,124,124,124], localNames: ["input","input#type","radix","radix#type","logictmpi","#last_type","nMax","n","inputPtr","len","i","negative","endPtr","startChr","second","chr"],
1687
+ locals: [127,127,124,124,124,124,124,124,124,124,124,124], localNames: ["input","input#type","radix","radix#type","#last_type","logictmpi","nMax","n","inputPtr","len","i","negative","endPtr","startChr","second","chr"],
1688
1688
  };
1689
1689
  this.__Number_parseInt = {
1690
- wasm: (scope, {builtin}) => [[32,0],[32,1],[32,2],[65,1],[16, ...builtin('parseInt')],[34,4],[15]],
1690
+ wasm: (scope, {builtin}) => [[32,0],[32,1],[32,2],[32,3],[16, ...builtin('parseInt')],[34,4],[15]],
1691
1691
  params: [124,127,124,127], typedParams: 1,
1692
1692
  returns: [124,127], typedReturns: 1,
1693
1693
  locals: [127], localNames: ["input","input#type","radix","radix#type","#last_type"],
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.24.3+16e2dbe5f",
4
+ "version": "0.24.4+cf5eee48b",
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.24.3+16e2dbe5f';
3
+ globalThis.version = '0.24.4+cf5eee48b';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {