porffor 0.18.17 → 0.18.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.
@@ -531,6 +531,9 @@ export const __Array_prototype_toString = (_this: any[]) => {
531
531
  return out;
532
532
  };
533
533
 
534
+ // @porf-typed-array
535
+ export const __Array_prototype_toLocaleString = (_this: any[]) => __Array_prototype_toString(_this);
536
+
534
537
  // @porf-typed-array
535
538
  export const __Array_prototype_join = (_this: any[], _separator: any) => {
536
539
  // todo: this is bytestring only!
@@ -320,6 +320,8 @@ export const __Number_prototype_toFixed = (_this: number, fractionDigits: number
320
320
  return out;
321
321
  };
322
322
 
323
+ export const __Number_prototype_toLocaleString = (_this: number) => __Number_prototype_toString(_this, 10);
324
+
323
325
  // fractionDigits: number|any for rawType check
324
326
  export const __Number_prototype_toExponential = (_this: number, fractionDigits: number|any) => {
325
327
  let out: bytestring = Porffor.allocate();
@@ -518,3 +520,142 @@ export const __Number_prototype_valueOf = (_this: number) => {
518
520
  // 1. Return ? ThisNumberValue(this value).
519
521
  return _this;
520
522
  };
523
+
524
+
525
+ export const parseInt = (input: string|bytestring, radix: number): f64 => {
526
+ // todo/perf: optimize this instead of doing a naive algo (https://kholdstare.github.io/technical/2020/05/26/faster-integer-parsing.html)
527
+ // todo/perf: use i32s here once that becomes not annoying
528
+
529
+ if (radix == 0) radix = 10;
530
+ if (radix < 2 || radix > 36) return NaN;
531
+
532
+ let nMax: f64 = 58;
533
+ if (radix < 10) nMax = 48 + radix;
534
+
535
+ let n: f64 = NaN;
536
+
537
+ const inputPtr: f64 = Porffor.wasm`local.get ${input}`;
538
+ const len: f64 = Porffor.wasm.i32.load(inputPtr, 0, 0);
539
+ let i: f64 = inputPtr;
540
+
541
+ let negative: boolean = false;
542
+
543
+ if (Porffor.rawType(input) == Porffor.TYPES.bytestring) {
544
+ const endPtr: f64 = i + len;
545
+
546
+ // check start of string
547
+ const startChr: f64 = Porffor.wasm.i32.load8_u(i, 0, 4);
548
+
549
+ // +, ignore
550
+ if (startChr == 43) i++;
551
+
552
+ // -, switch to negative
553
+ if (startChr == 45) {
554
+ negative = true;
555
+ i++;
556
+ }
557
+
558
+ // 0, potential start of hex
559
+ if (startChr == 48) {
560
+ const second: f64 = Porffor.wasm.i32.load8_u(i + 1, 0, 4);
561
+ // 0x or 0X
562
+ if (second == 120 || second == 88) {
563
+ // set radix to 16 and skip leading 2 chars
564
+ i += 2;
565
+ radix = 16;
566
+ }
567
+ }
568
+
569
+ while (i < endPtr) {
570
+ const chr: f64 = Porffor.wasm.i32.load8_u(i++, 0, 4);
571
+
572
+ if (chr >= 48 && chr < nMax) {
573
+ if (Number.isNaN(n)) n = 0;
574
+
575
+ n *= radix;
576
+ n += chr - 48;
577
+ } else if (radix > 10) {
578
+ if (chr >= 97 && chr < (87 + radix)) {
579
+ if (Number.isNaN(n)) n = 0;
580
+
581
+ n *= radix;
582
+ n += chr - 87;
583
+ } else if (chr >= 65 && chr < (55 + radix)) {
584
+ if (Number.isNaN(n)) n = 0;
585
+
586
+ n *= radix;
587
+ n += chr - 55;
588
+ } else {
589
+ if (negative) return -n;
590
+ return n;
591
+ }
592
+ } else {
593
+ if (negative) return -n;
594
+ return n;
595
+ }
596
+ }
597
+
598
+ if (negative) return -n;
599
+ return n;
600
+ }
601
+
602
+ const endPtr: f64 = i + len * 2;
603
+
604
+ // check start of string
605
+ const startChr: f64 = Porffor.wasm.i32.load16_u(i, 0, 4);
606
+
607
+ // +, ignore
608
+ if (startChr == 43) i += 2;
609
+
610
+ // -, switch to negative
611
+ if (startChr == 45) {
612
+ negative = true;
613
+ i += 2;
614
+ }
615
+
616
+ // 0, potential start of hex
617
+ if (startChr == 48) {
618
+ const second: f64 = Porffor.wasm.i32.load16_u(i + 2, 0, 4);
619
+ // 0x or 0X
620
+ if (second == 120 || second == 88) {
621
+ // set radix to 16 and skip leading 2 chars
622
+ i += 4;
623
+ radix = 16;
624
+ }
625
+ }
626
+
627
+ while (i < endPtr) {
628
+ const chr: f64 = Porffor.wasm.i32.load16_u(i, 0, 4);
629
+ i += 2;
630
+
631
+ if (chr >= 48 && chr < nMax) {
632
+ if (Number.isNaN(n)) n = 0;
633
+
634
+ n *= radix;
635
+ n += chr - 48;
636
+ } else if (radix > 10) {
637
+ if (chr >= 97 && chr < (87 + radix)) {
638
+ if (Number.isNaN(n)) n = 0;
639
+
640
+ n *= radix;
641
+ n += chr - 87;
642
+ } else if (chr >= 65 && chr < (55 + radix)) {
643
+ if (Number.isNaN(n)) n = 0;
644
+
645
+ n *= radix;
646
+ n += chr - 55;
647
+ } else {
648
+ if (negative) return -n;
649
+ return n;
650
+ }
651
+ } else {
652
+ if (negative) return -n;
653
+ return n;
654
+ }
655
+ }
656
+
657
+ if (negative) return -n;
658
+ return n;
659
+ };
660
+
661
+ export const __Number_parseInt = (input: string|bytestring, radix: number): f64 => parseInt(input, radix);
@@ -3,4 +3,6 @@ import type {} from './porffor.d.ts';
3
3
  export const __Object_prototype_toString = (_this: object) => {
4
4
  let out: bytestring = '[object Object]';
5
5
  return out;
6
- };
6
+ };
7
+
8
+ export const __Object_prototype_toLocaleString = (_this: object) => __Object_prototype_toLocaleString(_this);
@@ -191,4 +191,6 @@ export const __Set_prototype_union = (_this: Set, other: any) => {
191
191
  export const __Set_prototype_toString = (_this: Set) => {
192
192
  const out: bytestring = '[object Set]';
193
193
  return out;
194
- };
194
+ };
195
+
196
+ export const __Set_prototype_toLocaleString = (_this: Set) => __Set_prototype_toString(_this);
@@ -1031,7 +1031,6 @@ export const __ByteString_prototype_trimEnd = (_this: bytestring) => {
1031
1031
  return out;
1032
1032
  };
1033
1033
 
1034
-
1035
1034
  export const __String_prototype_trim = (_this: string) => {
1036
1035
  // todo/perf: optimize and not just reuse
1037
1036
  return __String_prototype_trimStart(__String_prototype_trimEnd(_this));
@@ -1042,6 +1041,7 @@ export const __ByteString_prototype_trim = (_this: bytestring) => {
1042
1041
  return __ByteString_prototype_trimStart(__ByteString_prototype_trimEnd(_this));
1043
1042
  };
1044
1043
 
1044
+
1045
1045
  // 22.1.3.29 String.prototype.toString ()
1046
1046
  // https://tc39.es/ecma262/#sec-string.prototype.tostring
1047
1047
  export const __String_prototype_toString = (_this: string) => {
@@ -1054,6 +1054,8 @@ export const __ByteString_prototype_toString = (_this: bytestring) => {
1054
1054
  return _this;
1055
1055
  };
1056
1056
 
1057
+ export const __String_prototype_toLocaleString = (_this: string) => __String_prototype_toString(_this);
1058
+ export const __ByteString_prototype_toLocaleString = (_this: bytestring) => __ByteString_prototype_toString(_this);
1057
1059
 
1058
1060
  // 22.1.3.35 String.prototype.valueOf ()
1059
1061
  // https://tc39.es/ecma262/#sec-string.prototype.valueof
@@ -58,6 +58,8 @@ export const __Symbol_prototype_toString = (_this: Symbol) => {
58
58
  return out;
59
59
  };
60
60
 
61
+ export const __Symbol_prototype_toLocaleString = (_this: Symbol) => __Symbol_prototype_toString(_this);
62
+
61
63
  export const __Symbol_prototype_valueOf = (_this: Symbol) => {
62
64
  return _this;
63
65
  };
@@ -466,6 +466,15 @@ export const BuiltinFuncs = function() {
466
466
  locals: [124,127,124,124,124,124,127,127,124,127],
467
467
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
468
468
  };
469
+ this.__Array_prototype_toLocaleString = {
470
+ wasm: (scope, {builtin,}) => [[32,0],[65,208,0],[16, builtin('__Array_prototype_toString')],[34,2],[15]],
471
+ params: [124,127],
472
+ typedParams: true,
473
+ returns: [124,127],
474
+ typedReturns: true,
475
+ locals: [127],
476
+ localNames: ["_this","_this#type","#last_type"],
477
+ };
469
478
  this.__Array_prototype_join = {
470
479
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[65,9],[108],[32,0],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
471
480
  params: [124,127,124,127],
@@ -1399,15 +1408,6 @@ export const BuiltinFuncs = function() {
1399
1408
  localNames: ["_this","_this#type","out"],
1400
1409
  data: [{"bytes":[14,0,0,0,102,117,110,99,116,105,111,110,32,40,41,32,123,125],"offset":0}],
1401
1410
  };
1402
- this.parseInt = {
1403
- wasm: (scope, {builtin,}) => [[32,2],[65,0],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,0,0],[98],[4,64],[68,0,0,0,0,0,0,36,64],[33,2],[11],[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,1],[33,5],[5],[32,4],[65,1],[33,5],[11],[4,64],[68,0,0,0,0,0,0,248,127],[65,0],[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,64,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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,0],[15],[11],[32,7],[65,0],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,0],[15],[11],[32,7],[65,0],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[15]],
1404
- params: [124,127,124,127],
1405
- typedParams: true,
1406
- returns: [124,127],
1407
- typedReturns: true,
1408
- locals: [127,127,124,124,124,124,124,124,124,124,124,124],
1409
- localNames: ["input","input#type","radix","radix#type","logictmpi","#last_type","nMax","n","inputPtr","len","i","negative","endPtr","startChr","second","chr"],
1410
- };
1411
1411
  this.__Math_exp = {
1412
1412
  wasm: (scope, {builtin,}) => [[32,0],[16, builtin('__Number_isFinite')],[68,0,0,0,0,0,0,0,0],[97],[4,64],[32,0],[68,0,0,0,0,0,0,240,127],[154],[97],[4,64],[68,0,0,0,0,0,0,0,0],[65,0],[15],[11],[32,0],[65,0],[15],[11],[32,0],[68,0,0,0,0,0,0,0,0],[99],[4,64],[68,0,0,0,0,0,0,240,63],[32,0],[154],[65,0],[16, builtin('__Math_exp')],[33,2],[163],[65,0],[15],[11],[32,0],[68,239,57,250,254,66,46,230,63],[163],[16, builtin('__Math_floor')],[33,3],[32,0],[32,3],[68,239,57,250,254,66,46,230,63],[162],[161],[34,4],[33,5],[68,0,0,0,0,0,0,240,63],[32,4],[160],[33,6],[68,0,0,0,0,0,0,0,64],[33,7],[3,64],[32,5],[16, builtin('__Math_abs')],[68,22,86,231,158,175,3,210,60],[100],[4,64],[32,5],[32,4],[32,7],[163],[162],[33,5],[32,6],[32,5],[160],[33,6],[32,7],[68,0,0,0,0,0,0,240,63],[160],[33,7],[12,1],[11],[11],[3,64],[32,3],[32,3],[68,0,0,0,0,0,0,240,63],[161],[33,3],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[68,0,0,0,0,0,0,0,64],[162],[33,6],[12,1],[11],[11],[32,6],[65,0],[15]],
1413
1413
  params: [124,127],
@@ -1635,6 +1635,15 @@ export const BuiltinFuncs = function() {
1635
1635
  localNames: ["_this","_this#type","fractionDigits","fractionDigits#type","out","#last_type","outPtr","#makearray_pointer_tmp","logictmpi","i","digits","l","digitsPtr","endPtr","digit","decimal","j","__length_setter_tmp"],
1636
1636
  data: [{"bytes":[3,0,0,0,78,97,78],"offset":0}],
1637
1637
  };
1638
+ this.__Number_prototype_toLocaleString = {
1639
+ wasm: (scope, {builtin,}) => [[32,0],[65,0],[68,0,0,0,0,0,0,36,64],[65,0],[16, builtin('__Number_prototype_toString')],[34,2],[15]],
1640
+ params: [124,127],
1641
+ typedParams: true,
1642
+ returns: [124,127],
1643
+ typedReturns: true,
1644
+ locals: [127],
1645
+ localNames: ["_this","_this#type","#last_type"],
1646
+ };
1638
1647
  this.__Number_prototype_toExponential = {
1639
1648
  wasm: (scope, {allocPage,builtin,internalThrow,}) => [[16, builtin('__Porffor_allocate')],[33,5],[34,4],[33,6],[32,0],[16, builtin('__Number_isFinite')],[68,0,0,0,0,0,0,0,0],[97],[4,64],[32,0],[16, builtin('__Number_isNaN')],[252,3],[4,64],...number(allocPage(scope, 'bytestring: __Number_prototype_toExponential/out', 'i8') * pageSize, 124),[34,4],[65,194,1],[15],[11],[32,0],[68,0,0,0,0,0,0,240,127],[97],[4,64],[32,4],[252,3],[34,7],[65,8],[54,1,0],[32,7],[65,201,0],[58,0,4],[32,7],[65,238,0],[58,0,5],[32,7],[65,230,0],[58,0,6],[32,7],[65,233,0],[58,0,7],[32,7],[65,238,0],[58,0,8],[32,7],[65,233,0],[58,0,9],[32,7],[65,244,0],[58,0,10],[32,7],[65,249,0],[58,0,11],[32,7],[184],[34,4],[65,194,1],[15],[11],[32,4],[252,3],[34,7],[65,9],[54,1,0],[32,7],[65,45],[58,0,4],[32,7],[65,201,0],[58,0,5],[32,7],[65,238,0],[58,0,6],[32,7],[65,230,0],[58,0,7],[32,7],[65,233,0],[58,0,8],[32,7],[65,238,0],[58,0,9],[32,7],[65,233,0],[58,0,10],[32,7],[65,244,0],[58,0,11],[32,7],[65,249,0],[58,0,12],[32,7],[184],[34,4],[65,194,1],[15],[11],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,0,0],[98],[4,64],[68,0,0,0,0,0,0,0,0],[34,2],[65,3],[33,3],[26],[5],[32,2],[68,0,0,0,0,0,0,0,0],[16, builtin('f64_|')],[34,2],[65,0],[33,3],[26],[32,2],[68,0,0,0,0,0,0,0,0],[99],[34,8],[69],[4,127],[32,2],[68,0,0,0,0,0,0,89,64],[100],[65,1],[33,5],[5],[32,8],[65,1],[33,5],[11],[4,64],...internalThrow(scope, 'RangeError', `toExponential() fractionDigits argument must be between 0 and 100`),[11],[11],[32,0],[68,0,0,0,0,0,0,0,0],[99],[4,64],[32,0],[154],[33,0],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,45],[58,0,4],[11],[32,0],[33,9],...number(allocPage(scope, 'bytestring: __Number_prototype_toExponential/digits', 'i8') * pageSize, 124),[33,10],[68,0,0,0,0,0,0,0,0],[33,11],[68,0,0,0,0,0,0,0,0],[33,12],[32,0],[68,0,0,0,0,0,0,0,0],[97],[4,64],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,48],[58,0,4],[32,2],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,46],[58,0,4],[68,0,0,0,0,0,0,0,0],[33,15],[3,64],[32,15],[32,2],[99],[4,64],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,48],[58,0,4],[32,15],[68,0,0,0,0,0,0,240,63],[160],[33,15],[12,1],[11],[11],[11],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,229,0],[58,0,4],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,43],[58,0,4],[5],[32,0],[68,0,0,0,0,0,0,240,63],[99],[4,64],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,0,0],[98],[4,64],[68,0,0,0,0,0,0,240,63],[33,12],[3,64],[65,1],[4,64],[32,9],[68,0,0,0,0,0,0,36,64],[162],[34,9],[16, builtin('__Math_trunc')],[34,16],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,9],[32,16],[161],[68,187,189,215,217,223,124,219,61],[99],[4,64],[12,2],[11],[5],[32,12],[68,0,0,0,0,0,0,240,63],[160],[33,12],[11],[12,1],[11],[11],[5],[68,0,0,0,0,0,0,240,63],[33,12],[68,0,0,0,0,0,0,0,0],[33,15],[3,64],[32,15],[32,2],[101],[4,64],[32,9],[68,0,0,0,0,0,0,36,64],[162],[34,9],[16, builtin('__Math_trunc')],[34,16],[68,0,0,0,0,0,0,0,0],[97],[4,64],[32,12],[68,0,0,0,0,0,0,240,63],[160],[33,12],[5],[32,15],[68,0,0,0,0,0,0,240,63],[160],[33,15],[11],[12,1],[11],[11],[11],[3,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,9],[68,0,0,0,0,0,0,36,64],[16, builtin('f64_%')],[33,17],[32,9],[68,0,0,0,0,0,0,36,64],[163],[16, builtin('__Math_trunc')],[33,9],[32,10],[32,11],[160],[252,2],[32,17],[252,2],[58,0,4],[32,11],[68,0,0,0,0,0,0,240,63],[160],[33,11],[12,1],[11],[11],[32,10],[32,11],[160],[33,13],[32,6],[32,11],[160],[33,14],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,18],[3,64],[32,6],[32,14],[99],[4,64],[32,13],[68,0,0,0,0,0,0,240,63],[161],[34,13],[252,2],[45,0,4],[183],[33,17],[32,6],[32,18],[97],[4,64],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,46],[58,0,4],[32,14],[68,0,0,0,0,0,0,240,63],[160],[33,14],[11],[32,17],[68,0,0,0,0,0,0,36,64],[99],[4,64],[32,17],[68,0,0,0,0,0,0,72,64],[160],[33,17],[5],[32,17],[68,0,0,0,0,0,192,85,64],[160],[33,17],[11],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[32,17],[252,2],[58,0,4],[12,1],[11],[11],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,229,0],[58,0,4],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,45],[58,0,4],[5],[68,0,0,0,0,0,0,240,191],[33,12],[3,64],[32,9],[68,0,0,0,0,0,0,240,63],[102],[4,64],[32,9],[68,0,0,0,0,0,0,36,64],[163],[33,9],[32,12],[68,0,0,0,0,0,0,240,63],[160],[33,12],[12,1],[11],[11],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,0,0],[98],[4,64],[3,64],[65,1],[4,64],[32,9],[68,0,0,0,0,0,0,36,64],[162],[34,9],[16, builtin('__Math_trunc')],[34,16],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,9],[32,16],[161],[68,187,189,215,217,223,124,219,61],[99],[4,64],[12,2],[11],[5],[32,12],[68,0,0,0,0,0,0,240,63],[160],[33,12],[11],[12,1],[11],[11],[5],[68,0,0,0,0,0,0,0,0],[33,15],[3,64],[32,15],[32,2],[101],[4,64],[32,9],[68,0,0,0,0,0,0,36,64],[162],[33,9],[32,15],[68,0,0,0,0,0,0,240,63],[160],[33,15],[12,1],[11],[11],[11],[32,9],[16, builtin('__Math_round')],[33,9],[3,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,9],[68,0,0,0,0,0,0,36,64],[16, builtin('f64_%')],[33,17],[32,9],[68,0,0,0,0,0,0,36,64],[163],[16, builtin('__Math_trunc')],[33,9],[32,10],[32,11],[160],[252,2],[32,17],[252,2],[58,0,4],[32,11],[68,0,0,0,0,0,0,240,63],[160],[33,11],[12,1],[11],[11],[32,10],[32,11],[160],[33,13],[32,6],[32,11],[160],[33,14],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,18],[3,64],[32,6],[32,14],[99],[4,64],[32,6],[32,18],[97],[4,64],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,46],[58,0,4],[32,14],[68,0,0,0,0,0,0,240,63],[160],[33,14],[11],[32,13],[68,0,0,0,0,0,0,240,63],[161],[34,13],[252,2],[45,0,4],[183],[34,17],[68,0,0,0,0,0,0,36,64],[99],[4,64],[32,17],[68,0,0,0,0,0,0,72,64],[160],[33,17],[5],[32,17],[68,0,0,0,0,0,192,85,64],[160],[33,17],[11],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[32,17],[252,2],[58,0,4],[12,1],[11],[11],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,229,0],[58,0,4],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[65,43],[58,0,4],[11],[11],[32,12],[68,0,0,0,0,0,0,0,0],[97],[4,64],[32,10],[252,2],[65,0],[58,0,4],[68,0,0,0,0,0,0,240,63],[33,11],[5],[68,0,0,0,0,0,0,0,0],[33,11],[3,64],[32,12],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,10],[32,11],[160],[252,2],[32,12],[68,0,0,0,0,0,0,36,64],[16, builtin('f64_%')],[252,2],[58,0,4],[32,12],[68,0,0,0,0,0,0,36,64],[163],[16, builtin('__Math_trunc')],[33,12],[32,11],[68,0,0,0,0,0,0,240,63],[160],[33,11],[12,1],[11],[11],[11],[32,10],[32,11],[160],[33,13],[32,6],[32,11],[160],[33,14],[3,64],[32,6],[32,14],[99],[4,64],[32,13],[68,0,0,0,0,0,0,240,63],[161],[34,13],[252,2],[45,0,4],[183],[34,17],[68,0,0,0,0,0,0,36,64],[99],[4,64],[32,17],[68,0,0,0,0,0,0,72,64],[160],[33,17],[5],[32,17],[68,0,0,0,0,0,192,85,64],[160],[33,17],[11],[32,6],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[252,2],[32,17],[252,2],[58,0,4],[12,1],[11],[11],[32,4],[252,3],[32,6],[32,4],[161],[34,19],[252,3],[54,1,0],[32,4],[65,194,1],[15]],
1640
1649
  params: [124,127,124,127],
@@ -1654,6 +1663,24 @@ export const BuiltinFuncs = function() {
1654
1663
  locals: [],
1655
1664
  localNames: ["_this","_this#type"],
1656
1665
  };
1666
+ this.parseInt = {
1667
+ 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,1],[33,5],[5],[32,4],[65,1],[33,5],[11],[4,64],[68,0,0,0,0,0,0,248,127],[65,0],[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,64,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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,0],[15],[11],[32,7],[65,0],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,1],[33,5],[5],[32,4],[65,1],[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,0],[15],[11],[32,7],[65,0],[15],[11],[11],[5],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[15],[11],[11],[12,1],[11],[11],[32,11],[252,3],[4,64],[32,7],[154],[65,0],[15],[11],[32,7],[65,0],[15]],
1668
+ params: [124,127,124,127],
1669
+ typedParams: true,
1670
+ returns: [124,127],
1671
+ typedReturns: true,
1672
+ locals: [127,127,124,124,124,124,124,124,124,124,124,124],
1673
+ localNames: ["input","input#type","radix","radix#type","logictmpi","#last_type","nMax","n","inputPtr","len","i","negative","endPtr","startChr","second","chr"],
1674
+ };
1675
+ this.__Number_parseInt = {
1676
+ wasm: (scope, {builtin,}) => [[32,0],[32,1],[32,2],[65,0],[16, builtin('parseInt')],[34,4],[15]],
1677
+ params: [124,127,124,127],
1678
+ typedParams: true,
1679
+ returns: [124,127],
1680
+ typedReturns: true,
1681
+ locals: [127],
1682
+ localNames: ["input","input#type","radix","radix#type","#last_type"],
1683
+ };
1657
1684
  this.__Object_prototype_toString = {
1658
1685
  wasm: (scope, {allocPage,}) => [...number(allocPage(scope, 'bytestring: __Object_prototype_toString/out', 'i8') * pageSize, 124),[34,2],[65,194,1],[15]],
1659
1686
  params: [124,127],
@@ -1664,6 +1691,15 @@ export const BuiltinFuncs = function() {
1664
1691
  localNames: ["_this","_this#type","out"],
1665
1692
  data: [{"bytes":[15,0,0,0,91,111,98,106,101,99,116,32,79,98,106,101,99,116,93],"offset":0}],
1666
1693
  };
1694
+ this.__Object_prototype_toLocaleString = {
1695
+ wasm: (scope, {builtin,}) => [[32,0],[65,4],[16, builtin('__Object_prototype_toLocaleString')],[34,2],[15]],
1696
+ params: [124,127],
1697
+ typedParams: true,
1698
+ returns: [124,127],
1699
+ typedReturns: true,
1700
+ locals: [127],
1701
+ localNames: ["_this","_this#type","#last_type"],
1702
+ };
1667
1703
  this.__Porffor_allocate = {
1668
1704
  wasm: (scope, {}) => [[65,1],[64,0],[65,128,128,4],[108],[184],[65,0],[15]],
1669
1705
  params: [],
@@ -1783,6 +1819,15 @@ export const BuiltinFuncs = function() {
1783
1819
  localNames: ["_this","_this#type","out"],
1784
1820
  data: [{"bytes":[12,0,0,0,91,111,98,106,101,99,116,32,83,101,116,93],"offset":0}],
1785
1821
  };
1822
+ this.__Set_prototype_toLocaleString = {
1823
+ wasm: (scope, {builtin,}) => [[32,0],[65,19],[16, builtin('__Set_prototype_toString')],[34,2],[15]],
1824
+ params: [124,127],
1825
+ typedParams: true,
1826
+ returns: [124,127],
1827
+ typedReturns: true,
1828
+ locals: [127],
1829
+ localNames: ["_this","_this#type","#last_type"],
1830
+ };
1786
1831
  this.__String_prototype_toUpperCase = {
1787
1832
  wasm: (scope, {builtin,}) => [[32,0],[40,1,0],[33,2],[16, builtin('__Porffor_allocate')],[33,4],[252,2],[34,3],[32,2],[54,0,0],[32,0],[33,5],[32,3],[33,6],[32,5],[32,2],[65,2],[108],[106],[33,7],[3,64],[32,5],[32,7],[72],[4,64],[32,5],[47,0,4],[33,8],[32,5],[65,2],[106],[33,5],[32,8],[65,225,0],[78],[4,64],[32,8],[65,250,0],[76],[4,64],[32,8],[65,32],[107],[33,8],[11],[11],[32,6],[32,8],[59,0,4],[32,6],[65,2],[106],[33,6],[12,1],[11],[11],[32,3],[65,194,0],[15]],
1788
1833
  params: [127,127],
@@ -2071,6 +2116,24 @@ export const BuiltinFuncs = function() {
2071
2116
  locals: [],
2072
2117
  localNames: ["_this","_this#type"],
2073
2118
  };
2119
+ this.__String_prototype_toLocaleString = {
2120
+ wasm: (scope, {builtin,}) => [[32,0],[65,194,0],[16, builtin('__String_prototype_toString')],[34,2],[15]],
2121
+ params: [127,127],
2122
+ typedParams: true,
2123
+ returns: [127,127],
2124
+ typedReturns: true,
2125
+ locals: [127],
2126
+ localNames: ["_this","_this#type","#last_type"],
2127
+ };
2128
+ this.__ByteString_prototype_toLocaleString = {
2129
+ wasm: (scope, {builtin,}) => [[32,0],[65,194,1],[16, builtin('__ByteString_prototype_toString')],[34,2],[15]],
2130
+ params: [127,127],
2131
+ typedParams: true,
2132
+ returns: [127,127],
2133
+ typedReturns: true,
2134
+ locals: [127],
2135
+ localNames: ["_this","_this#type","#last_type"],
2136
+ };
2074
2137
  this.__String_prototype_valueOf = {
2075
2138
  wasm: (scope, {}) => [[32,0],[65,194,0],[15]],
2076
2139
  params: [127,127],
@@ -2145,6 +2208,15 @@ export const BuiltinFuncs = function() {
2145
2208
  locals: [124,127,124,124,124,124,124,124],
2146
2209
  localNames: ["_this","_this#type","out","#last_type","description","descLen","outPtr","descPtr","descPtrEnd","__length_setter_tmp"],
2147
2210
  };
2211
+ this.__Symbol_prototype_toLocaleString = {
2212
+ wasm: (scope, {builtin,}) => [[32,0],[65,6],[16, builtin('__Symbol_prototype_toString')],[34,2],[15]],
2213
+ params: [124,127],
2214
+ typedParams: true,
2215
+ returns: [124,127],
2216
+ typedReturns: true,
2217
+ locals: [127],
2218
+ localNames: ["_this","_this#type","#last_type"],
2219
+ };
2148
2220
  this.__Symbol_prototype_valueOf = {
2149
2221
  wasm: (scope, {}) => [[32,0],[65,6],[15]],
2150
2222
  params: [124,127],
@@ -2411,6 +2483,15 @@ export const BuiltinFuncs = function() {
2411
2483
  locals: [124,127,124,124,124,124,127,127,124,127],
2412
2484
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
2413
2485
  };
2486
+ this.__Uint8Array_prototype_toLocaleString = {
2487
+ wasm: (scope, {builtin,}) => [[32,0],[65,212,0],[16, builtin('__Uint8Array_prototype_toString')],[34,2],[15]],
2488
+ params: [124,127],
2489
+ typedParams: true,
2490
+ returns: [124,127],
2491
+ typedReturns: true,
2492
+ locals: [127],
2493
+ localNames: ["_this","_this#type","#last_type"],
2494
+ };
2414
2495
  this.__Uint8Array_prototype_join = {
2415
2496
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Uint8Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[106],[45,0,4],[184],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
2416
2497
  params: [124,127,124,127],
@@ -2678,6 +2759,15 @@ export const BuiltinFuncs = function() {
2678
2759
  locals: [124,127,124,124,124,124,127,127,124,127],
2679
2760
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
2680
2761
  };
2762
+ this.__Int8Array_prototype_toLocaleString = {
2763
+ wasm: (scope, {builtin,}) => [[32,0],[65,213,0],[16, builtin('__Int8Array_prototype_toString')],[34,2],[15]],
2764
+ params: [124,127],
2765
+ typedParams: true,
2766
+ returns: [124,127],
2767
+ typedReturns: true,
2768
+ locals: [127],
2769
+ localNames: ["_this","_this#type","#last_type"],
2770
+ };
2681
2771
  this.__Int8Array_prototype_join = {
2682
2772
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Int8Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[106],[44,0,4],[183],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
2683
2773
  params: [124,127,124,127],
@@ -2945,6 +3035,15 @@ export const BuiltinFuncs = function() {
2945
3035
  locals: [124,127,124,124,124,124,127,127,124,127],
2946
3036
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
2947
3037
  };
3038
+ this.__Uint8ClampedArray_prototype_toLocaleString = {
3039
+ wasm: (scope, {builtin,}) => [[32,0],[65,214,0],[16, builtin('__Uint8ClampedArray_prototype_toString')],[34,2],[15]],
3040
+ params: [124,127],
3041
+ typedParams: true,
3042
+ returns: [124,127],
3043
+ typedReturns: true,
3044
+ locals: [127],
3045
+ localNames: ["_this","_this#type","#last_type"],
3046
+ };
2948
3047
  this.__Uint8ClampedArray_prototype_join = {
2949
3048
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Uint8ClampedArray_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[106],[45,0,4],[184],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
2950
3049
  params: [124,127,124,127],
@@ -3212,6 +3311,15 @@ export const BuiltinFuncs = function() {
3212
3311
  locals: [124,127,124,124,124,124,127,127,124,127],
3213
3312
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
3214
3313
  };
3314
+ this.__Uint16Array_prototype_toLocaleString = {
3315
+ wasm: (scope, {builtin,}) => [[32,0],[65,215,0],[16, builtin('__Uint16Array_prototype_toString')],[34,2],[15]],
3316
+ params: [124,127],
3317
+ typedParams: true,
3318
+ returns: [124,127],
3319
+ typedReturns: true,
3320
+ locals: [127],
3321
+ localNames: ["_this","_this#type","#last_type"],
3322
+ };
3215
3323
  this.__Uint16Array_prototype_join = {
3216
3324
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Uint16Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
3217
3325
  params: [124,127,124,127],
@@ -3479,6 +3587,15 @@ export const BuiltinFuncs = function() {
3479
3587
  locals: [124,127,124,124,124,124,127,127,124,127],
3480
3588
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
3481
3589
  };
3590
+ this.__Int16Array_prototype_toLocaleString = {
3591
+ wasm: (scope, {builtin,}) => [[32,0],[65,216,0],[16, builtin('__Int16Array_prototype_toString')],[34,2],[15]],
3592
+ params: [124,127],
3593
+ typedParams: true,
3594
+ returns: [124,127],
3595
+ typedReturns: true,
3596
+ locals: [127],
3597
+ localNames: ["_this","_this#type","#last_type"],
3598
+ };
3482
3599
  this.__Int16Array_prototype_join = {
3483
3600
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Int16Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
3484
3601
  params: [124,127,124,127],
@@ -3746,6 +3863,15 @@ export const BuiltinFuncs = function() {
3746
3863
  locals: [124,127,124,124,124,124,127,127,124,127],
3747
3864
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
3748
3865
  };
3866
+ this.__Uint32Array_prototype_toLocaleString = {
3867
+ wasm: (scope, {builtin,}) => [[32,0],[65,217,0],[16, builtin('__Uint32Array_prototype_toString')],[34,2],[15]],
3868
+ params: [124,127],
3869
+ typedParams: true,
3870
+ returns: [124,127],
3871
+ typedReturns: true,
3872
+ locals: [127],
3873
+ localNames: ["_this","_this#type","#last_type"],
3874
+ };
3749
3875
  this.__Uint32Array_prototype_join = {
3750
3876
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Uint32Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
3751
3877
  params: [124,127,124,127],
@@ -4013,6 +4139,15 @@ export const BuiltinFuncs = function() {
4013
4139
  locals: [124,127,124,124,124,124,127,127,124,127],
4014
4140
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
4015
4141
  };
4142
+ this.__Int32Array_prototype_toLocaleString = {
4143
+ wasm: (scope, {builtin,}) => [[32,0],[65,218,0],[16, builtin('__Int32Array_prototype_toString')],[34,2],[15]],
4144
+ params: [124,127],
4145
+ typedParams: true,
4146
+ returns: [124,127],
4147
+ typedReturns: true,
4148
+ locals: [127],
4149
+ localNames: ["_this","_this#type","#last_type"],
4150
+ };
4016
4151
  this.__Int32Array_prototype_join = {
4017
4152
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Int32Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
4018
4153
  params: [124,127,124,127],
@@ -4280,6 +4415,15 @@ export const BuiltinFuncs = function() {
4280
4415
  locals: [124,127,124,124,124,124,127,127,124,127],
4281
4416
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
4282
4417
  };
4418
+ this.__Float32Array_prototype_toLocaleString = {
4419
+ wasm: (scope, {builtin,}) => [[32,0],[65,219,0],[16, builtin('__Float32Array_prototype_toString')],[34,2],[15]],
4420
+ params: [124,127],
4421
+ typedParams: true,
4422
+ returns: [124,127],
4423
+ typedReturns: true,
4424
+ locals: [127],
4425
+ localNames: ["_this","_this#type","#last_type"],
4426
+ };
4283
4427
  this.__Float32Array_prototype_join = {
4284
4428
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Float32Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
4285
4429
  params: [124,127,124,127],
@@ -4547,6 +4691,15 @@ export const BuiltinFuncs = function() {
4547
4691
  locals: [124,127,124,124,124,124,127,127,124,127],
4548
4692
  localNames: ["_this","_this#type","out","#last_type","__length_setter_tmp","len","i","element","element#type","#loadArray_offset","type","logictmpi"],
4549
4693
  };
4694
+ this.__Float64Array_prototype_toLocaleString = {
4695
+ wasm: (scope, {builtin,}) => [[32,0],[65,220,0],[16, builtin('__Float64Array_prototype_toString')],[34,2],[15]],
4696
+ params: [124,127],
4697
+ typedParams: true,
4698
+ returns: [124,127],
4699
+ typedReturns: true,
4700
+ locals: [127],
4701
+ localNames: ["_this","_this#type","#last_type"],
4702
+ };
4550
4703
  this.__Float64Array_prototype_join = {
4551
4704
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Float64Array_prototype_join/separator', 'i8') * pageSize, 124),[33,4],[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,2],[32,3],[16, builtin('__ecma262_ToString')],[33,5],[33,4],[11],[16, builtin('__Porffor_allocate')],[33,5],[34,6],[252,3],[68,0,0,0,0,0,0,0,0],[34,7],[252,3],[54,1,0],[32,0],[252,3],[40,1,0],[184],[33,8],[68,0,0,0,0,0,0,0,0],[33,9],[3,64],[32,9],[32,8],[99],[4,64],[32,9],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[65,194,1],[32,4],[65,194,1],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[32,0],[252,3],[32,9],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[252,3],[65,8],[108],[106],[43,0,4],[65,0],[33,5],[33,10],[32,5],[33,11],[32,10],[32,11],[16, builtin('__Porffor_rawType')],[33,13],[32,10],[68,0,0,0,0,0,0,0,0],[98],[34,14],[69],[4,127],[32,13],[68,0,0,0,0,0,0,8,64],[98],[32,13],[68,0,0,0,0,0,0,16,64],[98],[113],[65,1],[33,5],[5],[32,14],[65,1],[33,5],[11],[4,64],[32,6],[65,194,1],[32,10],[32,11],[16, builtin('__ecma262_ToString')],[34,5],[16, builtin('__Porffor_bytestring_appendStr')],[33,5],[26],[11],[12,1],[11],[11],[32,6],[65,194,1],[15]],
4552
4705
  params: [124,127,124,127],
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.18.17+4d4df7afe",
4
+ "version": "0.18.18+98f1104a9",
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.18.17+4d4df7afe';
3
+ globalThis.version = '0.18.18+98f1104a9';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
@@ -1,147 +0,0 @@
1
- import type {} from './porffor.d.ts';
2
-
3
- // radix: number|any for rawType check
4
- // export const parseInt = (input: string|bytestring, radix: number|any): f64 => {
5
- export const parseInt = (input: string|bytestring, radix: number): f64 => {
6
- // todo/perf: optimize this instead of doing a naive algo (https://kholdstare.github.io/technical/2020/05/26/faster-integer-parsing.html)
7
- // todo/perf: use i32s here once that becomes not annoying
8
-
9
- if (Porffor.rawType(radix) != Porffor.TYPES.number) {
10
- // todo: string to number
11
- radix = 10;
12
- }
13
-
14
- if (radix == 0) radix = 10;
15
- if (radix < 2 || radix > 36) return NaN;
16
-
17
- let nMax: f64 = 58;
18
- if (radix < 10) nMax = 48 + radix;
19
-
20
- // if (Porffor.rawType(input) == Porffor.TYPES.bytestring) input = __ByteString_prototype_trimStart(input);
21
- // else input = __String_prototype_trimStart(input);
22
-
23
- let n: f64 = NaN;
24
-
25
- const inputPtr: f64 = Porffor.wasm`local.get ${input}`;
26
- const len: f64 = Porffor.wasm.i32.load(inputPtr, 0, 0);
27
- let i: f64 = inputPtr;
28
-
29
- let negative: boolean = false;
30
-
31
- if (Porffor.rawType(input) == Porffor.TYPES.bytestring) {
32
- const endPtr: f64 = i + len;
33
-
34
- // check start of string
35
- const startChr: f64 = Porffor.wasm.i32.load8_u(i, 0, 4);
36
-
37
- // +, ignore
38
- if (startChr == 43) i++;
39
-
40
- // -, switch to negative
41
- if (startChr == 45) {
42
- negative = true;
43
- i++;
44
- }
45
-
46
- // 0, potential start of hex
47
- if (startChr == 48) {
48
- const second: f64 = Porffor.wasm.i32.load8_u(i + 1, 0, 4);
49
- // 0x or 0X
50
- if (second == 120 || second == 88) {
51
- // set radix to 16 and skip leading 2 chars
52
- i += 2;
53
- radix = 16;
54
- }
55
- }
56
-
57
- while (i < endPtr) {
58
- const chr: f64 = Porffor.wasm.i32.load8_u(i++, 0, 4);
59
-
60
- if (chr >= 48 && chr < nMax) {
61
- if (Number.isNaN(n)) n = 0;
62
-
63
- n *= radix;
64
- n += chr - 48;
65
- } else if (radix > 10) {
66
- if (chr >= 97 && chr < (87 + radix)) {
67
- if (Number.isNaN(n)) n = 0;
68
-
69
- n *= radix;
70
- n += chr - 87;
71
- } else if (chr >= 65 && chr < (55 + radix)) {
72
- if (Number.isNaN(n)) n = 0;
73
-
74
- n *= radix;
75
- n += chr - 55;
76
- } else {
77
- if (negative) return -n;
78
- return n;
79
- }
80
- } else {
81
- if (negative) return -n;
82
- return n;
83
- }
84
- }
85
-
86
- if (negative) return -n;
87
- return n;
88
- }
89
-
90
- const endPtr: f64 = i + len * 2;
91
-
92
- // check start of string
93
- const startChr: f64 = Porffor.wasm.i32.load16_u(i, 0, 4);
94
-
95
- // +, ignore
96
- if (startChr == 43) i += 2;
97
-
98
- // -, switch to negative
99
- if (startChr == 45) {
100
- negative = true;
101
- i += 2;
102
- }
103
-
104
- // 0, potential start of hex
105
- if (startChr == 48) {
106
- const second: f64 = Porffor.wasm.i32.load16_u(i + 2, 0, 4);
107
- // 0x or 0X
108
- if (second == 120 || second == 88) {
109
- // set radix to 16 and skip leading 2 chars
110
- i += 4;
111
- radix = 16;
112
- }
113
- }
114
-
115
- while (i < endPtr) {
116
- const chr: f64 = Porffor.wasm.i32.load16_u(i, 0, 4);
117
- i += 2;
118
-
119
- if (chr >= 48 && chr < nMax) {
120
- if (Number.isNaN(n)) n = 0;
121
-
122
- n *= radix;
123
- n += chr - 48;
124
- } else if (radix > 10) {
125
- if (chr >= 97 && chr < (87 + radix)) {
126
- if (Number.isNaN(n)) n = 0;
127
-
128
- n *= radix;
129
- n += chr - 87;
130
- } else if (chr >= 65 && chr < (55 + radix)) {
131
- if (Number.isNaN(n)) n = 0;
132
-
133
- n *= radix;
134
- n += chr - 55;
135
- } else {
136
- if (negative) return -n;
137
- return n;
138
- }
139
- } else {
140
- if (negative) return -n;
141
- return n;
142
- }
143
- }
144
-
145
- if (negative) return -n;
146
- return n;
147
- };