porffor 0.20.5 → 0.20.6

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.
@@ -154,7 +154,7 @@ export default (funcs, globals, tags, pages, data, flags, noTreeshake = false) =
154
154
  encodeVector([ [
155
155
  0x00,
156
156
  Opcodes.i32_const, 0, Opcodes.end,
157
- ...encodeVector(funcs.map(x => x.index))
157
+ ...encodeVector(funcs.map(x => unsignedLEB128(x.index)))
158
158
  ] ])
159
159
  );
160
160
 
@@ -36,6 +36,13 @@ export const __Array_from = (arg: any, mapFn: any): any[] => {
36
36
  return out;
37
37
  };
38
38
 
39
+ export const __Porffor_fastPush = (_this: any[], el: any) => {
40
+ let len: i32 = _this.length;
41
+ _this[len] = el;
42
+ _this.length = ++len;
43
+ return len;
44
+ };
45
+
39
46
  export const __Array_prototype_push = (_this: any[], ...items: any[]) => {
40
47
  let len: i32 = _this.length;
41
48
  const itemsLen: i32 = items.length;
@@ -1,8 +1,115 @@
1
1
  import type {} from './porffor.d.ts';
2
2
 
3
+ export const __Object_keys = (obj: any): any[] => {
4
+ if (obj == null) throw new TypeError('Argument is nullish, expected object');
5
+
6
+ const out: any[] = Porffor.allocate();
7
+
8
+ const t: i32 = Porffor.rawType(obj);
9
+ if (t == Porffor.TYPES.object) {
10
+ const keys: Set = Porffor.wasm.i32.load(obj, 0, 0);
11
+ const size: i32 = Porffor.wasm.i32.load(keys, 0, 0);
12
+ out.length = size;
13
+
14
+ for (let i: i32 = 0; i < size; i++) {
15
+ out[i] = Porffor.set.read(keys, i);
16
+ }
17
+ } else if (Porffor.fastOr(
18
+ t == Porffor.TYPES.array,
19
+ t == Porffor.TYPES.bytestring,
20
+ t == Porffor.TYPES.string
21
+ )) {
22
+ const len: i32 = obj.length;
23
+ out.length = len;
24
+
25
+ for (let i: i32 = 0; i < len; i++) {
26
+ out[i] = __Number_prototype_toString(i);
27
+ }
28
+ }
29
+
30
+ return out;
31
+ };
32
+
33
+ export const __Object_values = (obj: any): any[] => {
34
+ if (obj == null) throw new TypeError('Argument is nullish, expected object');
35
+
36
+ const out: any[] = Porffor.allocate();
37
+
38
+ const t: i32 = Porffor.rawType(obj);
39
+ if (t == Porffor.TYPES.object) {
40
+ const size: i32 = Porffor.wasm.i32.load(Porffor.wasm.i32.load(obj, 0, 0), 0, 0);
41
+ const vals: any[] = Porffor.wasm.i32.load(obj, 0, 4);
42
+
43
+ out.length = size;
44
+ for (let i: i32 = 0; i < size; i++) {
45
+ out[i] = vals[i];
46
+ }
47
+ } else if (Porffor.fastOr(
48
+ t == Porffor.TYPES.array,
49
+ t == Porffor.TYPES.bytestring,
50
+ t == Porffor.TYPES.string
51
+ )) {
52
+ const len: i32 = obj.length;
53
+ out.length = len;
54
+
55
+ for (let i: i32 = 0; i < len; i++) {
56
+ out[i] = obj[i];
57
+ }
58
+ }
59
+
60
+ return out;
61
+ };
62
+
63
+ export const __Object_entries = (obj: any): any[] => {
64
+ const out: any[] = Porffor.allocate();
65
+
66
+ const keys: any[] = __Object_keys(obj);
67
+ const vals: any[] = __Object_values(obj);
68
+
69
+ const size: i32 = keys.length;
70
+ out.length = size;
71
+
72
+ for (let i: i32 = 0; i < size; i++) {
73
+ // what is memory efficiency anyway?
74
+ const entry: any[] = Porffor.allocate();
75
+
76
+ entry.length = 2;
77
+ entry[0] = keys[i];
78
+ entry[1] = vals[i];
79
+
80
+ out[i] = entry;
81
+ }
82
+
83
+ return out;
84
+ };
85
+
86
+
87
+ export const __Object_prototype_hasOwnProperty = (_this: any, prop: any) => {
88
+ const p: any = ecma262.ToPropertyKey(prop);
89
+
90
+ const t: i32 = Porffor.rawType(_this);
91
+ if (t == Porffor.TYPES.object) {
92
+ const keys: Set = Porffor.wasm.i32.load(_this, 0, 0);
93
+ return __Set_prototype_has(keys, p);
94
+ }
95
+
96
+ const keys: any[] = __Object_keys(_this);
97
+ return __Array_prototype_includes(keys, p);
98
+ };
99
+
100
+ export const __Object_hasOwn = (obj: any, prop: any) => {
101
+ // todo: not spec compliant lol
102
+ return __Object_prototype_hasOwnProperty(obj, prop);
103
+ };
104
+
105
+
3
106
  export const __Object_prototype_toString = (_this: object) => {
4
107
  let out: bytestring = '[object Object]';
5
108
  return out;
6
109
  };
7
110
 
8
- export const __Object_prototype_toLocaleString = (_this: object) => __Object_prototype_toLocaleString(_this);
111
+ export const __Object_prototype_toLocaleString = (_this: object) => __Object_prototype_toLocaleString(_this);
112
+
113
+ export const __Object_prototype_valueOf = (_this: object) => {
114
+ return _this;
115
+ };
@@ -81,6 +81,7 @@ declare global {
81
81
  const ecma262: {
82
82
  ToIntegerOrInfinity(argument: unknown): number;
83
83
  ToString(argument: unknown): bytestring;
84
+ ToPropertyKey(argument: unknown): any;
84
85
  }
85
86
 
86
87
  const print: (arg: any) => void;
@@ -76,7 +76,7 @@ export const __Set_prototype_values = (_this: Set) => {
76
76
  const out: any[] = __Porffor_allocate();
77
77
  for (let i: number = 0; i < size; i++) {
78
78
  const val: any = __Porffor_set_read(_this, i);
79
- out.push(val);
79
+ Porffor.fastPush(out, val);
80
80
  }
81
81
 
82
82
  return out;
@@ -17,12 +17,7 @@ export const Symbol = (description: any): Symbol => {
17
17
  }
18
18
 
19
19
  // 4. Return a new Symbol whose [[Description]] is descString.
20
- let len: i32 = descStore.length;
21
- descStore[len] = descString;
22
- descStore.length = ++len;
23
-
24
- // 1-based so always truthy as numeric value
25
- const sym: Symbol = len;
20
+ const sym: Symbol = Porffor.fastPush(descStore, descString);
26
21
  return sym;
27
22
  };
28
23
 
@@ -62,4 +62,20 @@ export const __ecma262_ToString = (argument: unknown): bytestring => {
62
62
  // 11. Assert: primValue is not an Object.
63
63
  // 12. Return ? ToString(primValue).
64
64
  return argument.toString();
65
+ };
66
+
67
+ // 7.1.19 ToPropertyKey (argument)
68
+ // https://tc39.es/ecma262/#sec-topropertykey
69
+ export const __ecma262_ToPropertyKey = (argument: any): any => {
70
+ // 1. Let key be ? ToPrimitive(argument, string).
71
+ const key: any = argument;
72
+
73
+ // 2. If key is a Symbol, then
74
+ if (Porffor.rawType(key) == Porffor.TYPES.symbol) {
75
+ // a. Return key.
76
+ return key;
77
+ }
78
+
79
+ // 3. Return ! ToString(key).
80
+ return __ecma262_ToString(key);
65
81
  };
@@ -40,7 +40,7 @@ export const __Map_prototype_set = (_this: Map, key: any, value: any) => {
40
40
  Porffor.wasm.i32.store(keys, size + 1, 0, 0);
41
41
 
42
42
  // write new key at end
43
- __Porffor_set_write(keys, size, key);
43
+ Porffor.set.write(keys, size, key);
44
44
 
45
45
  // write new value at end
46
46
  vals[size] = value;
@@ -112,18 +112,19 @@ export const __Map_prototype_keys = (_this: Map) => {
112
112
  const out: any[] = Porffor.allocate();
113
113
 
114
114
  for (const x of keys) {
115
- out.push(x);
115
+ Porffor.fastPush(out, x);
116
116
  }
117
117
 
118
118
  return out;
119
119
  };
120
120
 
121
121
  export const __Map_prototype_values = (_this: Map) => {
122
- const vals: Set = Porffor.wasm.i32.load(_this, 0, 4);
122
+ const size: i32 = Porffor.wasm.i32.load(Porffor.wasm.i32.load(_this, 0, 0), 0, 0);
123
+ const vals: any[] = Porffor.wasm.i32.load(_this, 0, 4);
123
124
  const out: any[] = Porffor.allocate();
124
125
 
125
- for (const x of vals) {
126
- out.push(x);
126
+ for (let i: i32 = 0; i < size; i++) {
127
+ Porffor.fastPush(out, vals[i]);
127
128
  }
128
129
 
129
130
  return out;
@@ -713,7 +713,7 @@ const truthy = (scope, wasm, type, intIn = false, intOut = false, forceTruthyMod
713
713
  if (truthyMode === 'full') return [
714
714
  // if value != 0 or NaN
715
715
  ...(!useTmp ? [] : [ [ Opcodes.local_get, tmp ] ]),
716
- ...(intIn ? [ ] : [ Opcodes.i32_to ]),
716
+ ...(intIn ? [] : [ Opcodes.i32_to ]),
717
717
 
718
718
  [ Opcodes.i32_eqz ],
719
719
  [ Opcodes.i32_eqz ],
@@ -820,6 +820,7 @@ const nullish = (scope, wasm, type, intIn = false, intOut = false) => {
820
820
  ...typeSwitch(scope, type, {
821
821
  [TYPES.undefined]: [
822
822
  // undefined
823
+ ...(!useTmp ? [ [ Opcodes.drop ] ] : []),
823
824
  ...number(1, intOut ? Valtype.i32 : valtypeBinary)
824
825
  ],
825
826
  [TYPES.object]: [
@@ -831,6 +832,7 @@ const nullish = (scope, wasm, type, intIn = false, intOut = false) => {
831
832
  ],
832
833
  default: [
833
834
  // not
835
+ ...(!useTmp ? [ [ Opcodes.drop ] ] : []),
834
836
  ...number(0, intOut ? Valtype.i32 : valtypeBinary)
835
837
  ]
836
838
  }, intOut ? Valtype.i32 : valtypeBinary)
@@ -1082,6 +1084,13 @@ const performOp = (scope, op, left, right, leftType, rightType, _global = false,
1082
1084
  ]);
1083
1085
  };
1084
1086
 
1087
+ const knownNullish = decl => {
1088
+ if (decl.type === 'Literal' && decl.value === null) return true;
1089
+ if (decl.type === 'Identifier' && decl.name === 'undefined') return true;
1090
+
1091
+ return false;
1092
+ };
1093
+
1085
1094
  const generateBinaryExp = (scope, decl, _global, _name) => {
1086
1095
  if (decl.operator === 'instanceof') {
1087
1096
  // very hacky basic instanceof
@@ -1110,8 +1119,24 @@ const generateBinaryExp = (scope, decl, _global, _name) => {
1110
1119
  return out;
1111
1120
  }
1112
1121
 
1113
- const out = performOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right), _global, _name);
1122
+ // opt: == null|undefined -> nullish
1123
+ if (decl.operator === '==' || decl.operator === '!=') {
1124
+ if (knownNullish(decl.right)) {
1125
+ const out = nullish(scope, generate(scope, decl.left), getNodeType(scope, decl.left), false, true);
1126
+ if (decl.operator === '!=') out.push([ Opcodes.i32_eqz ]);
1127
+ out.push(Opcodes.i32_from_u);
1128
+ return out;
1129
+ }
1114
1130
 
1131
+ if (knownNullish(decl.left)) {
1132
+ const out = nullish(scope, generate(scope, decl.right), getNodeType(scope, decl.right), false, true);
1133
+ if (decl.operator === '!=') out.push([ Opcodes.i32_eqz ]);
1134
+ out.push(Opcodes.i32_from_u);
1135
+ return out;
1136
+ }
1137
+ }
1138
+
1139
+ const out = performOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right), _global, _name);
1115
1140
  if (valtype !== 'i32' && ['==', '===', '!=', '!==', '>', '>=', '<', '<='].includes(decl.operator)) out.push(Opcodes.i32_from_u);
1116
1141
 
1117
1142
  return out;
@@ -1563,7 +1588,6 @@ const generateLiteral = (scope, decl, global, name) => {
1563
1588
  return number(decl.value);
1564
1589
 
1565
1590
  case 'boolean':
1566
- // hack: bool as int (1/0)
1567
1591
  return number(decl.value ? 1 : 0);
1568
1592
 
1569
1593
  case 'string':
@@ -2839,9 +2863,6 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
2839
2863
  value: decl.left.property.name
2840
2864
  };
2841
2865
 
2842
- includeBuiltin(scope, '__Map_prototype_get');
2843
- includeBuiltin(scope, '__Map_prototype_set');
2844
-
2845
2866
  return [
2846
2867
  ...typeSwitch(scope, getNodeType(scope, decl.left.object), {
2847
2868
  [TYPES.array]: [
@@ -2879,23 +2900,26 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
2879
2900
  ...getNodeType(scope, object),
2880
2901
 
2881
2902
  ...generate(scope, property),
2882
- ...(op === '=' ? [] : [ [ Opcodes.local_tee, localTmp(scope, '#objset_property') ] ]),
2883
2903
  ...getNodeType(scope, property),
2904
+ ...toPropertyKey(scope),
2905
+ ...(op === '=' ? [] : [ [ Opcodes.local_set, localTmp(scope, '#objset_property_type', Valtype.i32) ] ]),
2906
+ ...(op === '=' ? [] : [ [ Opcodes.local_tee, localTmp(scope, '#objset_property') ] ]),
2907
+ ...(op === '=' ? [] : [ [ Opcodes.local_get, localTmp(scope, '#objset_property_type', Valtype.i32) ] ]),
2884
2908
 
2885
2909
  ...(op === '=' ? generate(scope, decl.right) : performOp(scope, op, [
2886
2910
  [ Opcodes.local_get, localTmp(scope, '#objset_object') ],
2887
2911
  ...getNodeType(scope, object),
2888
2912
 
2889
2913
  [ Opcodes.local_get, localTmp(scope, '#objset_property') ],
2890
- ...getNodeType(scope, property),
2914
+ [ Opcodes.local_get, localTmp(scope, '#objset_property_type', Valtype.i32) ],
2891
2915
 
2892
- [ Opcodes.call, ...unsignedLEB128(funcIndex.__Map_prototype_get) ],
2916
+ [ Opcodes.call, ...unsignedLEB128(includeBuiltin(scope, '__Map_prototype_get').index) ],
2893
2917
  ...setLastType(scope)
2894
2918
  ], generate(scope, decl.right), getLastType(scope), getNodeType(scope, decl.right), false, name, true)),
2895
2919
  [ Opcodes.local_tee, newValueTmp ],
2896
2920
  ...getNodeType(scope, decl),
2897
2921
 
2898
- [ Opcodes.call, ...unsignedLEB128(funcIndex.__Map_prototype_set) ],
2922
+ [ Opcodes.call, ...unsignedLEB128(includeBuiltin(scope, '__Map_prototype_set').index) ],
2899
2923
  [ Opcodes.drop ],
2900
2924
 
2901
2925
  ...setLastType(scope, getNodeType(scope, decl)),
@@ -4310,9 +4334,12 @@ const generateArray = (scope, decl, global = false, name = '$undeclared', initEm
4310
4334
  return makeArray(scope, decl, global, name, initEmpty, valtype, false, true)[0];
4311
4335
  };
4312
4336
 
4337
+ const toPropertyKey = scope => Prefs.fastObject ? [] : [
4338
+ [ Opcodes.call, ...unsignedLEB128(includeBuiltin(scope, '__ecma262_ToPropertyKey').index) ]
4339
+ ];
4340
+
4313
4341
  const generateObject = (scope, decl, global = false, name = '$undeclared') => {
4314
4342
  includeBuiltin(scope, 'Map');
4315
- includeBuiltin(scope, '__Map_prototype_set');
4316
4343
 
4317
4344
  // todo: optimize const objects
4318
4345
  const tmp = localTmp(scope, `#objectexpr${randId()}`);
@@ -4332,7 +4359,8 @@ const generateObject = (scope, decl, global = false, name = '$undeclared') => {
4332
4359
  const { method, shorthand, computed, kind, key, value } = x;
4333
4360
  if (kind !== 'init') return todo(scope, 'complex objects are not supported yet', true);
4334
4361
 
4335
- const k = computed ? key : {
4362
+ let k = key;
4363
+ if (!computed && key.type !== 'Literal') k = {
4336
4364
  type: 'Literal',
4337
4365
  value: key.name
4338
4366
  };
@@ -4343,11 +4371,12 @@ const generateObject = (scope, decl, global = false, name = '$undeclared') => {
4343
4371
 
4344
4372
  ...generate(scope, k),
4345
4373
  ...getNodeType(scope, k),
4374
+ ...toPropertyKey(scope),
4346
4375
 
4347
4376
  ...generate(scope, value),
4348
4377
  ...getNodeType(scope, value),
4349
4378
 
4350
- [ Opcodes.call, ...unsignedLEB128(funcIndex.__Map_prototype_set) ],
4379
+ [ Opcodes.call, ...unsignedLEB128(includeBuiltin(scope, '__Map_prototype_set').index) ],
4351
4380
 
4352
4381
  [ Opcodes.drop ],
4353
4382
  [ Opcodes.drop ]
@@ -4503,8 +4532,6 @@ const generateMember = (scope, decl, _global, _name) => {
4503
4532
  }, _global, _name, true, 'i16', true);
4504
4533
  }
4505
4534
 
4506
- includeBuiltin(scope, '__Map_prototype_get');
4507
-
4508
4535
  const out = typeSwitch(scope, getNodeType(scope, object), {
4509
4536
  [TYPES.array]: [
4510
4537
  ...loadArray(scope, objectWasm, propertyWasm),
@@ -4580,8 +4607,9 @@ const generateMember = (scope, decl, _global, _name) => {
4580
4607
 
4581
4608
  ...propertyWasm,
4582
4609
  ...getNodeType(scope, property),
4610
+ ...toPropertyKey(scope),
4583
4611
 
4584
- [ Opcodes.call, ...unsignedLEB128(funcIndex.__Map_prototype_get) ],
4612
+ [ Opcodes.call, ...unsignedLEB128(includeBuiltin(scope, '__Map_prototype_get').index) ],
4585
4613
  ...setLastType(scope)
4586
4614
  ],
4587
4615
 
@@ -197,6 +197,12 @@ export const BuiltinFuncs = function() {
197
197
  locals: [124,127,124,124,127,124,127,124,124,127,127,127,127,124,127,124,127,127,124,127,124,127,124,127,127,124,124], localNames: ["arg","arg#type","mapFn","mapFn#type","out","#last_type","len","type","type#type","hasMapFn","hasMapFn#type","i","#logicinner_tmp","#typeswitch_tmp","forof_base_pointer","forof_length","forof_counter","x","x#type","#member_setter_val_tmp","#member_setter_ptr_tmp","#indirect_arg0_type","#indirect_arg0_val","#indirect_arg1_type","#indirect_arg1_val","#indirect_arg2_type","#indirect_arg2_val","#indirect_func","#indirect_flags","#indirect_callee","__length_setter_tmp"],
198
198
  table: 1,
199
199
  };
200
+ this.__Porffor_fastPush = {
201
+ wasm: (scope, {}) => [[32,0],[252,3],[40,1,0],[184],[33,4],[32,0],[252,3],[32,4],[252,3],[65,9],[108],[106],[34,6],[32,2],[34,5],[57,0,4],[32,6],[32,3],[58,0,12],[32,0],[252,3],[32,4],[68,0,0,0,0,0,0,240,63],[160],[34,4],[34,8],[252,3],[54,1,0],[32,4],[65,1],[15]],
202
+ params: [124,127,124,127], typedParams: 1,
203
+ returns: [124,127], typedReturns: 1,
204
+ locals: [124,124,127,127,124], localNames: ["_this","_this#type","el","el#type","len","#member_setter_val_tmp","#member_setter_ptr_tmp","#last_type","__length_setter_tmp"],
205
+ };
200
206
  this.__Array_prototype_push = {
201
207
  wasm: (scope, {}) => [[32,0],[252,3],[40,1,0],[184],[33,4],[32,2],[252,3],[40,1,0],[184],[33,5],[68,0,0,0,0,0,0,0,0],[33,6],[3,64],[32,6],[32,5],[99],[4,64],[32,0],[252,3],[32,6],[32,4],[160],[252,3],[65,9],[108],[106],[34,8],[32,2],[33,9],[32,6],[34,10],[252,3],[65,9],[108],[32,9],[252,3],[106],[34,11],[43,0,4],[32,11],[45,0,12],[33,12],[34,7],[57,0,4],[32,8],[32,12],[58,0,12],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[12,1],[11],[11],[32,0],[252,3],[32,4],[32,5],[160],[34,13],[252,3],[54,1,0],[32,13],[65,1],[15]],
202
208
  params: [124,127,124,127], typedParams: 1,
@@ -1593,6 +1599,36 @@ export const BuiltinFuncs = function() {
1593
1599
  returns: [124,127], typedReturns: 1,
1594
1600
  locals: [127], localNames: ["input","input#type","radix","radix#type","#last_type"],
1595
1601
  };
1602
+ this.__Object_keys = {
1603
+ wasm: (scope, {builtin,internalThrow}) => [[32,0],[33,2],[32,1],[33,3],[2,127],[32,3],[65,5],[70],[4,64,"TYPESWITCH|Object"],[32,2],[68,0,0,0,0,0,0,0,0],[97],[12,1],[11],[32,3],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],[65,1],[12,1],[11],[65,0],[11,"TYPESWITCH_end"],[4,64],...internalThrow(scope, 'TypeError', `Argument is nullish, expected object`),[11],[16, ...builtin('__Porffor_allocate')],[26],[33,4],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[34,6],[68,0,0,0,0,0,0,20,64],[97],[4,64],[32,0],[252,2],[40,0,0],[183],[34,7],[252,2],[40,0,0],[183],[33,8],[32,4],[252,3],[32,8],[34,9],[252,3],[54,1,0],[68,0,0,0,0,0,0,0,0],[33,10],[3,64],[32,10],[32,8],[99],[4,64],[32,4],[252,3],[32,10],[252,3],[65,9],[108],[106],[34,12],[32,7],[65,19],[32,10],[65,1],[16, ...builtin('__Porffor_set_read')],[33,5],[34,11],[57,0,4],[32,12],[32,5],[58,0,12],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[12,1],[11],[11],[5],[32,6],[68,0,0,0,0,0,0,84,64],[97],[32,6],[68,0,0,0,0,0,96,104,64],[97],[114],[32,6],[68,0,0,0,0,0,192,80,64],[97],[114],[4,64],[32,0],[252,3],[40,1,0],[184],[33,13],[32,4],[252,3],[32,13],[34,9],[252,3],[54,1,0],[68,0,0,0,0,0,0,0,0],[33,10],[3,64],[32,10],[32,13],[99],[4,64],[32,4],[252,3],[32,10],[252,3],[65,9],[108],[106],[34,12],[32,10],[65,1],[68,0,0,0,0,0,0,0,0],[65,128,1],[16, ...builtin('__Number_prototype_toString')],[33,5],[34,11],[57,0,4],[32,12],[32,5],[58,0,12],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[12,1],[11],[11],[11],[11],[32,4],[65,208,0],[15]],
1604
+ params: [124,127], typedParams: 1,
1605
+ returns: [124,127], typedReturns: 1,
1606
+ locals: [124,127,124,127,124,124,124,124,124,124,127,124], localNames: ["obj","obj#type","#logicinner_tmp","#typeswitch_tmp","out","#last_type","t","keys","size","__length_setter_tmp","i","#member_setter_val_tmp","#member_setter_ptr_tmp","len"],
1607
+ };
1608
+ this.__Object_values = {
1609
+ wasm: (scope, {builtin,internalThrow}) => [[32,0],[33,2],[32,1],[33,3],[2,127],[32,3],[65,5],[70],[4,64,"TYPESWITCH|Object"],[32,2],[68,0,0,0,0,0,0,0,0],[97],[12,1],[11],[32,3],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],[65,1],[12,1],[11],[65,0],[11,"TYPESWITCH_end"],[4,64],...internalThrow(scope, 'TypeError', `Argument is nullish, expected object`),[11],[16, ...builtin('__Porffor_allocate')],[26],[33,4],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[34,6],[68,0,0,0,0,0,0,20,64],[97],[4,64],[32,0],[252,2],[40,0,0],[40,0,0],[183],[33,7],[32,0],[252,2],[40,0,4],[183],[33,8],[32,4],[252,3],[32,7],[34,9],[252,3],[54,1,0],[68,0,0,0,0,0,0,0,0],[33,10],[3,64],[32,10],[32,7],[99],[4,64],[32,4],[252,3],[32,10],[252,3],[65,9],[108],[106],[34,12],[32,8],[33,13],[32,10],[34,14],[252,3],[65,9],[108],[32,13],[252,3],[106],[34,15],[43,0,4],[32,15],[45,0,12],[33,5],[34,11],[57,0,4],[32,12],[32,5],[58,0,12],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[12,1],[11],[11],[5],[32,6],[68,0,0,0,0,0,0,84,64],[97],[32,6],[68,0,0,0,0,0,96,104,64],[97],[114],[32,6],[68,0,0,0,0,0,192,80,64],[97],[114],[4,64],[32,0],[252,3],[40,1,0],[184],[33,16],[32,4],[252,3],[32,16],[34,9],[252,3],[54,1,0],[68,0,0,0,0,0,0,0,0],[33,10],[3,64],[32,10],[32,16],[99],[4,64],[2,64],[32,4],[252,3],[32,10],[252,3],[65,9],[108],[106],[34,12],[32,0],[33,13],[32,10],[33,14],[32,1],[33,3],[2,124],[32,3],[65,5],[70],[4,64,"TYPESWITCH|Object"],[32,13],[32,1],[32,14],[65,1],[16, ...builtin('__Map_prototype_get')],[33,5],[12,1],[11],[32,3],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[65,0],[65,1],[54,0,0],[65,0],[32,14],[252,3],[65,2],[108],[32,13],[252,3],[106],[47,0,4],[59,0,4],[68,0,0,0,0,0,0,0,0],[65,195,0],[33,5],[12,1],[11],[32,3],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,14],[252,3],[65,9],[108],[32,13],[252,3],[106],[34,15],[43,0,4],[32,15],[45,0,12],[33,5],[12,1],[11],[32,3],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[106],[45,0,4],[184],[65,1],[33,5],[12,1],[11],[32,3],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[106],[44,0,4],[183],[65,1],[33,5],[12,1],[11],[32,3],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[106],[45,0,4],[184],[65,1],[33,5],[12,1],[11],[32,3],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,5],[12,1],[11],[32,3],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,5],[12,1],[11],[32,3],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,5],[12,1],[11],[32,3],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,5],[12,1],[11],[32,3],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,5],[12,1],[11],[32,3],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,5],[12,1],[11],[32,3],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[65,0],[65,1],[54,0,0],[65,0],[32,14],[252,3],[32,13],[252,3],[106],[45,0,4],[58,0,4],[68,0,0,0,0,0,0,0,0],[65,195,1],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `Unsupported member expression object`),[68,0,0,0,0,0,0,0,0],[11,"TYPESWITCH_end"],[34,11],[57,0,4],[32,12],[32,5],[58,0,12],[11],[32,10],[68,0,0,0,0,0,0,240,63],[160],[33,10],[12,1],[11],[11],[11],[11],[32,4],[65,208,0],[15]],
1610
+ params: [124,127], typedParams: 1,
1611
+ returns: [124,127], typedReturns: 1,
1612
+ locals: [124,127,124,127,124,124,124,124,124,124,127,124,124,127,124], localNames: ["obj","obj#type","#logicinner_tmp","#typeswitch_tmp","out","#last_type","t","size","vals","__length_setter_tmp","i","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop","#loadArray_offset","len"],
1613
+ };
1614
+ this.__Object_entries = {
1615
+ wasm: (scope, {builtin}) => [[16, ...builtin('__Porffor_allocate')],[26],[33,2],[32,0],[32,1],[16, ...builtin('__Object_keys')],[26],[33,4],[32,0],[32,1],[16, ...builtin('__Object_values')],[26],[33,5],[32,4],[252,3],[40,1,0],[184],[33,6],[32,2],[252,3],[32,6],[34,7],[252,3],[54,1,0],[68,0,0,0,0,0,0,0,0],[33,8],[3,64],[32,8],[32,6],[99],[4,64],[16, ...builtin('__Porffor_allocate')],[26],[34,9],[252,3],[68,0,0,0,0,0,0,0,64],[34,7],[252,3],[54,1,0],[32,9],[252,3],[65,0],[65,9],[108],[106],[34,11],[32,4],[33,12],[32,8],[34,13],[252,3],[65,9],[108],[32,12],[252,3],[106],[34,14],[43,0,4],[32,14],[45,0,12],[33,3],[34,10],[57,0,4],[32,11],[32,3],[58,0,12],[32,9],[252,3],[65,1],[65,9],[108],[106],[34,11],[32,5],[33,12],[32,8],[34,13],[252,3],[65,9],[108],[32,12],[252,3],[106],[34,14],[43,0,4],[32,14],[45,0,12],[33,3],[34,10],[57,0,4],[32,11],[32,3],[58,0,12],[32,2],[252,3],[32,8],[252,3],[65,9],[108],[106],[34,11],[32,9],[34,10],[57,0,4],[32,11],[65,208,0],[58,0,12],[32,8],[68,0,0,0,0,0,0,240,63],[160],[33,8],[12,1],[11],[11],[32,2],[65,208,0],[15]],
1616
+ params: [124,127], typedParams: 1,
1617
+ returns: [124,127], typedReturns: 1,
1618
+ locals: [124,127,124,124,124,124,124,124,124,127,124,124,127], localNames: ["obj","obj#type","out","#last_type","keys","vals","size","__length_setter_tmp","i","entry","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop","#loadArray_offset"],
1619
+ };
1620
+ this.__Object_prototype_hasOwnProperty = {
1621
+ wasm: (scope, {builtin}) => [[32,2],[32,3],[16, ...builtin('__ecma262_ToPropertyKey')],[33,5],[33,4],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[34,7],[68,0,0,0,0,0,0,20,64],[97],[4,64],[32,0],[252,2],[40,0,0],[183],[34,8],[65,19],[32,4],[32,5],[16, ...builtin('__Set_prototype_has')],[34,6],[15],[11],[32,0],[32,1],[16, ...builtin('__Object_keys')],[26],[34,8],[65,208,0],[32,4],[32,5],[68,0,0,0,0,0,0,0,0],[65,128,1],[16, ...builtin('__Array_prototype_includes')],[34,6],[15]],
1622
+ params: [124,127,124,127], typedParams: 1,
1623
+ returns: [124,127], typedReturns: 1,
1624
+ locals: [124,127,127,124,124], localNames: ["_this","_this#type","prop","prop#type","p","p#type","#last_type","t","keys"],
1625
+ };
1626
+ this.__Object_hasOwn = {
1627
+ wasm: (scope, {builtin}) => [[32,0],[32,1],[32,2],[32,3],[16, ...builtin('__Object_prototype_hasOwnProperty')],[34,4],[15]],
1628
+ params: [124,127,124,127], typedParams: 1,
1629
+ returns: [124,127], typedReturns: 1,
1630
+ locals: [127], localNames: ["obj","obj#type","prop","prop#type","#last_type"],
1631
+ };
1596
1632
  this.__Object_prototype_toString = {
1597
1633
  wasm: (scope, {allocPage}) => [...number(allocPage(scope, 'bytestring: __Object_prototype_toString/out', 'i8') * pageSize, 124),[34,2],[65,195,1],[15]],
1598
1634
  params: [124,127], typedParams: 1,
@@ -1606,6 +1642,12 @@ export const BuiltinFuncs = function() {
1606
1642
  returns: [124,127], typedReturns: 1,
1607
1643
  locals: [127], localNames: ["_this","_this#type","#last_type"],
1608
1644
  };
1645
+ this.__Object_prototype_valueOf = {
1646
+ wasm: (scope, {}) => [[32,0],[65,5],[15]],
1647
+ params: [124,127], typedParams: 1,
1648
+ returns: [124,127], typedReturns: 1,
1649
+ locals: [], localNames: ["_this","_this#type"],
1650
+ };
1609
1651
  this.__Porffor_allocate = {
1610
1652
  wasm: (scope, {}) => [[65,1],[64,0],[65,128,128,4],[108],[184],[65,1],[15]],
1611
1653
  params: [], typedParams: 1,
@@ -1637,10 +1679,10 @@ export const BuiltinFuncs = function() {
1637
1679
  locals: [], localNames: ["_this","_this#type"],
1638
1680
  };
1639
1681
  this.__Set_prototype_values = {
1640
- wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,2],[40,0,0],[183],[33,2],[16, ...builtin('__Porffor_allocate')],[26],[33,3],[68,0,0,0,0,0,0,0,0],[33,5],[3,64],[32,5],[32,2],[99],[4,64],[2,64],[32,0],[65,19],[32,5],[65,1],[16, ...builtin('__Porffor_set_read')],[33,7],[33,6],[32,3],[33,8],[65,208,0],[34,9],[33,10],[2,124],[32,10],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,8],[32,9],[65,4],[65,1],[54,1,0],[65,4],[32,6],[57,0,4],[65,4],[32,7],[58,0,12],[68,0,0,0,0,0,0,16,64],[65,208,0],[16, ...builtin('__Array_prototype_push')],[33,4],[12,1],[11],...internalThrow(scope, 'TypeError', `'push' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,5],[68,0,0,0,0,0,0,240,63],[160],[33,5],[12,1],[11],[11],[32,3],[65,208,0],[15]],
1682
+ wasm: (scope, {builtin}) => [[32,0],[252,2],[40,0,0],[183],[33,2],[16, ...builtin('__Porffor_allocate')],[26],[33,3],[68,0,0,0,0,0,0,0,0],[33,5],[3,64],[32,5],[32,2],[99],[4,64],[32,0],[65,19],[32,5],[65,1],[16, ...builtin('__Porffor_set_read')],[33,7],[33,6],[32,3],[65,208,0],[32,6],[32,7],[16, ...builtin('__Porffor_fastPush')],[33,4],[26],[32,5],[68,0,0,0,0,0,0,240,63],[160],[33,5],[12,1],[11],[11],[32,3],[65,208,0],[15]],
1641
1683
  params: [124,127], typedParams: 1,
1642
1684
  returns: [124,127], typedReturns: 1,
1643
- locals: [124,124,127,124,124,127,124,127,127], localNames: ["_this","_this#type","size","out","#last_type","i","val","val#type","#proto_target","#proto_target#type","#typeswitch_tmp"],
1685
+ locals: [124,124,127,124,124,127], localNames: ["_this","_this#type","size","out","#last_type","i","val","val#type"],
1644
1686
  };
1645
1687
  this.__Set_prototype_keys = {
1646
1688
  wasm: (scope, {builtin}) => [[32,0],[65,19],[16, ...builtin('__Set_prototype_values')],[34,2],[15]],
@@ -1673,7 +1715,7 @@ export const BuiltinFuncs = function() {
1673
1715
  locals: [], localNames: ["_this","_this#type"],
1674
1716
  };
1675
1717
  this.__Set_prototype_forEach = {
1676
- wasm: (scope, {internalThrow}) => [[32,0],[252,3],[33,4],[65,0],[33,6],[32,4],[40,1,0],[33,5],[3,64],[32,4],[43,0,4],[32,4],[45,0,12],[33,8],[33,7],[2,64],[2,64],[32,2],[33,18],[32,3],[33,19],[2,124],[32,19],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,7],[32,8],[33,9],[33,10],[32,7],[32,8],[33,11],[33,12],[32,0],[65,19],[33,13],[33,14],[32,18],[252,3],[34,15],[65,3],[108],[65,2],[106],[45,0,128,128,4,"read func lut"],[34,16],[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,15],[65,3],[108],[47,0,128,128,4,"read func lut"],[14,4,0,1,2,3,0],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,15],[17,0,0,"no_type_return","constr"],[5],[32,15],[17,0,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,15],[17,0,0,"constr"],[26],[5],[32,15],[17,0,0],[26],[11],[11],[12,3],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,15],[17,1,0,"no_type_return","constr"],[5],[32,10],[32,9],[32,15],[17,1,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,15],[17,1,0,"constr"],[26],[5],[32,10],[32,9],[32,15],[17,1,0],[26],[11],[11],[12,2],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0,"no_type_return","constr"],[5],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0,"constr"],[26],[5],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0],[26],[11],[11],[12,1],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0,"no_type_return","constr"],[5],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0,"constr"],[26],[5],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0],[26],[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"],[26],[11],[32,4],[65,9],[106],[33,4],[32,6],[65,1],[106],[34,6],[32,5],[71],[13,1],[11],[11],[68,0,0,0,0,0,0,0,0],[65,128,1],[15]],
1718
+ wasm: (scope, {internalThrow}) => [[32,0],[252,3],[33,4],[65,0],[33,6],[32,4],[40,1,0],[33,5],[3,64],[32,4],[43,0,4],[32,4],[45,0,12],[33,8],[33,7],[2,64],[2,64],[32,2],[33,18],[32,3],[33,19],[2,124],[32,19],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,7],[32,8],[33,9],[33,10],[32,7],[32,8],[33,11],[33,12],[32,0],[65,19],[33,13],[33,14],[32,18],[252,3],[34,15],[65,3],[108],[65,2],[106],[45,0,0,"read func lut"],[34,16],[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,15],[65,3],[108],[47,0,0,"read func lut"],[14,4,0,1,2,3,0],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,15],[17,0,0,"no_type_return","constr"],[5],[32,15],[17,0,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,15],[17,0,0,"constr"],[26],[5],[32,15],[17,0,0],[26],[11],[11],[12,3],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,15],[17,1,0,"no_type_return","constr"],[5],[32,10],[32,9],[32,15],[17,1,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,15],[17,1,0,"constr"],[26],[5],[32,10],[32,9],[32,15],[17,1,0],[26],[11],[11],[12,2],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0,"no_type_return","constr"],[5],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0,"constr"],[26],[5],[32,10],[32,9],[32,12],[32,11],[32,15],[17,2,0],[26],[11],[11],[12,1],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0,"no_type_return","constr"],[5],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[65,0],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0,"constr"],[26],[5],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,3,0],[26],[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"],[26],[11],[32,4],[65,9],[106],[33,4],[32,6],[65,1],[106],[34,6],[32,5],[71],[13,1],[11],[11],[68,0,0,0,0,0,0,0,0],[65,128,1],[15]],
1677
1719
  params: [124,127,124,127], typedParams: 1,
1678
1720
  returns: [124,127], typedReturns: 1,
1679
1721
  locals: [127,127,127,124,127,127,124,127,124,127,124,127,127,127,124,127], localNames: ["_this","_this#type","callbackFn","callbackFn#type","forof_base_pointer","forof_length","forof_counter","x","x#type","#indirect_arg0_type","#indirect_arg0_val","#indirect_arg1_type","#indirect_arg1_val","#indirect_arg2_type","#indirect_arg2_val","#indirect_func","#indirect_flags","#last_type","#indirect_callee","#typeswitch_tmp"],
@@ -2070,10 +2112,10 @@ export const BuiltinFuncs = function() {
2070
2112
  hasRestArgument: 1,
2071
2113
  };
2072
2114
  this.Symbol = {
2073
- wasm: (scope, {glbl,builtin}) => [[68,0,0,0,0,0,0,0,0],[33,2],[65,128,1],[33,3],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,96,64],[98],[4,64],[32,0],[32,1],[16, ...builtin('__ecma262_ToString')],[33,3],[33,2],[11],...glbl(35, 'descStore', 124),[252,3],[40,1,0],[184],[33,5],...glbl(35, 'descStore', 124),[252,3],[32,5],[252,3],[65,9],[108],[106],[34,7],[32,2],[34,6],[57,0,4],[32,7],[32,3],[58,0,12],...glbl(35, 'descStore', 124),[252,3],[32,5],[68,0,0,0,0,0,0,240,63],[160],[34,5],[34,8],[252,3],[54,1,0],[32,5],[34,9],[65,7],[15]],
2115
+ wasm: (scope, {glbl,builtin}) => [[68,0,0,0,0,0,0,0,0],[33,2],[65,128,1],[33,3],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,96,64],[98],[4,64],[32,0],[32,1],[16, ...builtin('__ecma262_ToString')],[33,3],[33,2],[11],...glbl(35, 'descStore', 124),[65,208,0],[32,2],[32,3],[16, ...builtin('__Porffor_fastPush')],[26],[34,5],[65,7],[15]],
2074
2116
  params: [124,127], typedParams: 1,
2075
2117
  returns: [124,127], typedReturns: 1,
2076
- locals: [124,127,127,124,124,127,124,124], localNames: ["description","description#type","descString","descString#type","#last_type","len","#member_setter_val_tmp","#member_setter_ptr_tmp","__length_setter_tmp","sym"],
2118
+ locals: [124,127,127,124], localNames: ["description","description#type","descString","descString#type","#last_type","sym"],
2077
2119
  globalInits: {descStore: (scope, {allocPage,glbl,loc}) => [...number(allocPage(scope, 'array: symbol.ts/descStore', 'f64') * pageSize, 124),...glbl(36, 'descStore', 124),...glbl(35, 'descStore', 124),[252,3],[33,loc('#makearray_pointer_tmp', 127)],[32,loc('#makearray_pointer_tmp', 127)],[65,0],[54,1,0],[32,loc('#makearray_pointer_tmp', 127)],[68,0,0,0,0,0,0,0,0],[252,3],[54,1,0],[32,loc('#makearray_pointer_tmp', 127)],[26]],forStore: (scope, {glbl,builtin}) => [[65,1],[68,0,0,0,0,0,0,0,0],[65,128,1],[16, ...builtin('Map')],[26],...glbl(36, 'forStore', 124)]},
2078
2120
  };
2079
2121
  this.__Symbol_prototype_description$get = {
@@ -4143,6 +4185,12 @@ export const BuiltinFuncs = function() {
4143
4185
  locals: [124,127,124,127,124,127,127], localNames: ["argument","argument#type","out","#last_type","type","#makearray_pointer_tmp","#proto_target","#proto_target#type","#typeswitch_tmp"],
4144
4186
  data: [[0,[9,0,0,0,117,110,100,101,102,105,110,101,100]]],
4145
4187
  };
4188
+ this.__ecma262_ToPropertyKey = {
4189
+ wasm: (scope, {builtin}) => [[32,0],[33,2],[32,1],[33,3],[32,2],[32,3],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,28,64],[97],[4,64],[32,2],[32,3],[15],[11],[32,2],[32,3],[16, ...builtin('__ecma262_ToString')],[34,4],[15]],
4190
+ params: [124,127], typedParams: 1,
4191
+ returns: [124,127], typedReturns: 1,
4192
+ locals: [124,127,127], localNames: ["argument","argument#type","key","key#type","#last_type"],
4193
+ };
4146
4194
  this.__Map_prototype_size$get = {
4147
4195
  wasm: (scope, {}) => [[32,0],[252,2],[40,0,0],[40,0,0],[183],[65,1],[15]],
4148
4196
  params: [124,127], typedParams: 1,
@@ -4194,16 +4242,16 @@ export const BuiltinFuncs = function() {
4194
4242
  constr: 1,
4195
4243
  };
4196
4244
  this.__Map_prototype_keys = {
4197
- wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,2],[40,0,0],[183],[33,2],[16, ...builtin('__Porffor_allocate')],[26],[33,3],[32,2],[252,3],[33,5],[65,0],[33,7],[32,5],[40,1,0],[33,6],[3,64],[32,5],[43,0,4],[32,5],[45,0,12],[33,9],[33,8],[2,64],[2,64],[32,3],[33,10],[65,208,0],[34,11],[33,12],[2,124],[32,12],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,10],[32,11],[65,128,128,20],[65,1],[54,1,0],[65,128,128,20],[32,8],[57,0,4],[65,128,128,20],[32,9],[58,0,12],[68,0,0,0,0,0,0,20,65],[65,208,0],[16, ...builtin('__Array_prototype_push')],[33,4],[12,1],[11],...internalThrow(scope, 'TypeError', `'push' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,5],[65,9],[106],[33,5],[32,7],[65,1],[106],[34,7],[32,6],[71],[13,1],[11],[11],[32,3],[65,208,0],[15]],
4245
+ wasm: (scope, {builtin}) => [[32,0],[252,2],[40,0,0],[183],[33,2],[16, ...builtin('__Porffor_allocate')],[26],[33,3],[32,2],[252,3],[33,5],[65,0],[33,7],[32,5],[40,1,0],[33,6],[3,64],[32,5],[43,0,4],[32,5],[45,0,12],[33,9],[33,8],[2,64],[32,3],[65,208,0],[32,8],[32,9],[16, ...builtin('__Porffor_fastPush')],[33,4],[26],[32,5],[65,9],[106],[33,5],[32,7],[65,1],[106],[34,7],[32,6],[71],[13,1],[11],[11],[32,3],[65,208,0],[15]],
4198
4246
  params: [124,127], typedParams: 1,
4199
4247
  returns: [124,127], typedReturns: 1,
4200
- locals: [124,124,127,127,127,127,124,127,124,127,127], localNames: ["_this","_this#type","keys","out","#last_type","forof_base_pointer","forof_length","forof_counter","x","x#type","#proto_target","#proto_target#type","#typeswitch_tmp"],
4248
+ locals: [124,124,127,127,127,127,124,127], localNames: ["_this","_this#type","keys","out","#last_type","forof_base_pointer","forof_length","forof_counter","x","x#type"],
4201
4249
  };
4202
4250
  this.__Map_prototype_values = {
4203
- wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,2],[40,0,4],[183],[33,2],[16, ...builtin('__Porffor_allocate')],[26],[33,3],[32,2],[252,3],[33,5],[65,0],[33,7],[32,5],[40,1,0],[33,6],[3,64],[32,5],[43,0,4],[32,5],[45,0,12],[33,9],[33,8],[2,64],[2,64],[32,3],[33,10],[65,208,0],[34,11],[33,12],[2,124],[32,12],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,10],[32,11],[65,128,128,40],[65,1],[54,1,0],[65,128,128,40],[32,8],[57,0,4],[65,128,128,40],[32,9],[58,0,12],[68,0,0,0,0,0,0,36,65],[65,208,0],[16, ...builtin('__Array_prototype_push')],[33,4],[12,1],[11],...internalThrow(scope, 'TypeError', `'push' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,5],[65,9],[106],[33,5],[32,7],[65,1],[106],[34,7],[32,6],[71],[13,1],[11],[11],[32,3],[65,208,0],[15]],
4251
+ wasm: (scope, {builtin}) => [[32,0],[252,2],[40,0,0],[40,0,0],[183],[33,2],[32,0],[252,2],[40,0,4],[183],[33,3],[16, ...builtin('__Porffor_allocate')],[26],[33,4],[68,0,0,0,0,0,0,0,0],[33,6],[3,64],[32,6],[32,2],[99],[4,64],[32,4],[65,208,0],[32,3],[33,7],[32,6],[34,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,9],[43,0,4],[32,9],[45,0,12],[34,5],[16, ...builtin('__Porffor_fastPush')],[33,5],[26],[32,6],[68,0,0,0,0,0,0,240,63],[160],[33,6],[12,1],[11],[11],[32,4],[65,208,0],[15]],
4204
4252
  params: [124,127], typedParams: 1,
4205
4253
  returns: [124,127], typedReturns: 1,
4206
- locals: [124,124,127,127,127,127,124,127,124,127,127], localNames: ["_this","_this#type","vals","out","#last_type","forof_base_pointer","forof_length","forof_counter","x","x#type","#proto_target","#proto_target#type","#typeswitch_tmp"],
4254
+ locals: [124,124,124,127,124,124,124,127], localNames: ["_this","_this#type","size","vals","out","#last_type","i","#member_obj","#member_prop","#loadArray_offset"],
4207
4255
  };
4208
4256
  this.__Map_prototype_toString = {
4209
4257
  wasm: (scope, {allocPage}) => [...number(allocPage(scope, 'bytestring: __Map_prototype_toString/str', 'i8') * pageSize, 124),[34,2],[65,195,1],[15]],
@@ -24,7 +24,7 @@ const compile = async (file, _funcs) => {
24
24
  first = source.slice(0, source.indexOf('\n'));
25
25
  }
26
26
 
27
- let args = ['--bytestring', '--todo-time=compile', '--truthy=no_nan_negative', '--no-treeshake-wasm-imports', '--no-rm-unused-types', '--scoped-page-names', '--funsafe-no-unlikely-proto-checks', '--fast-length', '--parse-types', '--opt-types'];
27
+ let args = ['--bytestring', '--todo-time=compile', '--truthy=no_nan_negative', '--no-treeshake-wasm-imports', '--no-rm-unused-types', '--scoped-page-names', '--funsafe-no-unlikely-proto-checks', '--fast-length', '--fast-object', '--parse-types', '--opt-types'];
28
28
  if (first.startsWith('// @porf')) {
29
29
  args = first.slice('// @porf '.length).split(' ').concat(args);
30
30
  }
package/compiler/wrap.js CHANGED
@@ -379,7 +379,7 @@ export default (source, flags = [ 'module' ], customImports = {}, print = str =>
379
379
  }
380
380
  });
381
381
  } catch (e) {
382
- if (!process.argv.includes('-i')) throw e;
382
+ if (!Prefs.d) throw e;
383
383
  if (!(e instanceof WebAssembly.CompileError)) throw e;
384
384
 
385
385
  const funcInd = parseInt(e.message.match(/function #([0-9]+)/)?.[1]);
@@ -393,7 +393,7 @@ export default (source, flags = [ 'module' ], customImports = {}, print = str =>
393
393
  if (Prefs.profileCompiler) console.log(`instantiated in ${times[1].toFixed(2)}ms`);
394
394
 
395
395
  const exports = {};
396
- const rawValues = process.argv.includes('-i');
396
+ const rawValues = Prefs.d;
397
397
 
398
398
  const exceptTag = instance.exports['0'], memory = instance.exports['$'];
399
399
  for (const x in instance.exports) {
@@ -474,7 +474,7 @@ export default (source, flags = [ 'module' ], customImports = {}, print = str =>
474
474
  }
475
475
 
476
476
  if (e instanceof WebAssembly.RuntimeError) {
477
- if (!process.argv.includes('-i')) throw e;
477
+ if (!Prefs.d) throw e;
478
478
 
479
479
  const match = e.stack.match(/wasm-function\[([0-9]+)\]:([0-9a-z]+)/) ?? [];
480
480
  const funcInd = parseInt(match[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.20.5+5eec03d30",
4
+ "version": "0.20.6+c859e2f26",
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.20.5+5eec03d30';
3
+ globalThis.version = '0.20.6+c859e2f26';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
@@ -147,7 +147,7 @@ try {
147
147
  } catch (e) {
148
148
  // if (cache) process.stdout.write(cache);
149
149
  let out = e;
150
- if (!process.argv.includes('-i') && Object.getPrototypeOf(e).message != null) out = `${e.constructor.name}${e.message != null ? `: ${e.message}` : ''}`;
150
+ if (!process.argv.includes('-d') && Object.getPrototypeOf(e).message != null) out = `${e.constructor.name}${e.message != null ? `: ${e.message}` : ''}`;
151
151
  console.error(out);
152
152
  }
153
153