porffor 0.47.1 → 0.47.3

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.
@@ -1547,6 +1547,15 @@ export const __Porffor_bytestring_appendChar = (str: bytestring, char: i32): i32
1547
1547
  return 1;
1548
1548
  };
1549
1549
 
1550
+ export const __Porffor_bytestring_append2Char = (str: bytestring, char1: i32, char2: i32): i32 => {
1551
+ const len: i32 = str.length;
1552
+ Porffor.wasm.i32.store8(Porffor.wasm`local.get ${str}` + len, char1, 0, 4);
1553
+ Porffor.wasm.i32.store8(Porffor.wasm`local.get ${str}` + len + 1, char2, 0, 4);
1554
+ str.length = len + 2;
1555
+ return 1;
1556
+ };
1557
+
1558
+
1550
1559
  // fast appending padded number
1551
1560
  export const __Porffor_bytestring_appendPadNum = (str: bytestring, num: number, len: number): i32 => {
1552
1561
  let numStr: bytestring = Number.prototype.toFixed(num, 0);
@@ -1,3 +1,5 @@
1
+ import type {} from './porffor.d.ts';
2
+
1
3
  export const __Porffor_Generator = (values: any[]): __Porffor_Generator => {
2
4
  const gen: __Porffor_Generator = values;
3
5
  return gen;
@@ -0,0 +1,114 @@
1
+ import type {} from './porffor.d.ts';
2
+
3
+ export const __Porffor_json_serialize = (value: any): bytestring|undefined => {
4
+ // todo: many niche things (toJSON, prim objects, etc) are not implemented yet
5
+ // somewhat modelled after 25.5.2.2 SerializeJSONProperty: https://tc39.es/ecma262/#sec-serializejsonproperty
6
+ let out: bytestring = Porffor.allocate();
7
+
8
+ const nullString: bytestring = 'null';
9
+
10
+ if (value === null) return nullString;
11
+ if (value === true) return out = 'true';
12
+ if (value === false) return out = 'false';
13
+
14
+ const t: i32 = Porffor.rawType(value);
15
+ if ((t | 0b10000000) == Porffor.TYPES.bytestring) { // string
16
+ Porffor.bytestring.appendChar(out, 34); // start "
17
+
18
+ const len: i32 = value.length;
19
+ for (let i: i32 = 0; i < len; i++) {
20
+ const c: i32 = value.charCodeAt(i);
21
+ if (c < 0x20) {
22
+ if (c == 0x08) {
23
+ Porffor.bytestring.append2Char(out, 92, 98); // \b
24
+ continue;
25
+ }
26
+
27
+ if (c == 0x09) {
28
+ Porffor.bytestring.append2Char(out, 92, 116); // \t
29
+ continue;
30
+ }
31
+
32
+ if (c == 0x0a) {
33
+ Porffor.bytestring.append2Char(out, 92, 110); // \n
34
+ continue;
35
+ }
36
+
37
+ if (c == 0x0c) {
38
+ Porffor.bytestring.append2Char(out, 92, 102); // \f
39
+ continue;
40
+ }
41
+
42
+ if (c == 0x0d) {
43
+ Porffor.bytestring.append2Char(out, 92, 114); // \r
44
+ continue;
45
+ }
46
+
47
+ // \u00FF
48
+ Porffor.bytestring.append2Char(out, 92, 117); // \u
49
+ Porffor.bytestring.append2Char(out, 48, 48); // 00
50
+
51
+ Porffor.printHexDigit((c & 0xf0) / 0x10);
52
+ Porffor.printHexDigit(c & 0x0f);
53
+ continue;
54
+ }
55
+
56
+ if (c == 0x22) { // "
57
+ Porffor.bytestring.append2Char(out, 92, 34); // \"
58
+ continue;
59
+ }
60
+
61
+ if (c == 0x5c) { // \
62
+ Porffor.bytestring.append2Char(out, 92, 92); // \\
63
+ continue;
64
+ }
65
+
66
+ // todo: support non-bytestrings
67
+ Porffor.bytestring.appendChar(out, c);
68
+ }
69
+
70
+ Porffor.bytestring.appendChar(out, 34); // final "
71
+ return out;
72
+ }
73
+
74
+ if (Porffor.fastOr(
75
+ t == Porffor.TYPES.number,
76
+ t == Porffor.TYPES.numberobject
77
+ )) { // number
78
+ if (Number.isFinite(value)) return out = __Number_prototype_toString(value, 10);
79
+ return nullString;
80
+ }
81
+
82
+ if (t == Porffor.TYPES.array) {
83
+ Porffor.bytestring.appendChar(out, 91); // [
84
+
85
+ const arr: any[] = value;
86
+ for (const x of arr) {
87
+ Porffor.bytestring.appendStr(out, __Porffor_json_serialize(x) ?? nullString);
88
+
89
+ Porffor.bytestring.appendChar(out, 44); // ,
90
+ }
91
+
92
+ // swap trailing , with ]
93
+ Porffor.wasm.i32.store8(Porffor.wasm`local.get ${out}` + out.length, 93, 0, 4);
94
+
95
+ return out;
96
+ }
97
+
98
+ if (t > 0x06) {
99
+ // non-function object
100
+ // hack: just return empty object for now
101
+ Porffor.bytestring.appendChar(out, 123); // {
102
+ Porffor.bytestring.appendChar(out, 125); // }
103
+ return out;
104
+ }
105
+
106
+ return undefined;
107
+ };
108
+
109
+ export const __JSON_stringify = (value: any, replacer: any, space: any) => {
110
+ // todo: replacer
111
+ // todo: space
112
+
113
+ return __Porffor_json_serialize(value);
114
+ };
@@ -85,6 +85,7 @@ type PorfforGlobal = {
85
85
  // defined in date.ts
86
86
  appendStr(str: bytestring, appendage: bytestring): i32;
87
87
  appendChar(str: bytestring, char: i32): i32;
88
+ append2Char(str: bytestring, char1: i32, char2: i32): i32;
88
89
  appendPadNum(str: bytestring, num: number, len: number): i32;
89
90
  }
90
91
 
@@ -1452,6 +1452,12 @@ params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
1452
1452
  locals:[124,124,127],localNames:["str","str#type","char","char#type","len","__length_setter_tmp","__member_setter_ptr_tmp"],
1453
1453
  usedTypes:[195],
1454
1454
  }
1455
+ this.__Porffor_bytestring_append2Char = {
1456
+ wasm:()=>[[32,0],[252,3],[40,1,0],[184],[33,6],[32,0],[32,6],[160],[252,2],[32,2],[252,2],[58,0,4],[32,0],[32,6],[160],[68,1],[160],[252,2],[32,4],[252,2],[58,0,4],[32,0],[252,3],[34,8],[32,6],[68,2],[160],[34,7],[252,3],[54,1,0],[68,1],[65,1],[15]],
1457
+ params:[124,127,124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
1458
+ locals:[124,124,127],localNames:["str","str#type","char1","char1#type","char2","char2#type","len","__length_setter_tmp","__member_setter_ptr_tmp"],
1459
+ usedTypes:[195],
1460
+ }
1455
1461
  this.__Porffor_bytestring_appendPadNum = {
1456
1462
  wasm:(_,{builtin})=>[[32,2],[65,1],[68,0],[65,1],[16,builtin('__Number_prototype_toFixed')],[33,7],[33,6],[32,0],[32,0],[252,3],[40,1,0],[184],[160],[33,8],[32,6],[252,3],[40,1,0],[184],[33,9],[32,8],[32,4],[32,9],[161],[160],[33,10],[3,64],[32,8],[32,10],[99],[4,64],[32,8],[32,8],[68,1],[160],[33,8],[252,2],[65,48],[58,0,4],[12,1],[11],[11],[32,6],[34,11],[32,9],[160],[33,12],[3,64],[32,11],[32,12],[99],[4,64],[32,8],[32,8],[68,1],[160],[33,8],[252,2],[32,11],[32,11],[68,1],[160],[33,11],[252,2],[45,0,4],[58,0,4],[12,1],[11],[11],[32,0],[252,3],[34,14],[32,8],[32,0],[161],[34,13],[252,3],[54,1,0],[68,1],[65,1],[15]],
1457
1463
  params:[124,127,124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
@@ -1804,6 +1810,19 @@ locals:[124,124,127,127],localNames:["vals","vals#type","value","value#type","#a
1804
1810
  usedTypes:[36,80],
1805
1811
  usesTag:1,
1806
1812
  }
1813
+ this.__Porffor_json_serialize = {
1814
+ wasm:(_,{t,allocPage,builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[183],[33,2],...number(allocPage(_,'bytestring: __Porffor_json_serialize/nullString','i8'),124),[33,3],[32,0],[68,0],[97],[32,1],[65,128,1],[114],[65,7],[65,128,1],[114],[70],[113],[4,64],[32,3],[65,195,1],[15],[11],[32,0],[68,1],[97],[32,1],[65,128,1],[114],[65,2],[65,128,1],[114],[70],[113],[4,64],...number(allocPage(_,'bytestring: __Porffor_json_serialize/out','i8'),124),[34,2],[65,195,1],[15],[11],[32,0],[68,0],[97],[32,1],[65,128,1],[114],[65,2],[65,128,1],[114],[70],[113],[4,64],[32,2],[252,3],[34,4],[65,5],[54,1,0],[32,4],[65,230,0],[58,0,4],[32,4],[65,225,0],[58,0,5],[32,4],[65,236,0],[58,0,6],[32,4],[65,243,0],[58,0,7],[32,4],[65,229,0],[58,0,8],[32,4],[184],[34,2],[65,195,1],[15],[11],[32,1],[184],[34,5],[68,128],[16,builtin('f64_|')],[68,195],[97],[4,64],[32,2],[65,195,1],[68,34],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[32,0],[252,3],[40,1,0],[184],[33,7],[68,0],[33,8],[3,64],[32,8],[32,7],[99],[4,64],[2,64],[32,0],[252,3],[40,1,0],[33,10],[32,1],[33,12],[2,124],...t([39],()=>[[32,12],[65,39],[70],[4,64],[32,8],[252,2],[65,2],[108],[32,0],[252,3],[106],[47,0,4],[184],[65,1],[33,6],[12,1],[11]]),...t([67],()=>[[32,12],[65,195,0],[70],[4,64],[32,8],[252,2],[65,2],[108],[32,0],[252,3],[106],[47,0,4],[184],[65,1],[33,6],[12,1],[11]]),...t([195],()=>[[32,12],[65,195,1],[70],[4,64],[32,8],[252,2],[32,0],[252,3],[106],[45,0,4],[184],[65,1],[33,6],[12,1],[11]]),...internalThrow(_,'TypeError',`'charCodeAt' proto func tried to be called on a type without an impl`),[68,0],[11],[34,9],[68,32],[99],[4,64],[32,9],[68,8],[97],[4,64],[32,2],[65,195,1],[68,92],[65,1],[68,98],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[12,2],[11],[32,9],[68,9],[97],[4,64],[32,2],[65,195,1],[68,92],[65,1],[68,116],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[12,2],[11],[32,9],[68,10],[97],[4,64],[32,2],[65,195,1],[68,92],[65,1],[68,110],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[12,2],[11],[32,9],[68,12],[97],[4,64],[32,2],[65,195,1],[68,92],[65,1],[68,102],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[12,2],[11],[32,9],[68,13],[97],[4,64],[32,2],[65,195,1],[68,92],[65,1],[68,114],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[12,2],[11],[32,2],[65,195,1],[68,92],[65,1],[68,117],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[32,2],[65,195,1],[68,48],[65,1],[68,48],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[32,9],[68,240],[16,builtin('f64_&')],[68,16],[163],[65,1],[16,builtin('__Porffor_printHexDigit')],[33,6],[26],[32,9],[68,15],[16,builtin('f64_&')],[65,1],[16,builtin('__Porffor_printHexDigit')],[33,6],[26],[12,1],[11],[32,9],[68,34],[97],[4,64],[32,2],[65,195,1],[68,92],[65,1],[68,34],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[12,1],[11],[32,9],[68,92],[97],[4,64],[32,2],[65,195,1],[68,92],[65,1],[68,92],[65,1],[16,builtin('__Porffor_bytestring_append2Char')],[33,6],[26],[12,1],[11],[32,2],[65,195,1],[32,9],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,8],[68,1],[160],[33,8],[12,1],[11],[11],[32,2],[65,195,1],[68,34],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[32,2],[65,195,1],[15],[11],[32,5],[68,1],[97],[32,5],[68,38],[97],[114],[4,64],[32,0],[16,builtin('__Number_isFinite')],[252,3],[4,64],[32,0],[32,1],[68,10],[65,1],[16,builtin('__Number_prototype_toString')],[33,6],[34,2],[32,6],[15],[11],[32,3],[65,195,1],[15],[11],[32,5],[68,80],[97],[4,64],[32,2],[65,195,1],[68,91],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[32,0],[34,14],[252,3],[33,15],[65,208,0],[33,18],[65,0],[33,17],[32,18],[65,208,0],[70],[32,18],[65,19],[70],[114],[32,18],[65,195,0],[70],[114],[32,18],[65,195,1],[70],[114],[32,18],[65,216,0],[78],[32,18],[65,224,0],[76],[113],[114],[69],[4,64],...internalThrow(_,'TypeError',`Tried for..of on non-iterable type`),[11],[32,15],[40,1,0],[34,16],[4,64],[32,18],[33,12],[2,64],...t([19],()=>[[32,12],[65,19],[70],[4,64],[3,64],[32,15],[43,0,4],[33,19],[32,15],[45,0,12],[33,20],[32,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,15],[65,9],[106],[33,15],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([67],()=>[[32,12],[65,195,0],[70],[4,64],[65,195,0],[33,20],[16,builtin('__Porffor_allocate')],[34,25],[65,1],[54,0,0],[3,64],[32,25],[32,15],[47,0,4],[59,0,4],[32,25],[184],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,15],[65,2],[106],[33,15],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([80],()=>[[32,12],[65,208,0],[70],[4,64],[3,64],[32,15],[43,0,4],[33,19],[32,15],[45,0,12],[33,20],[32,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,15],[65,9],[106],[33,15],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([88],()=>[[32,12],[65,216,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[106],[45,0,4],[184],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([89],()=>[[32,12],[65,217,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[106],[44,0,4],[183],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([90],()=>[[32,12],[65,218,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[106],[45,0,4],[184],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([91],()=>[[32,12],[65,219,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[65,2],[108],[106],[47,0,4],[184],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([92],()=>[[32,12],[65,220,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[65,2],[108],[106],[46,0,4],[183],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([93],()=>[[32,12],[65,221,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[65,4],[108],[106],[40,0,4],[184],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([94],()=>[[32,12],[65,222,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[65,4],[108],[106],[40,0,4],[183],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([95],()=>[[32,12],[65,223,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[65,4],[108],[106],[42,0,4],[187],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([96],()=>[[32,12],[65,224,0],[70],[4,64],[65,1],[33,20],[3,64],[32,15],[40,0,4],[32,17],[65,8],[108],[106],[43,0,4],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...t([195],()=>[[32,12],[65,195,1],[70],[4,64],[65,195,1],[33,20],[16,builtin('__Porffor_allocate')],[34,25],[65,1],[54,0,0],[3,64],[32,25],[32,15],[32,17],[106],[45,0,4],[58,0,4],[32,25],[184],[34,19],[33,21],[32,20],[33,22],[2,64],[2,64],[32,2],[65,195,1],[32,21],[32,22],[16,builtin('__Porffor_json_serialize')],[33,6],[34,23],[33,24],[32,6],[33,12],[2,127],...t([0,128],()=>[[32,12],[65,0],[70],[32,12],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,12],[65,7],[70],[4,64],[32,24],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,124],[32,3],[65,195,1],[33,6],[5],[32,23],[32,6],[33,6],[11],[32,6],[16,builtin('__Porffor_bytestring_appendStr')],[33,6],[26],[32,2],[65,195,1],[68,44],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[11],[32,17],[65,1],[106],[34,17],[32,16],[71],[13,1],[11],[11],[12,1],[11]]),...internalThrow(_,'TypeError',`Tried for..of on non-iterable type`),[11],[11],[32,2],[32,2],[252,3],[40,1,0],[184],[160],[252,2],[65,221,0],[58,0,4],[32,2],[65,195,1],[15],[11],[32,5],[68,6],[100],[4,64],[32,2],[65,195,1],[68,123],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[32,2],[65,195,1],[68,125],[65,1],[16,builtin('__Porffor_bytestring_appendChar')],[33,6],[26],[32,2],[65,195,1],[15],[11],[68,0],[65,128,1],[15]],
1815
+ params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
1816
+ locals:[124,124,127,124,127,124,124,124,127,127,127,127,124,127,127,127,127,124,127,124,127,124,124,127],localNames:["value","value#type","out","nullString","#makearray_pointer_tmp","t","#last_type","len","i","c","__proto_length_cache","__proto_pointer_cache","#typeswitch_tmp1","__charCodeAt_tmp","arr","#forof_base_pointer0","#forof_length0","#forof_counter0","#forof_itertype0","#forof_tmp0","#forof_tmp0#type","x","x#type","logictmp","#logicinner_tmp","#forof_allocd"],
1817
+ usedTypes:[195,7,80,67],
1818
+ data:{"bytestring: __Porffor_json_serialize/nullString":[4,0,0,0,110,117,108,108],"bytestring: __Porffor_json_serialize/out":[4,0,0,0,116,114,117,101]},
1819
+ usesTag:1,
1820
+ }
1821
+ this.__JSON_stringify = {
1822
+ wasm:(_,{builtin})=>[[32,0],[32,1],[16,builtin('__Porffor_json_serialize')],[34,6],[15]],
1823
+ params:[124,127,124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
1824
+ locals:[127],localNames:["value","value#type","replacer","replacer#type","space","space#type","#last_type"],
1825
+ }
1807
1826
  this.__Math_exp = {
1808
1827
  wasm:(_,{builtin})=>[[32,0],[16,builtin('__Number_isFinite')],[68,0],[97],[4,64],[32,0],[68,"Infinity"],[154],[97],[4,64],[68,0],[65,1],[15],[11],[32,0],[65,1],[15],[11],[32,0],[68,0],[99],[4,64],[68,1],[32,0],[154],[65,1],[16,builtin('__Math_exp')],[33,2],[163],[65,1],[15],[11],[32,0],[68,0.6931471805599453],[163],[16,builtin('__Math_floor')],[33,3],[32,0],[32,3],[68,0.6931471805599453],[162],[161],[34,4],[33,5],[68,1],[32,4],[160],[33,6],[68,2],[33,7],[3,64],[32,5],[16,builtin('__Math_abs')],[68,1e-15],[100],[4,64],[32,5],[32,4],[32,7],[163],[162],[33,5],[32,6],[32,5],[160],[33,6],[32,7],[68,1],[160],[33,7],[12,1],[11],[11],[3,64],[32,3],[32,3],[68,1],[161],[33,3],[68,0],[100],[4,64],[32,6],[68,2],[162],[33,6],[12,1],[11],[11],[32,6],[65,1],[15]],
1809
1828
  params:[124,127],typedParams:1,returns:[124,127],typedReturns: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.47.1",
4
+ "version": "0.47.3",
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.47.1';
3
+ globalThis.version = '0.47.3';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {