porffor 0.18.25 → 0.18.27

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.
@@ -382,6 +382,22 @@ export const __Array_prototype_map = (_this: any[], callbackFn: any) => {
382
382
  return out;
383
383
  };
384
384
 
385
+ export const __Array_prototype_flatMap = (_this: any[], callbackFn: any) => {
386
+ const len: i32 = _this.length;
387
+ const out: any[] = Porffor.allocate();
388
+
389
+ let i: i32 = 0, j: i32 = 0;
390
+ while (i < len) {
391
+ let x: any = callbackFn(_this[i], i++, _this);
392
+ if (Porffor.rawType(x) == Porffor.TYPES.array) {
393
+ for (const y of x) out[j++] = y;
394
+ } else out[j++] = x;
395
+ }
396
+
397
+ out.length = j;
398
+ return out;
399
+ };
400
+
385
401
  // @porf-typed-array
386
402
  export const __Array_prototype_find = (_this: any[], callbackFn: any) => {
387
403
  const len: i32 = _this.length;
@@ -606,7 +622,90 @@ export const __Array_prototype_toSorted = (_this: any[], callbackFn: any) => {
606
622
  return __Array_prototype_sort(out, callbackFn);
607
623
  };
608
624
 
609
- // todo: toSpliced
625
+ export const __Array_prototype_toSpliced = (_this: any[], start: number, deleteCount: any, ...items: any[]) => {
626
+ let out: any[] = Porffor.allocate();
627
+ Porffor.clone(_this, out);
628
+
629
+ const len: i32 = _this.length;
630
+
631
+ start |= 0;
632
+ if (start < 0) {
633
+ start = len + start;
634
+ if (start < 0) start = 0;
635
+ }
636
+ if (start > len) start = len;
637
+
638
+ if (Porffor.rawType(deleteCount) == Porffor.TYPES.undefined) deleteCount = len - start;
639
+ deleteCount |= 0;
640
+
641
+ if (deleteCount < 0) deleteCount = 0;
642
+ if (deleteCount > len - start) deleteCount = len - start;
643
+
644
+ // update this length
645
+ const itemsLen: i32 = items.length;
646
+ out.length = len - deleteCount + itemsLen;
647
+
648
+ // remove deleted values via memory.copy shifting values in mem
649
+ Porffor.wasm`;; ptr = ptr(_this) + 4 + (start * 9)
650
+ local #splice_ptr i32
651
+ local.get ${out}
652
+ i32.to_u
653
+ i32.const 4
654
+ i32.add
655
+ local.get ${start}
656
+ i32.to_u
657
+ i32.const 9
658
+ i32.mul
659
+ i32.add
660
+ local.set #splice_ptr
661
+
662
+ ;; dst = ptr + itemsLen * 9
663
+ local.get #splice_ptr
664
+ local.get ${itemsLen}
665
+ i32.to_u
666
+ i32.const 9
667
+ i32.mul
668
+ i32.add
669
+
670
+ ;; src = ptr + deleteCount * 9
671
+ local.get #splice_ptr
672
+ local.get ${deleteCount}
673
+ i32.to_u
674
+ i32.const 9
675
+ i32.mul
676
+ i32.add
677
+
678
+ ;; size = (len - start - deleteCount) * 9
679
+ local.get ${len}
680
+ i32.to_u
681
+ local.get ${start}
682
+ i32.to_u
683
+ local.get ${deleteCount}
684
+ i32.to_u
685
+ i32.sub
686
+ i32.sub
687
+ i32.const 9
688
+ i32.mul
689
+
690
+ memory.copy 0 0`;
691
+
692
+ if (itemsLen > 0) {
693
+ let itemsPtr: i32 = Porffor.wasm`local.get ${items}`;
694
+ let outPtr: i32 = Porffor.wasm`local.get ${out}` + start * 9;
695
+ let outPtrEnd: i32 = outPtr + itemsLen * 9;
696
+
697
+ while (outPtr < outPtrEnd) {
698
+ Porffor.wasm.f64.store(outPtr, Porffor.wasm.f64.load(itemsPtr, 0, 4), 0, 4);
699
+ Porffor.wasm.i32.store8(outPtr, Porffor.wasm.i32.load8_u(itemsPtr, 0, 12), 0, 12);
700
+
701
+ outPtr += 9;
702
+ itemsPtr += 9;
703
+ }
704
+ }
705
+
706
+ return out;
707
+ };
708
+
610
709
 
611
710
  export const __Array_prototype_flat = (_this: any[], depth: any) => {
612
711
  if (Porffor.rawType(depth) == Porffor.TYPES.undefined) depth = 1;
@@ -248,6 +248,13 @@ export const BuiltinFuncs = function() {
248
248
  locals: [124,124,127,124,124,124,127,127,127,124,127,124,127,124,127,127,127], localNames: ["_this","_this#type","callbackFn","callbackFn#type","len","out","#last_type","__length_setter_tmp","i","#member_setter_val_tmp","#member_setter_ptr_tmp","#loadArray_offset","#indirect_arg0_type","#indirect_arg0_val","#indirect_arg1_type","#indirect_arg1_val","#indirect_arg2_type","#indirect_arg2_val","#indirect_func","#indirect_flags","#typeswitch_tmp"],
249
249
  table: 1,
250
250
  };
251
+ this.__Array_prototype_flatMap = {
252
+ wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,3],[40,1,0],[184],[33,4],[16, builtin('__Porffor_allocate')],[33,6],[33,5],[68,0,0,0,0,0,0,0,0],[33,7],[68,0,0,0,0,0,0,0,0],[33,8],[3,64],[32,7],[32,4],[99],[4,64],[32,3],[33,20],[2,124],[32,20],[65,5],[70],[4,64,"TYPESWITCH|Function"],[32,7],[252,3],[65,9],[108],[32,0],[252,3],[106],[34,11],[43,0,4],[32,11],[45,0,12],[34,6],[33,12],[33,13],[32,7],[32,7],[68,0,0,0,0,0,0,240,63],[160],[33,7],[32,6],[33,14],[33,15],[32,0],[65,208,0],[33,16],[33,17],[32,2],[252,3],[34,18],[65,3],[108],[65,2],[106],[45,0,0,"read func lut"],[34,19],[65,2],[113],[69],[65,0],[113],[4,64],...internalThrow(scope, 'TypeError', `callbackFn is not a constructor`),[11],[2,124],[2,64],[2,64],[2,64],[2,64],[32,18],[65,3],[108],[47,0,0,"read func lut"],[14,4,0,1,2,3,0],[11],[32,19],[65,1],[113],[4,124],[32,19],[65,2],[113],[4,124],[65,0],[32,18],[17,0,0,"no_type_return","constr"],[5],[32,18],[17,0,0,"no_type_return"],[11],[5],[32,19],[65,2],[113],[4,124],[65,0],[32,18],[17,0,0,"constr"],[33,6],[5],[32,18],[17,0,0],[33,6],[11],[11],[12,3],[11],[32,19],[65,1],[113],[4,124],[32,19],[65,2],[113],[4,124],[65,0],[32,13],[32,12],[32,18],[17,1,0,"no_type_return","constr"],[5],[32,13],[32,12],[32,18],[17,1,0,"no_type_return"],[11],[5],[32,19],[65,2],[113],[4,124],[65,0],[32,13],[32,12],[32,18],[17,1,0,"constr"],[33,6],[5],[32,13],[32,12],[32,18],[17,1,0],[33,6],[11],[11],[12,2],[11],[32,19],[65,1],[113],[4,124],[32,19],[65,2],[113],[4,124],[65,0],[32,13],[32,12],[32,15],[32,14],[32,18],[17,2,0,"no_type_return","constr"],[5],[32,13],[32,12],[32,15],[32,14],[32,18],[17,2,0,"no_type_return"],[11],[5],[32,19],[65,2],[113],[4,124],[65,0],[32,13],[32,12],[32,15],[32,14],[32,18],[17,2,0,"constr"],[33,6],[5],[32,13],[32,12],[32,15],[32,14],[32,18],[17,2,0],[33,6],[11],[11],[12,1],[11],[32,19],[65,1],[113],[4,124],[32,19],[65,2],[113],[4,124],[65,0],[32,13],[32,12],[32,15],[32,14],[32,17],[32,16],[32,18],[17,3,0,"no_type_return","constr"],[5],[32,13],[32,12],[32,15],[32,14],[32,17],[32,16],[32,18],[17,3,0,"no_type_return"],[11],[5],[32,19],[65,2],[113],[4,124],[65,0],[32,13],[32,12],[32,15],[32,14],[32,17],[32,16],[32,18],[17,3,0,"constr"],[33,6],[5],[32,13],[32,12],[32,15],[32,14],[32,17],[32,16],[32,18],[17,3,0],[33,6],[11],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `callbackFn is not a function`),[68,0,0,0,0,0,0,0,0],[11,"TYPESWITCH_end"],[33,9],[32,6],[33,10],[32,9],[32,10],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,84,64],[97],[4,64],[32,9],[252,3],[33,21],[65,0],[33,23],[32,21],[40,1,0],[33,22],[32,10],[33,20],[2,64],[32,20],[65,19],[70],[4,64,"TYPESWITCH|Set"],[3,64],[32,21],[43,0,4],[32,21],[45,0,12],[33,25],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,21],[65,9],[106],[33,21],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[65,194,0],[33,25],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,21],[47,0,4],[59,0,4],[68,0,0,0,0,0,0,0,0],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,21],[65,2],[106],[33,21],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[3,64],[32,21],[43,0,4],[32,21],[45,0,12],[33,25],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,21],[65,9],[106],[33,21],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[106],[45,0,4],[184],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[106],[44,0,4],[183],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[106],[45,0,4],[184],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[65,2],[108],[106],[47,0,4],[184],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[65,2],[108],[106],[46,0,4],[183],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[65,4],[108],[106],[40,0,4],[184],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[65,4],[108],[106],[40,0,4],[183],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[65,4],[108],[106],[42,0,4],[187],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[65,0],[33,25],[3,64],[32,21],[40,0,4],[32,23],[65,8],[108],[106],[43,0,4],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],[32,20],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[65,194,1],[33,25],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,21],[32,23],[106],[45,0,4],[58,0,4],[68,0,0,0,0,0,0,0,0],[33,24],[2,64],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,24],[34,26],[57,0,4],[32,27],[32,25],[58,0,12],[32,23],[65,1],[106],[34,23],[32,22],[71],[13,1],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `Tried for..of on non-iterable type`),[11,"TYPESWITCH_end"],[5],[32,5],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,27],[32,9],[34,26],[57,0,4],[32,27],[32,10],[58,0,12],[11],[12,1],[11],[11],[32,5],[252,3],[32,8],[34,28],[252,3],[54,1,0],[32,5],[65,208,0],[15]],
253
+ params: [124,127,124,127], typedParams: 1,
254
+ returns: [124,127], typedReturns: 1,
255
+ locals: [124,124,127,124,124,124,127,127,127,124,127,124,127,124,127,127,127,127,127,127,124,127,124,127,124], localNames: ["_this","_this#type","callbackFn","callbackFn#type","len","out","#last_type","i","j","x","x#type","#loadArray_offset","#indirect_arg0_type","#indirect_arg0_val","#indirect_arg1_type","#indirect_arg1_val","#indirect_arg2_type","#indirect_arg2_val","#indirect_func","#indirect_flags","#typeswitch_tmp","forof_base_pointer","forof_length","forof_counter","y","y#type","#member_setter_val_tmp","#member_setter_ptr_tmp","__length_setter_tmp"],
256
+ table: 1,
257
+ };
251
258
  this.__Array_prototype_find = {
252
259
  wasm: (scope, {internalThrow}) => [[32,0],[252,3],[40,1,0],[184],[33,4],[68,0,0,0,0,0,0,0,0],[33,5],[3,64],[32,5],[32,4],[99],[4,64],[32,5],[252,3],[65,9],[108],[32,0],[252,3],[106],[34,8],[43,0,4],[32,8],[45,0,12],[33,9],[33,6],[32,9],[33,7],[32,3],[33,18],[2,124],[32,18],[65,5],[70],[4,64,"TYPESWITCH|Function"],[32,6],[32,7],[33,10],[33,11],[32,5],[32,5],[68,0,0,0,0,0,0,240,63],[160],[33,5],[32,9],[33,12],[33,13],[32,0],[65,208,0],[33,14],[33,15],[32,2],[252,3],[34,16],[65,3],[108],[65,2],[106],[45,0,0,"read func lut"],[34,17],[65,2],[113],[69],[65,0],[113],[4,64],...internalThrow(scope, 'TypeError', `callbackFn is not a constructor`),[11],[2,124],[2,64],[2,64],[2,64],[2,64],[32,16],[65,3],[108],[47,0,0,"read func lut"],[14,4,0,1,2,3,0],[11],[32,17],[65,1],[113],[4,124],[32,17],[65,2],[113],[4,124],[65,0],[32,16],[17,0,0,"no_type_return","constr"],[5],[32,16],[17,0,0,"no_type_return"],[11],[5],[32,17],[65,2],[113],[4,124],[65,0],[32,16],[17,0,0,"constr"],[33,9],[5],[32,16],[17,0,0],[33,9],[11],[11],[12,3],[11],[32,17],[65,1],[113],[4,124],[32,17],[65,2],[113],[4,124],[65,0],[32,11],[32,10],[32,16],[17,1,0,"no_type_return","constr"],[5],[32,11],[32,10],[32,16],[17,1,0,"no_type_return"],[11],[5],[32,17],[65,2],[113],[4,124],[65,0],[32,11],[32,10],[32,16],[17,1,0,"constr"],[33,9],[5],[32,11],[32,10],[32,16],[17,1,0],[33,9],[11],[11],[12,2],[11],[32,17],[65,1],[113],[4,124],[32,17],[65,2],[113],[4,124],[65,0],[32,11],[32,10],[32,13],[32,12],[32,16],[17,2,0,"no_type_return","constr"],[5],[32,11],[32,10],[32,13],[32,12],[32,16],[17,2,0,"no_type_return"],[11],[5],[32,17],[65,2],[113],[4,124],[65,0],[32,11],[32,10],[32,13],[32,12],[32,16],[17,2,0,"constr"],[33,9],[5],[32,11],[32,10],[32,13],[32,12],[32,16],[17,2,0],[33,9],[11],[11],[12,1],[11],[32,17],[65,1],[113],[4,124],[32,17],[65,2],[113],[4,124],[65,0],[32,11],[32,10],[32,13],[32,12],[32,15],[32,14],[32,16],[17,3,0,"no_type_return","constr"],[5],[32,11],[32,10],[32,13],[32,12],[32,15],[32,14],[32,16],[17,3,0,"no_type_return"],[11],[5],[32,17],[65,2],[113],[4,124],[65,0],[32,11],[32,10],[32,13],[32,12],[32,15],[32,14],[32,16],[17,3,0,"constr"],[33,9],[5],[32,11],[32,10],[32,13],[32,12],[32,15],[32,14],[32,16],[17,3,0],[33,9],[11],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `callbackFn is not a function`),[68,0,0,0,0,0,0,0,0],[11,"TYPESWITCH_end"],[33,19],[32,9],[33,18],[2,124],[32,18],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,19],[252,3],[40,1,0],[184],[12,1],[11],[32,18],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,19],[252,3],[40,1,0],[184],[12,1],[11],[32,19],[252,2],[69],[69],[183],[11,"TYPESWITCH_end"],[252,3],[4,64],[32,6],[32,7],[15],[11],[12,1],[11],[11],[68,0,0,0,0,0,0,0,0],[65,3],[15]],
253
260
  params: [124,127,124,127], typedParams: 1,
@@ -348,6 +355,13 @@ export const BuiltinFuncs = function() {
348
355
  returns: [124,127], typedReturns: 1,
349
356
  locals: [124,127], localNames: ["_this","_this#type","callbackFn","callbackFn#type","out","#last_type"],
350
357
  };
358
+ this.__Array_prototype_toSpliced = {
359
+ wasm: (scope, {builtin}) => [[16, builtin('__Porffor_allocate')],[33,9],[33,8],[32,0],[32,8],[16, builtin('__Porffor_clone')],[32,0],[252,3],[40,1,0],[184],[33,10],[32,2],[68,0,0,0,0,0,0,0,0],[16, builtin('f64_|')],[34,2],[68,0,0,0,0,0,0,0,0],[99],[4,64],[32,10],[32,2],[160],[34,2],[68,0,0,0,0,0,0,0,0],[99],[4,64],[68,0,0,0,0,0,0,0,0],[33,2],[11],[11],[32,2],[32,10],[100],[4,64],[32,10],[33,2],[11],[32,4],[32,5],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[97],[4,64],[32,10],[32,2],[161],[34,4],[65,0],[33,5],[26],[11],[32,4],[68,0,0,0,0,0,0,0,0],[16, builtin('f64_|')],[34,4],[65,0],[33,5],[26],[32,4],[68,0,0,0,0,0,0,0,0],[99],[4,64],[68,0,0,0,0,0,0,0,0],[34,4],[65,0],[33,5],[26],[11],[32,4],[32,10],[32,2],[161],[100],[4,64],[32,10],[32,2],[161],[34,4],[65,0],[33,5],[26],[11],[32,6],[252,3],[40,1,0],[184],[33,11],[32,8],[252,3],[32,10],[32,4],[161],[32,11],[160],[34,12],[252,3],[54,1,0],[32,8],[252,3],[65,4],[106],[32,2],[252,3],[65,9],[108],[106],[34,13],[32,11],[252,3],[65,9],[108],[106],[32,13],[32,4],[252,3],[65,9],[108],[106],[32,10],[252,3],[32,2],[252,3],[32,4],[252,3],[107],[107],[65,9],[108],[252,10,0,0],[32,11],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[33,14],[32,8],[32,2],[68,0,0,0,0,0,0,34,64],[162],[160],[34,15],[32,11],[68,0,0,0,0,0,0,34,64],[162],[160],[33,16],[3,64],[32,15],[32,16],[99],[4,64],[32,15],[252,2],[32,14],[252,2],[43,0,4],[57,0,4],[32,15],[252,2],[32,14],[252,2],[45,0,12],[58,0,12],[32,15],[68,0,0,0,0,0,0,34,64],[160],[33,15],[32,14],[68,0,0,0,0,0,0,34,64],[160],[33,14],[12,1],[11],[11],[11],[32,8],[65,208,0],[15]],
360
+ params: [124,127,124,127,124,127,124,127], typedParams: 1,
361
+ returns: [124,127], typedReturns: 1,
362
+ locals: [124,127,124,124,124,127,124,124,124], localNames: ["_this","_this#type","start","start#type","deleteCount","deleteCount#type","items","items#type","out","#last_type","len","itemsLen","__length_setter_tmp","#splice_ptr","itemsPtr","outPtr","outPtrEnd"],
363
+ hasRestArgument: 1,
364
+ };
351
365
  this.__Array_prototype_flat = {
352
366
  wasm: (scope, {builtin,internalThrow}) => [[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[97],[4,64],[68,0,0,0,0,0,0,240,63],[34,2],[65,0],[33,3],[26],[11],[16, builtin('__Porffor_allocate')],[33,5],[33,4],[32,2],[68,0,0,0,0,0,0,0,0],[101],[4,64],[32,0],[32,4],[16, builtin('__Porffor_clone')],[32,4],[65,208,0],[15],[11],[32,0],[252,3],[40,1,0],[184],[33,6],[68,0,0,0,0,0,0,0,0],[33,7],[68,0,0,0,0,0,0,0,0],[33,8],[3,64],[32,7],[32,6],[99],[4,64],[32,7],[32,7],[68,0,0,0,0,0,0,240,63],[160],[33,7],[252,3],[65,9],[108],[32,0],[252,3],[106],[34,11],[43,0,4],[32,11],[45,0,12],[33,5],[33,9],[32,5],[33,10],[32,9],[32,10],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,84,64],[97],[4,64],[32,2],[68,0,0,0,0,0,0,240,63],[100],[4,64],[32,9],[32,10],[32,2],[68,0,0,0,0,0,0,240,63],[161],[65,0],[16, builtin('__Array_prototype_flat')],[33,10],[26],[11],[32,9],[252,3],[33,12],[65,0],[33,14],[32,12],[40,1,0],[33,13],[32,10],[33,19],[2,64],[32,19],[65,19],[70],[4,64,"TYPESWITCH|Set"],[3,64],[32,12],[43,0,4],[32,12],[45,0,12],[33,16],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,12],[65,9],[106],[33,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[65,194,0],[33,16],[65,128,128,8],[65,1],[54,0,0],[3,64],[65,128,128,8],[32,12],[47,0,4],[59,0,4],[68,0,0,0,0,0,0,0,65],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,12],[65,2],[106],[33,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[3,64],[32,12],[43,0,4],[32,12],[45,0,12],[33,16],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,12],[65,9],[106],[33,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[106],[45,0,4],[184],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[106],[44,0,4],[183],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[106],[45,0,4],[184],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[65,2],[108],[106],[47,0,4],[184],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[65,2],[108],[106],[46,0,4],[183],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[65,4],[108],[106],[40,0,4],[184],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[65,4],[108],[106],[40,0,4],[183],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[65,4],[108],[106],[42,0,4],[187],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[65,0],[33,16],[3,64],[32,12],[40,0,4],[32,14],[65,8],[108],[106],[43,0,4],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],[32,19],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[65,194,1],[33,16],[65,128,128,8],[65,1],[54,0,0],[3,64],[65,128,128,8],[32,12],[32,14],[106],[45,0,4],[58,0,4],[68,0,0,0,0,0,0,0,65],[33,15],[2,64],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,15],[34,17],[57,0,4],[32,18],[32,16],[58,0,12],[32,14],[65,1],[106],[34,14],[32,13],[71],[13,1],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `Tried for..of on non-iterable type`),[11,"TYPESWITCH_end"],[5],[32,4],[252,3],[32,8],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[252,3],[65,9],[108],[106],[34,18],[32,9],[34,17],[57,0,4],[32,18],[32,10],[58,0,12],[11],[12,1],[11],[11],[32,4],[252,3],[32,8],[34,20],[252,3],[54,1,0],[32,4],[65,208,0],[15]],
353
367
  params: [124,127,124,127], typedParams: 1,
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.25+f95092544",
4
+ "version": "0.18.27+71e285b9b",
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.25+f95092544';
3
+ globalThis.version = '0.18.27+71e285b9b';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {