porffor 0.56.2 → 0.56.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.
package/compiler/2c.js CHANGED
@@ -728,8 +728,7 @@ _time_out = _time.tv_nsec / 1000000. + _time.tv_sec * 1000.;`);
728
728
  break;
729
729
 
730
730
  case Opcodes.drop:
731
- // line(vals.pop());
732
- vals.pop();
731
+ if (vals.length > 0) line(`(void) ${vals.pop()}`);
733
732
  break;
734
733
 
735
734
  case Opcodes.block:
@@ -29,6 +29,8 @@ export const allocPage = ({ scope, pages }, name) => {
29
29
  };
30
30
 
31
31
  export const allocBytes = ({ scope, pages }, reason, bytes) => {
32
+ bytes += 2; // overallocate by 2 bytes to ensure null termination
33
+
32
34
  const allocs = pages.allocs ??= new Map();
33
35
  const bins = pages.bins ??= [];
34
36
 
@@ -522,10 +522,6 @@ export const __Porffor_object_accessorSet = (entryPtr: i32): Function|undefined
522
522
 
523
523
  export const __Porffor_object_lookup = (obj: any, target: any, targetHash: i32): i32 => {
524
524
  if (Porffor.wasm`local.get ${obj}` == 0) return -1;
525
- if (Porffor.wasm`local.get ${obj+1}` != Porffor.TYPES.object) {
526
- obj = __Porffor_object_underlying(obj);
527
- if (Porffor.wasm`local.get ${obj+1}` != Porffor.TYPES.object) return -1;
528
- }
529
525
 
530
526
  let ptr: i32 = Porffor.wasm`local.get ${obj}` + 8;
531
527
  const endPtr: i32 = ptr + Porffor.wasm.i32.load16_u(obj, 0, 0) * 18;
@@ -616,6 +612,7 @@ local.get ${obj+1}
616
612
  return`;
617
613
  }
618
614
 
615
+ if (Porffor.type(obj) != Porffor.TYPES.object) obj = __Porffor_object_underlying(obj);
619
616
  let lastProto: any = obj;
620
617
  while (true) {
621
618
  if ((entryPtr = __Porffor_object_lookup(obj, key, hash)) != -1) break;
@@ -630,6 +627,7 @@ local.set ${obj}
630
627
  i32.load8_u 0 3
631
628
  local.set ${obj+1}`;
632
629
  } else obj = __Porffor_object_getPrototype(obj);
630
+ if (Porffor.type(obj) != Porffor.TYPES.object) obj = __Porffor_object_underlying(obj);
633
631
 
634
632
  if (Porffor.fastOr(obj == null, Porffor.wasm`local.get ${obj}` == Porffor.wasm`local.get ${lastProto}`)) break;
635
633
  lastProto = obj;
@@ -691,11 +689,13 @@ export const __Porffor_object_set = (obj: any, key: any, value: any): any => {
691
689
  // check prototype chain for setter
692
690
  let proto: any = __Porffor_object_getPrototype(obj);
693
691
  if (proto != null) {
692
+ if (Porffor.type(proto) != Porffor.TYPES.object) proto = __Porffor_object_underlying(proto);
694
693
  let lastProto: any = proto;
695
694
  while (true) {
696
695
  if ((entryPtr = __Porffor_object_lookup(proto, key, hash)) != -1) break;
697
696
 
698
697
  proto = __Porffor_object_getPrototype(proto);
698
+ if (Porffor.type(proto) != Porffor.TYPES.object) proto = __Porffor_object_underlying(proto);
699
699
  if (Porffor.fastOr(proto == null, Porffor.wasm`local.get ${proto}` == Porffor.wasm`local.get ${lastProto}`)) break;
700
700
  lastProto = proto;
701
701
  }
@@ -795,11 +795,14 @@ export const __Porffor_object_setStrict = (obj: any, key: any, value: any): any
795
795
  // check prototype chain for setter
796
796
  let proto: any = __Porffor_object_getPrototype(obj);
797
797
  if (proto != null) {
798
+ if (Porffor.type(proto) != Porffor.TYPES.object) proto = __Porffor_object_underlying(proto);
799
+
798
800
  let lastProto: any = proto;
799
801
  while (true) {
800
802
  if ((entryPtr = __Porffor_object_lookup(proto, key, hash)) != -1) break;
801
803
 
802
804
  proto = __Porffor_object_getPrototype(proto);
805
+ if (Porffor.type(proto) != Porffor.TYPES.object) proto = __Porffor_object_underlying(proto);
803
806
  if (Porffor.fastOr(proto == null, Porffor.wasm`local.get ${proto}` == Porffor.wasm`local.get ${lastProto}`)) break;
804
807
  lastProto = proto;
805
808
  }
@@ -345,6 +345,7 @@ export const __Object_getOwnPropertyDescriptor = (obj: any, prop: any): object|u
345
345
  if (obj == null) throw new TypeError('Argument is nullish, expected object');
346
346
  const p: any = ecma262.ToPropertyKey(prop);
347
347
 
348
+ obj = __Porffor_object_underlying(obj);
348
349
  const entryPtr: i32 = Porffor.object.lookup(obj, p, __Porffor_object_hash(p));
349
350
  if (entryPtr == -1) {
350
351
  if (Porffor.type(obj) == Porffor.TYPES.function) {
@@ -101,9 +101,9 @@ params:[127,127],typedParams:1,returns:[127,127],
101
101
  locals:[127],localNames:["entryPtr","entryPtr#type","out"],
102
102
  }
103
103
  this.__Porffor_object_lookup = {
104
- wasm:(_,{builtin})=>[[32,0],[69],[4,64],[65,127],[15],[26],[11],[32,1],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,6],[33,1],[33,0],[32,1],[65,7],[71],[4,64],[65,127],[15],[26],[11],[11],[32,0],[65,8],[106],[34,7],[32,0],[47,0,0],[65,18],[108],[106],[33,8],[32,3],[65,5],[70],[4,64],[3,64],[32,7],[32,8],[72],[4,64],[32,7],[40,0,4],[34,9],[65,30],[118],[65,3],[70],[4,64],[32,9],[65,255,255,255,255,3],[113],[32,2],[70],[4,64],[32,7],[15],[26],[11],[11],[32,7],[65,18],[106],[33,7],[12,1],[11],[11],[5],[3,64],[32,7],[32,8],[72],[4,64],[32,7],[40,0,0],[32,4],[70],[4,64],[32,7],[40,0,4],[34,9],[32,2],[70],[4,64],[32,7],[15],[26],[11],[32,9],[65,255,255,255,255,7],[113],[65,195,0],[65,195,1],[32,9],[65,30],[118],[27],[32,2],[32,3],[16,builtin('__Porffor_strcmp')],[4,64],[32,7],[15],[11],[11],[32,7],[65,18],[106],[33,7],[12,1],[11],[11],[11],[65,127],[15]],
104
+ wasm:(_,{builtin})=>[[32,0],[69],[4,64],[65,127],[15],[26],[11],[32,0],[65,8],[106],[34,6],[32,0],[47,0,0],[65,18],[108],[106],[33,7],[32,3],[65,5],[70],[4,64],[3,64],[32,6],[32,7],[72],[4,64],[32,6],[40,0,4],[34,8],[65,30],[118],[65,3],[70],[4,64],[32,8],[65,255,255,255,255,3],[113],[32,2],[70],[4,64],[32,6],[15],[26],[11],[11],[32,6],[65,18],[106],[33,6],[12,1],[11],[11],[5],[3,64],[32,6],[32,7],[72],[4,64],[32,6],[40,0,0],[32,4],[70],[4,64],[32,6],[40,0,4],[34,8],[32,2],[70],[4,64],[32,6],[15],[26],[11],[32,8],[65,255,255,255,255,7],[113],[65,195,0],[65,195,1],[32,8],[65,30],[118],[27],[32,2],[32,3],[16,builtin('__Porffor_strcmp')],[4,64],[32,6],[15],[11],[11],[32,6],[65,18],[106],[33,6],[12,1],[11],[11],[11],[65,127],[15]],
105
105
  params:[127,127,127,127,127,127],typedParams:1,returns:[127],returnType:1,
106
- locals:[127,127,127,127],localNames:["obj","obj#type","target","target#type","targetHash","targetHash#type","#last_type","ptr","endPtr","key"],
106
+ locals:[127,127,127],localNames:["obj","obj#type","target","target#type","targetHash","targetHash#type","ptr","endPtr","key"],
107
107
  usedTypes:[5],
108
108
  }
109
109
  this.__Porffor_object_readValue = {
@@ -112,21 +112,21 @@ params:[127,127],typedParams:1,returns:[124,127],
112
112
  locals:[],localNames:["entryPtr","entryPtr#type"],
113
113
  }
114
114
  this.__Porffor_object_get = {
115
- wasm:(_,{i32ify,t,makeString,builtin,internalThrow})=>[[32,1],[34,4],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,5],[33,1],[33,0],[11],[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot get property of null`),[26],[11],[32,2],[32,3],[16,builtin('__Porffor_object_hash')],[33,6],[32,0],[32,1],[32,2],[32,3],[32,6],[65,1],[16,builtin('__Porffor_object_lookup')],[34,7],[65,127],[70],[4,64],[32,4],[65,7],[70],[4,64],[32,0],[32,0],[40,0,4],[33,0],[45,0,3],[34,1],[69],[4,64],[16,builtin('#get___Object_prototype')],[33,0],[65,7],[33,1],[11],[5],[32,4],[65,1],[16,builtin('__Porffor_object_getHiddenPrototype')],[34,5],[33,1],[33,0],[11],[32,6],[65,243,234,249,189,126],[70],[4,64],[32,2],[183],[32,3],...i32ify(makeString(_,"__proto__",1)),[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[32,0],[184],[32,1],[15],[26],[11],[11],[32,0],[33,8],[32,1],[33,9],[3,64],[65,1],[4,64],[32,0],[32,1],[32,2],[32,3],[32,6],[65,1],[16,builtin('__Porffor_object_lookup')],[34,7],[65,127],[71],[4,64],[12,1],[26],[11],[32,1],[65,7],[70],[4,64],[32,0],[32,0],[40,0,4],[33,0],[45,0,3],[33,1],[5],[32,0],[32,1],[16,builtin('__Porffor_object_getPrototype')],[34,5],[33,1],[33,0],[11],[32,0],[33,10],[32,1],[33,11],[2,127],...t([0,128],()=>[[32,11],[69],[32,11],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,11],[65,7],[70],[4,64],[32,10],[69],[12,1],[11]]),[65,0],[11],[32,0],[32,8],[70],[114],[4,64],[12,1],[26],[11],[32,0],[33,8],[32,1],[33,9],[12,1],[11],[11],[32,7],[65,127],[70],[4,64],[68,0],[65,128,1],[15],[26],[11],[11],[32,7],[47,0,16],[34,12],[65,1],[113],[4,64],[32,7],[65,1],[16,builtin('__Porffor_object_accessorGet')],[33,5],[34,13],[69],[4,64],[68,0],[65,128,1],[15],[26],[11],[32,13],[33,16],[65,0],[65,128,1],[33,17],[183],[32,17],[32,0],[34,14],[32,1],[34,15],[33,17],[183],[32,17],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,16],[17,12,0],[34,5],[15],[26],[11],[32,7],[43,0,8],[32,12],[65,8],[118],[15]],
115
+ wasm:(_,{i32ify,t,makeString,builtin,internalThrow})=>[[32,1],[34,4],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,5],[33,1],[33,0],[11],[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot get property of null`),[26],[11],[32,2],[32,3],[16,builtin('__Porffor_object_hash')],[33,6],[32,0],[32,1],[32,2],[32,3],[32,6],[65,1],[16,builtin('__Porffor_object_lookup')],[34,7],[65,127],[70],[4,64],[32,4],[65,7],[70],[4,64],[32,0],[32,0],[40,0,4],[33,0],[45,0,3],[34,1],[69],[4,64],[16,builtin('#get___Object_prototype')],[33,0],[65,7],[33,1],[11],[5],[32,4],[65,1],[16,builtin('__Porffor_object_getHiddenPrototype')],[34,5],[33,1],[33,0],[11],[32,6],[65,243,234,249,189,126],[70],[4,64],[32,2],[183],[32,3],...i32ify(makeString(_,"__proto__",1)),[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[32,0],[184],[32,1],[15],[26],[11],[11],[32,1],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,5],[33,1],[33,0],[11],[32,0],[33,8],[32,1],[33,9],[3,64],[65,1],[4,64],[32,0],[32,1],[32,2],[32,3],[32,6],[65,1],[16,builtin('__Porffor_object_lookup')],[34,7],[65,127],[71],[4,64],[12,1],[26],[11],[32,1],[65,7],[70],[4,64],[32,0],[32,0],[40,0,4],[33,0],[45,0,3],[33,1],[5],[32,0],[32,1],[16,builtin('__Porffor_object_getPrototype')],[34,5],[33,1],[33,0],[11],[32,1],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,5],[33,1],[33,0],[11],[32,0],[33,10],[32,1],[33,11],[2,127],...t([0,128],()=>[[32,11],[69],[32,11],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,11],[65,7],[70],[4,64],[32,10],[69],[12,1],[11]]),[65,0],[11],[32,0],[32,8],[70],[114],[4,64],[12,1],[26],[11],[32,0],[33,8],[32,1],[33,9],[12,1],[11],[11],[32,7],[65,127],[70],[4,64],[68,0],[65,128,1],[15],[26],[11],[11],[32,7],[47,0,16],[34,12],[65,1],[113],[4,64],[32,7],[65,1],[16,builtin('__Porffor_object_accessorGet')],[33,5],[34,13],[69],[4,64],[68,0],[65,128,1],[15],[26],[11],[32,13],[33,16],[65,0],[65,128,1],[33,17],[183],[32,17],[32,0],[34,14],[32,1],[34,15],[33,17],[183],[32,17],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,16],[17,12,0],[34,5],[15],[26],[11],[32,7],[43,0,8],[32,12],[65,8],[118],[15]],
116
116
  params:[127,127,127,127],typedParams:1,returns:[124,127],
117
117
  locals:[127,127,127,127,127,127,127,127,127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","trueType","#last_type","hash","entryPtr","lastProto","lastProto#type","#logicinner_tmp","#typeswitch_tmp1","tail","get","#call_val","#call_type","#indirect_2_callee","#swap"],
118
118
  usedTypes:[7,195],
119
119
  table:1,usesTag:1,
120
120
  }
121
121
  this.__Porffor_object_set = {
122
- wasm:(_,{i32ify,t,makeString,builtin,internalThrow})=>[[32,1],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,6],[33,1],[33,0],[32,1],[65,7],[71],[4,64],[32,4],[32,5],[15],[26],[11],[11],[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot set property of null`),[26],[11],[32,2],[32,3],[16,builtin('__Porffor_object_hash')],[33,7],[32,0],[32,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[70],[4,64],[32,7],[65,243,234,249,189,126],[70],[4,64],[32,2],[183],[32,3],...i32ify(makeString(_,"__proto__",1)),[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[32,0],[32,1],[32,4],[252,2],[32,5],[16,builtin('__Porffor_object_setPrototype')],[32,4],[32,5],[15],[26],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[34,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[69],[4,64],[32,10],[33,14],[32,11],[33,15],[3,64],[65,1],[4,64],[32,10],[32,11],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[71],[4,64],[12,1],[26],[11],[32,10],[32,11],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[34,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[32,10],[32,14],[70],[114],[4,64],[12,1],[26],[11],[32,10],[33,14],[32,11],[33,15],[12,1],[11],[11],[32,8],[65,127],[71],[4,64],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,17],[33,20],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,20],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_isInextensible')],[4,64],[32,4],[32,5],[15],[26],[11],[32,0],[47,0,0],[33,22],[32,0],[32,22],[65,1],[106],[59,0,0],[32,0],[65,8],[106],[32,22],[65,18],[108],[106],[34,8],[65,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_writeKey')],[65,14],[33,9],[5],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,17],[33,23],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,23],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[32,16],[65,8],[113],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,16],[65,255,1],[113],[33,9],[11],[32,8],[32,4],[57,0,8],[32,8],[32,9],[32,5],[65,8],[116],[106],[59,0,16],[32,4],[32,5],[15]],
122
+ wasm:(_,{i32ify,t,makeString,builtin,internalThrow})=>[[32,1],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,6],[33,1],[33,0],[32,1],[65,7],[71],[4,64],[32,4],[32,5],[15],[26],[11],[11],[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot set property of null`),[26],[11],[32,2],[32,3],[16,builtin('__Porffor_object_hash')],[33,7],[32,0],[32,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[70],[4,64],[32,7],[65,243,234,249,189,126],[70],[4,64],[32,2],[183],[32,3],...i32ify(makeString(_,"__proto__",1)),[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[32,0],[32,1],[32,4],[252,2],[32,5],[16,builtin('__Porffor_object_setPrototype')],[32,4],[32,5],[15],[26],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[34,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[69],[4,64],[32,11],[65,7],[71],[4,64],[32,10],[183],[32,11],[16,builtin('__Porffor_object_underlying')],[34,6],[33,11],[33,10],[11],[32,10],[33,14],[32,11],[33,15],[3,64],[65,1],[4,64],[32,10],[32,11],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[71],[4,64],[12,1],[26],[11],[32,10],[32,11],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[33,10],[32,11],[65,7],[71],[4,64],[32,10],[183],[32,11],[16,builtin('__Porffor_object_underlying')],[34,6],[33,11],[33,10],[11],[32,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[32,10],[32,14],[70],[114],[4,64],[12,1],[26],[11],[32,10],[33,14],[32,11],[33,15],[12,1],[11],[11],[32,8],[65,127],[71],[4,64],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,17],[33,20],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,20],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_isInextensible')],[4,64],[32,4],[32,5],[15],[26],[11],[32,0],[47,0,0],[33,22],[32,0],[32,22],[65,1],[106],[59,0,0],[32,0],[65,8],[106],[32,22],[65,18],[108],[106],[34,8],[65,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_writeKey')],[65,14],[33,9],[5],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,17],[33,23],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,23],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[32,16],[65,8],[113],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,16],[65,255,1],[113],[33,9],[11],[32,8],[32,4],[57,0,8],[32,8],[32,9],[32,5],[65,8],[116],[106],[59,0,16],[32,4],[32,5],[15]],
123
123
  params:[127,127,127,127,124,127],typedParams:1,returns:[124,127],
124
124
  locals:[127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","value","value#type","#last_type","hash","entryPtr","flags","proto","proto#type","#logicinner_tmp","#typeswitch_tmp1","lastProto","lastProto#type","tail","set","#call_val","#call_type","#indirect_3_callee","#swap","size","#indirect_4_callee"],
125
125
  usedTypes:[195],
126
126
  table:1,usesTag:1,
127
127
  }
128
128
  this.__Porffor_object_setStrict = {
129
- wasm:(_,{i32ify,t,makeString,builtin,internalThrow})=>[[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot set property of null`),[26],[11],[32,1],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,6],[33,1],[33,0],[32,1],[65,7],[71],[4,64],[32,4],[32,5],[15],[26],[11],[11],[32,2],[32,3],[16,builtin('__Porffor_object_hash')],[33,7],[32,0],[32,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[70],[4,64],[32,7],[65,243,234,249,189,126],[70],[4,64],[32,2],[183],[32,3],...i32ify(makeString(_,"__proto__",1)),[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[32,0],[32,1],[32,4],[252,2],[32,5],[16,builtin('__Porffor_object_setPrototype')],[32,4],[32,5],[15],[26],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[34,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[69],[4,64],[32,10],[33,14],[32,11],[33,15],[3,64],[65,1],[4,64],[32,10],[32,11],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[71],[4,64],[12,1],[26],[11],[32,10],[32,11],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[34,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[32,10],[32,14],[70],[114],[4,64],[12,1],[26],[11],[32,10],[33,14],[32,11],[33,15],[12,1],[11],[11],[32,8],[65,127],[71],[4,64],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,17],[33,20],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,20],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_isInextensible')],[4,64],...internalThrow(_,'TypeError',`Cannot add property to inextensible object`),[26],[11],[32,0],[47,0,0],[33,22],[32,0],[32,22],[65,1],[106],[59,0,0],[32,0],[65,8],[106],[32,22],[65,18],[108],[106],[34,8],[65,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_writeKey')],[65,14],[33,9],[5],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],...internalThrow(_,'TypeError',`Cannot set property with no setter of object`),[26],[11],[32,17],[33,23],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,23],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[32,16],[65,8],[113],[69],[4,64],...internalThrow(_,'TypeError',`Cannot modify read-only property of object`),[26],[11],[32,16],[65,255,1],[113],[33,9],[11],[32,8],[32,4],[57,0,8],[32,8],[32,9],[32,5],[65,8],[116],[106],[59,0,16],[32,4],[32,5],[15]],
129
+ wasm:(_,{i32ify,t,makeString,builtin,internalThrow})=>[[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot set property of null`),[26],[11],[32,1],[65,7],[71],[4,64],[32,0],[183],[32,1],[16,builtin('__Porffor_object_underlying')],[34,6],[33,1],[33,0],[32,1],[65,7],[71],[4,64],[32,4],[32,5],[15],[26],[11],[11],[32,2],[32,3],[16,builtin('__Porffor_object_hash')],[33,7],[32,0],[32,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[70],[4,64],[32,7],[65,243,234,249,189,126],[70],[4,64],[32,2],[183],[32,3],...i32ify(makeString(_,"__proto__",1)),[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[32,0],[32,1],[32,4],[252,2],[32,5],[16,builtin('__Porffor_object_setPrototype')],[32,4],[32,5],[15],[26],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[34,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[69],[4,64],[32,11],[65,7],[71],[4,64],[32,10],[183],[32,11],[16,builtin('__Porffor_object_underlying')],[34,6],[33,11],[33,10],[11],[32,10],[33,14],[32,11],[33,15],[3,64],[65,1],[4,64],[32,10],[32,11],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_lookup')],[34,8],[65,127],[71],[4,64],[12,1],[26],[11],[32,10],[32,11],[16,builtin('__Porffor_object_getPrototype')],[34,6],[33,11],[33,10],[32,11],[65,7],[71],[4,64],[32,10],[183],[32,11],[16,builtin('__Porffor_object_underlying')],[34,6],[33,11],[33,10],[11],[32,10],[33,12],[32,11],[33,13],[2,127],...t([0,128],()=>[[32,13],[69],[32,13],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,13],[65,7],[70],[4,64],[32,12],[69],[12,1],[11]]),[65,0],[11],[32,10],[32,14],[70],[114],[4,64],[12,1],[26],[11],[32,10],[33,14],[32,11],[33,15],[12,1],[11],[11],[32,8],[65,127],[71],[4,64],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],[32,4],[32,5],[15],[26],[11],[32,17],[33,20],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,20],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[11],[11],[32,0],[32,1],[16,builtin('__Porffor_object_isInextensible')],[4,64],...internalThrow(_,'TypeError',`Cannot add property to inextensible object`),[26],[11],[32,0],[47,0,0],[33,22],[32,0],[32,22],[65,1],[106],[59,0,0],[32,0],[65,8],[106],[32,22],[65,18],[108],[106],[34,8],[65,1],[32,2],[32,3],[32,7],[65,1],[16,builtin('__Porffor_object_writeKey')],[65,14],[33,9],[5],[32,8],[47,0,16],[34,16],[65,1],[113],[4,64],[32,8],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,6],[34,17],[69],[4,64],...internalThrow(_,'TypeError',`Cannot set property with no setter of object`),[26],[11],[32,17],[33,23],[65,0],[65,128,1],[33,21],[183],[32,21],[32,0],[34,18],[32,1],[34,19],[33,21],[183],[32,21],[32,4],[32,5],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[65,0],[183],[65,128,1],[32,23],[17,12,0],[33,6],[26],[32,4],[32,5],[15],[26],[11],[32,16],[65,8],[113],[69],[4,64],...internalThrow(_,'TypeError',`Cannot modify read-only property of object`),[26],[11],[32,16],[65,255,1],[113],[33,9],[11],[32,8],[32,4],[57,0,8],[32,8],[32,9],[32,5],[65,8],[116],[106],[59,0,16],[32,4],[32,5],[15]],
130
130
  params:[127,127,127,127,124,127],typedParams:1,returns:[124,127],
131
131
  locals:[127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","value","value#type","#last_type","hash","entryPtr","flags","proto","proto#type","#logicinner_tmp","#typeswitch_tmp1","lastProto","lastProto#type","tail","set","#call_val","#call_type","#indirect_5_callee","#swap","size","#indirect_6_callee"],
132
132
  usedTypes:[195],
@@ -196,14 +196,14 @@ locals:[127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","
196
196
  usesTag:1,
197
197
  }
198
198
  this.__Porffor_compareStrings = {
199
- wasm:(_,{t,builtin})=>[[32,1],[184],[33,4],[32,3],[184],[33,5],[32,4],[252,2],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,0],[33,6],[32,1],[33,7],[2,127],...t([0,128],()=>[[32,7],[65,0],[70],[32,7],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,7],[65,7],[70],[4,64],[32,6],[68,0],[97],[12,1],[11]]),[65,0],[11],[32,4],[68,5],[97],[114],[32,4],[68,2],[97],[114],[4,64],[68,0],[15],[26],[11],[32,0],[32,1],[16,builtin('__ecma262_ToString')],[34,8],[33,1],[33,0],[11],[32,5],[252,2],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,2],[33,6],[32,3],[33,7],[2,127],...t([0,128],()=>[[32,7],[65,0],[70],[32,7],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,7],[65,7],[70],[4,64],[32,6],[68,0],[97],[12,1],[11]]),[65,0],[11],[32,5],[68,5],[97],[114],[32,5],[68,2],[97],[114],[4,64],[68,0],[15],[26],[11],[32,2],[32,3],[16,builtin('__ecma262_ToString')],[34,8],[33,3],[33,2],[11],[32,0],[252,2],[32,1],[32,2],[252,2],[32,3],[16,builtin('__Porffor_strcmp')],[183],[15]],
199
+ wasm:(_,{t,builtin})=>[[32,1],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,0],[33,4],[32,1],[33,5],[2,127],...t([0,128],()=>[[32,5],[65,0],[70],[32,5],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,5],[65,7],[70],[4,64],[32,4],[68,0],[97],[12,1],[11]]),[65,0],[11],[32,1],[184],[68,5],[97],[114],[32,1],[184],[68,2],[97],[114],[4,64],[68,0],[15],[26],[11],[32,0],[32,1],[16,builtin('__ecma262_ToString')],[34,6],[33,1],[33,0],[11],[32,3],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,2],[33,4],[32,3],[33,5],[2,127],...t([0,128],()=>[[32,5],[65,0],[70],[32,5],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,5],[65,7],[70],[4,64],[32,4],[68,0],[97],[12,1],[11]]),[65,0],[11],[32,3],[184],[68,5],[97],[114],[32,3],[184],[68,2],[97],[114],[4,64],[68,0],[15],[26],[11],[32,2],[32,3],[16,builtin('__ecma262_ToString')],[34,6],[33,3],[33,2],[11],[32,0],[252,2],[32,1],[32,2],[252,2],[32,3],[16,builtin('__Porffor_strcmp')],[183],[15]],
200
200
  params:[124,127,124,127],typedParams:1,returns:[124],returnType:2,
201
- locals:[124,124,124,127,127],localNames:["a","a#type","b","b#type","at","bt","#logicinner_tmp","#typeswitch_tmp1","#last_type"],
201
+ locals:[124,127,127],localNames:["a","a#type","b","b#type","#logicinner_tmp","#typeswitch_tmp1","#last_type"],
202
202
  }
203
203
  this.__Porffor_concatStrings = {
204
- wasm:(_,{builtin})=>[[32,1],[184],[33,4],[32,3],[184],[33,5],[32,4],[252,2],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,0],[32,1],[16,builtin('__ecma262_ToString')],[34,6],[33,1],[33,0],[11],[32,5],[252,2],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,2],[32,3],[16,builtin('__ecma262_ToString')],[34,6],[33,3],[33,2],[11],[32,0],[252,2],[32,1],[32,2],[252,2],[32,3],[16,builtin('__Porffor_strcat')],[33,6],[183],[32,6],[15]],
204
+ wasm:(_,{builtin})=>[[32,1],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,0],[32,1],[16,builtin('__ecma262_ToString')],[34,4],[33,1],[33,0],[11],[32,3],[65,128,1],[114],[183],[68,195],[98],[4,64],[32,2],[32,3],[16,builtin('__ecma262_ToString')],[34,4],[33,3],[33,2],[11],[32,0],[252,2],[32,1],[32,2],[252,2],[32,3],[16,builtin('__Porffor_strcat')],[33,4],[183],[32,4],[15]],
205
205
  params:[124,127,124,127],typedParams:1,returns:[124,127],
206
- locals:[124,124,127],localNames:["a","a#type","b","b#type","at","bt","#last_type"],
206
+ locals:[127],localNames:["a","a#type","b","b#type","#last_type"],
207
207
  }
208
208
  this.__String_prototype_big = {
209
209
  wasm:(_,{makeString,builtin})=>[...makeString(_,"<big>",1),[65,195,1],[32,0],[32,1],[16,builtin('__Porffor_concatStrings')],[34,2],...makeString(_,"</big>",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,2],[15]],
@@ -2258,7 +2258,7 @@ params:[124,127],typedParams:1,returns:[124],returnType:2,
2258
2258
  locals:[],localNames:["obj","obj#type"],
2259
2259
  }
2260
2260
  this.__Object_getOwnPropertyDescriptor = {
2261
- wasm:(_,{t,makeString,builtin,internalThrow})=>[[32,0],[33,4],[32,1],[33,5],[2,127],...t([0,128],()=>[[32,5],[65,0],[70],[32,5],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,5],[65,7],[70],[4,64],[32,4],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,64],...internalThrow(_,'TypeError',`Argument is nullish, expected object`),[26],[11],[32,2],[32,3],[16,builtin('__ecma262_ToPropertyKey')],[34,8],[33,7],[33,6],[32,0],[252,2],[32,1],[32,6],[252,2],[32,7],[32,6],[252,2],[32,7],[16,builtin('__Porffor_object_hash')],[65,1],[16,builtin('__Porffor_object_lookup')],[183],[34,9],[68,-1],[97],[4,64],[32,1],[184],[68,6],[97],[4,64],[32,6],[33,13],[32,0],[33,12],[32,1],[33,5],[2,124],...t([67],()=>[[32,5],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,14],[65,1],[54,0,0],[32,14],[32,13],[252,3],[65,2],[108],[32,12],[252,3],[106],[47,0,4],[59,0,4],[32,14],[184],[65,195,0],[33,8],[12,1],[11]]),...t([72],()=>[[32,5],[65,200,0],[70],[4,64],[32,13],[252,3],[65,9],[108],[32,12],[252,3],[106],[34,15],[43,0,4],[32,15],[45,0,12],[33,8],[12,1],[11]]),...t([80],()=>[[32,5],[65,208,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([81],()=>[[32,5],[65,209,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[44,0,4],[183],[65,1],[33,8],[12,1],[11]]),...t([82],()=>[[32,5],[65,210,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([83],()=>[[32,5],[65,211,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([84],()=>[[32,5],[65,212,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,8],[12,1],[11]]),...t([85],()=>[[32,5],[65,213,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([86],()=>[[32,5],[65,214,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,8],[12,1],[11]]),...t([87],()=>[[32,5],[65,215,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,8],[12,1],[11]]),...t([88],()=>[[32,5],[65,216,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,8],[12,1],[11]]),...t([128],()=>[[32,5],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,5],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,14],[65,1],[54,0,0],[32,14],[32,13],[252,3],[32,12],[252,3],[106],[45,0,4],[58,0,4],[32,14],[184],[65,195,1],[33,8],[12,1],[11]]),[32,12],[252,2],[32,1],[32,13],[32,7],[16,builtin('__ecma262_ToPropertyKey')],[33,16],[252,2],[32,16],[16,builtin('__Porffor_object_get')],[33,8],[11],[33,10],[32,8],[33,11],[32,10],[33,4],[32,11],[33,5],[2,127],...t([0,128],()=>[[32,5],[65,0],[70],[32,5],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,5],[65,7],[70],[4,64],[32,4],[68,0],[97],[12,1],[11]]),[65,0],[11],[69],[4,64],[16,builtin('__Porffor_allocate')],[184],[34,17],[33,19],...makeString(_,"writable",1),[33,20],[32,19],[252,2],[65,7],[32,20],[252,3],[65,195,1],[68,0],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,21],...makeString(_,"enumerable",1),[33,22],[32,21],[252,2],[65,7],[32,22],[252,3],[65,195,1],[68,0],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,23],...makeString(_,"configurable",1),[33,24],[32,23],[252,2],[65,7],[32,24],[252,3],[65,195,1],[68,1],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,25],...makeString(_,"value",1),[33,26],[32,25],[252,2],[65,7],[32,26],[252,3],[65,195,1],[32,10],[32,11],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[65,7],[15],[26],[11],[11],[68,0],[65,128,1],[15],[26],[11],[32,9],[252,2],[47,0,16],[183],[33,27],[16,builtin('__Porffor_allocate')],[184],[34,17],[33,28],...makeString(_,"configurable",1),[33,29],[32,28],[252,2],[65,7],[32,29],[252,3],[65,195,1],[32,27],[252,2],[65,2],[113],[183],[68,0],[98],[184],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,30],...makeString(_,"enumerable",1),[33,31],[32,30],[252,2],[65,7],[32,31],[252,3],[65,195,1],[32,27],[252,2],[65,4],[113],[183],[68,0],[98],[184],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,27],[252,2],[65,1],[113],[4,64],[32,17],[33,32],...makeString(_,"get",1),[33,33],[32,32],[252,2],[65,7],[32,33],[252,3],[65,195,1],[32,9],[252,2],[65,1],[16,builtin('__Porffor_object_accessorGet')],[33,8],[183],[32,8],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,34],...makeString(_,"set",1),[33,35],[32,34],[252,2],[65,7],[32,35],[252,3],[65,195,1],[32,9],[252,2],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,8],[183],[32,8],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[65,7],[15],[26],[11],[32,9],[252,2],[43,0,8],[33,36],[65,1],[33,37],[32,27],[252,3],[65,8],[118],[33,37],[32,17],[33,38],...makeString(_,"writable",1),[33,39],[32,38],[252,2],[65,7],[32,39],[252,3],[65,195,1],[32,27],[252,2],[65,8],[113],[183],[68,0],[98],[184],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,40],...makeString(_,"value",1),[33,41],[32,40],[252,2],[65,7],[32,41],[252,3],[65,195,1],[32,36],[32,37],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[65,7],[15]],
2261
+ wasm:(_,{t,makeString,builtin,internalThrow})=>[[32,0],[33,4],[32,1],[33,5],[2,127],...t([0,128],()=>[[32,5],[65,0],[70],[32,5],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,5],[65,7],[70],[4,64],[32,4],[68,0],[97],[12,1],[11]]),[65,0],[11],[4,64],...internalThrow(_,'TypeError',`Argument is nullish, expected object`),[26],[11],[32,2],[32,3],[16,builtin('__ecma262_ToPropertyKey')],[34,8],[33,7],[33,6],[32,0],[32,1],[16,builtin('__Porffor_object_underlying')],[33,8],[183],[33,0],[32,8],[33,1],[32,0],[252,2],[32,1],[32,6],[252,2],[32,7],[32,6],[252,2],[32,7],[16,builtin('__Porffor_object_hash')],[65,1],[16,builtin('__Porffor_object_lookup')],[183],[34,9],[68,-1],[97],[4,64],[32,1],[184],[68,6],[97],[4,64],[32,6],[33,13],[32,0],[33,12],[32,1],[33,5],[2,124],...t([67],()=>[[32,5],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,14],[65,1],[54,0,0],[32,14],[32,13],[252,3],[65,2],[108],[32,12],[252,3],[106],[47,0,4],[59,0,4],[32,14],[184],[65,195,0],[33,8],[12,1],[11]]),...t([72],()=>[[32,5],[65,200,0],[70],[4,64],[32,13],[252,3],[65,9],[108],[32,12],[252,3],[106],[34,15],[43,0,4],[32,15],[45,0,12],[33,8],[12,1],[11]]),...t([80],()=>[[32,5],[65,208,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([81],()=>[[32,5],[65,209,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[44,0,4],[183],[65,1],[33,8],[12,1],[11]]),...t([82],()=>[[32,5],[65,210,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([83],()=>[[32,5],[65,211,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([84],()=>[[32,5],[65,212,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,8],[12,1],[11]]),...t([85],()=>[[32,5],[65,213,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,8],[12,1],[11]]),...t([86],()=>[[32,5],[65,214,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,8],[12,1],[11]]),...t([87],()=>[[32,5],[65,215,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,8],[12,1],[11]]),...t([88],()=>[[32,5],[65,216,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,8],[12,1],[11]]),...t([128],()=>[[32,5],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,5],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,14],[65,1],[54,0,0],[32,14],[32,13],[252,3],[32,12],[252,3],[106],[45,0,4],[58,0,4],[32,14],[184],[65,195,1],[33,8],[12,1],[11]]),[32,12],[252,2],[32,1],[32,13],[32,7],[16,builtin('__ecma262_ToPropertyKey')],[33,16],[252,2],[32,16],[16,builtin('__Porffor_object_get')],[33,8],[11],[33,10],[32,8],[33,11],[32,10],[33,4],[32,11],[33,5],[2,127],...t([0,128],()=>[[32,5],[65,0],[70],[32,5],[65,128,1],[70],[114],[4,64],[65,1],[12,1],[11]]),...t([7],()=>[[32,5],[65,7],[70],[4,64],[32,4],[68,0],[97],[12,1],[11]]),[65,0],[11],[69],[4,64],[16,builtin('__Porffor_allocate')],[184],[34,17],[33,19],...makeString(_,"writable",1),[33,20],[32,19],[252,2],[65,7],[32,20],[252,3],[65,195,1],[68,0],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,21],...makeString(_,"enumerable",1),[33,22],[32,21],[252,2],[65,7],[32,22],[252,3],[65,195,1],[68,0],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,23],...makeString(_,"configurable",1),[33,24],[32,23],[252,2],[65,7],[32,24],[252,3],[65,195,1],[68,1],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,25],...makeString(_,"value",1),[33,26],[32,25],[252,2],[65,7],[32,26],[252,3],[65,195,1],[32,10],[32,11],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[65,7],[15],[26],[11],[11],[68,0],[65,128,1],[15],[26],[11],[32,9],[252,2],[47,0,16],[183],[33,27],[16,builtin('__Porffor_allocate')],[184],[34,17],[33,28],...makeString(_,"configurable",1),[33,29],[32,28],[252,2],[65,7],[32,29],[252,3],[65,195,1],[32,27],[252,2],[65,2],[113],[183],[68,0],[98],[184],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,30],...makeString(_,"enumerable",1),[33,31],[32,30],[252,2],[65,7],[32,31],[252,3],[65,195,1],[32,27],[252,2],[65,4],[113],[183],[68,0],[98],[184],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,27],[252,2],[65,1],[113],[4,64],[32,17],[33,32],...makeString(_,"get",1),[33,33],[32,32],[252,2],[65,7],[32,33],[252,3],[65,195,1],[32,9],[252,2],[65,1],[16,builtin('__Porffor_object_accessorGet')],[33,8],[183],[32,8],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,34],...makeString(_,"set",1),[33,35],[32,34],[252,2],[65,7],[32,35],[252,3],[65,195,1],[32,9],[252,2],[65,1],[16,builtin('__Porffor_object_accessorSet')],[33,8],[183],[32,8],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[65,7],[15],[26],[11],[32,9],[252,2],[43,0,8],[33,36],[65,1],[33,37],[32,27],[252,3],[65,8],[118],[33,37],[32,17],[33,38],...makeString(_,"writable",1),[33,39],[32,38],[252,2],[65,7],[32,39],[252,3],[65,195,1],[32,27],[252,2],[65,8],[113],[183],[68,0],[98],[184],[65,2],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[33,40],...makeString(_,"value",1),[33,41],[32,40],[252,2],[65,7],[32,41],[252,3],[65,195,1],[32,36],[32,37],[16,builtin('__Porffor_object_set')],[26],[26],[32,17],[65,7],[15]],
2262
2262
  params:[124,127,124,127],typedParams:1,returns:[124,127],
2263
2263
  locals:[124,127,124,127,127,124,124,127,124,124,127,127,127,124,127,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,127,124,124,124,124],localNames:["obj","obj#type","prop","prop#type","#logicinner_tmp","#typeswitch_tmp1","p","p#type","#last_type","entryPtr","v","v#type","#member_obj_205","#member_prop_205","#member_allocd","#loadArray_offset","#swap","out","#member_setter_ptr_tmp","#member_obj_206","#member_prop_206","#member_obj_207","#member_prop_207","#member_obj_208","#member_prop_208","#member_obj_209","#member_prop_209","tail","#member_obj_210","#member_prop_210","#member_obj_211","#member_prop_211","#member_obj_212","#member_prop_212","#member_obj_213","#member_prop_213","value","value#type","#member_obj_214","#member_prop_214","#member_obj_215","#member_prop_215"],
2264
2264
  usedTypes:[67,195,7],
@@ -506,9 +506,8 @@ const lookup = (scope, name, failEarly = false) => {
506
506
  const lookupOrError = (scope, name, failEarly) => lookup(scope, name, failEarly)
507
507
  ?? internalThrow(scope, 'ReferenceError', `${unhackName(name)} is not defined`, true);
508
508
 
509
- const generateIdent = (scope, decl) => {
510
- return lookupOrError(scope, decl.name, scope.identFailEarly);
511
- };
509
+ const generateIdent = (scope, decl) =>
510
+ lookupOrError(scope, decl.name, scope.identFailEarly);
512
511
 
513
512
  const generateYield = (scope, decl) => {
514
513
  let arg = decl.argument ?? DEFAULT_VALUE();
@@ -761,21 +760,19 @@ const performLogicOp = (scope, op, left, right, leftType, rightType) => {
761
760
  ];
762
761
  };
763
762
 
764
- const concatStrings = (scope, left, right, leftType, rightType) => {
765
- return [
766
- ...left,
767
- ...(valtypeBinary === Valtype.i32 ? [ [ Opcodes.f64_convert_i32_s ] ] : []),
768
- ...leftType,
763
+ const concatStrings = (scope, left, right, leftType, rightType) => [
764
+ ...left,
765
+ ...(valtypeBinary === Valtype.i32 ? [ [ Opcodes.f64_convert_i32_s ] ] : []),
766
+ ...leftType,
769
767
 
770
- ...right,
771
- ...(valtypeBinary === Valtype.i32 ? [ [ Opcodes.f64_convert_i32_s ] ] : []),
772
- ...rightType,
768
+ ...right,
769
+ ...(valtypeBinary === Valtype.i32 ? [ [ Opcodes.f64_convert_i32_s ] ] : []),
770
+ ...rightType,
773
771
 
774
- [ Opcodes.call, includeBuiltin(scope, '__Porffor_concatStrings').index ],
775
- ...setLastType(scope),
776
- ...(valtypeBinary === Valtype.i32 ? [ Opcodes.i32_trunc_sat_f64_u ] : []),
777
- ];
778
- };
772
+ [ Opcodes.call, includeBuiltin(scope, '__Porffor_concatStrings').index ],
773
+ ...setLastType(scope),
774
+ ...(valtypeBinary === Valtype.i32 ? [ Opcodes.i32_trunc_sat_f64_u ] : []),
775
+ ];
779
776
 
780
777
  const compareStrings = (scope, left, right, leftType, rightType, noConv = false) => {
781
778
  if (noConv) return [
@@ -1239,89 +1236,87 @@ const generateBinaryExp = (scope, decl) => {
1239
1236
  return out;
1240
1237
  };
1241
1238
 
1242
- const asmFuncToAsm = (scope, func, extra) => {
1243
- return func(scope, {
1244
- Valtype, Opcodes, TYPES, TYPE_NAMES, usedTypes, typeSwitch, makeString, internalThrow,
1245
- getNodeType, generate, generateIdent,
1246
- builtin: (n, offset = false) => {
1247
- let idx = funcIndex[n] ?? importedFuncs[n];
1248
- if (idx == null && builtinFuncs[n]) {
1249
- includeBuiltin(scope, n);
1250
- idx = funcIndex[n];
1251
- }
1239
+ const asmFuncToAsm = (scope, func, extra) => func(scope, {
1240
+ Valtype, Opcodes, TYPES, TYPE_NAMES, usedTypes, typeSwitch, makeString, internalThrow,
1241
+ getNodeType, generate, generateIdent,
1242
+ builtin: (n, offset = false) => {
1243
+ let idx = funcIndex[n] ?? importedFuncs[n];
1244
+ if (idx == null && builtinFuncs[n]) {
1245
+ includeBuiltin(scope, n);
1246
+ idx = funcIndex[n];
1247
+ }
1252
1248
 
1253
- scope.includes ??= new Set();
1254
- scope.includes.add(n);
1249
+ scope.includes ??= new Set();
1250
+ scope.includes.add(n);
1255
1251
 
1256
- if (idx == null) throw new Error(`builtin('${n}') failed: could not find func (from ${scope.name})`);
1257
- if (offset) idx -= importedFuncs.length;
1252
+ if (idx == null) throw new Error(`builtin('${n}') failed: could not find func (from ${scope.name})`);
1253
+ if (offset) idx -= importedFuncs.length;
1258
1254
 
1259
- return idx;
1260
- },
1261
- hasFunc: x => funcIndex[x] != null,
1262
- funcRef: name => {
1263
- if (funcIndex[name] == null && builtinFuncs[name]) {
1264
- includeBuiltin(scope, name);
1265
- }
1255
+ return idx;
1256
+ },
1257
+ hasFunc: x => funcIndex[x] != null,
1258
+ funcRef: name => {
1259
+ if (funcIndex[name] == null && builtinFuncs[name]) {
1260
+ includeBuiltin(scope, name);
1261
+ }
1266
1262
 
1267
- const func = funcByName(name);
1268
- return funcRef(func);
1269
- },
1270
- glbl: (opcode, name, type) => {
1271
- const globalName = '#porf#' + name; // avoid potential name clashing with user js
1272
- if (!globals[globalName]) {
1273
- const idx = globals['#ind']++;
1274
- globals[globalName] = { idx, type };
1275
-
1276
- const tmpIdx = globals['#ind']++;
1277
- globals[globalName + '#glbl_inited'] = { idx: tmpIdx, type: Valtype.i32 };
1278
- }
1263
+ const func = funcByName(name);
1264
+ return funcRef(func);
1265
+ },
1266
+ glbl: (opcode, name, type) => {
1267
+ const globalName = '#porf#' + name; // avoid potential name clashing with user js
1268
+ if (!globals[globalName]) {
1269
+ const idx = globals['#ind']++;
1270
+ globals[globalName] = { idx, type };
1271
+
1272
+ const tmpIdx = globals['#ind']++;
1273
+ globals[globalName + '#glbl_inited'] = { idx: tmpIdx, type: Valtype.i32 };
1274
+ }
1279
1275
 
1280
- const out = [
1281
- [ opcode, globals[globalName].idx ]
1282
- ];
1276
+ const out = [
1277
+ [ opcode, globals[globalName].idx ]
1278
+ ];
1283
1279
 
1284
- scope.initedGlobals ??= new Set();
1285
- if (!scope.initedGlobals.has(name)) {
1286
- scope.initedGlobals.add(name);
1287
- if (scope.globalInits[name]) out.unshift(
1288
- [ Opcodes.global_get, globals[globalName + '#glbl_inited'].idx ],
1289
- [ Opcodes.i32_eqz ],
1290
- [ Opcodes.if, Blocktype.void ],
1291
- ...asmFuncToAsm(scope, scope.globalInits[name]),
1292
- number(1, Valtype.i32),
1293
- [ Opcodes.global_set, globals[globalName + '#glbl_inited'].idx ],
1294
- [ Opcodes.end ]
1295
- );
1296
- }
1280
+ scope.initedGlobals ??= new Set();
1281
+ if (!scope.initedGlobals.has(name)) {
1282
+ scope.initedGlobals.add(name);
1283
+ if (scope.globalInits[name]) out.unshift(
1284
+ [ Opcodes.global_get, globals[globalName + '#glbl_inited'].idx ],
1285
+ [ Opcodes.i32_eqz ],
1286
+ [ Opcodes.if, Blocktype.void ],
1287
+ ...asmFuncToAsm(scope, scope.globalInits[name]),
1288
+ number(1, Valtype.i32),
1289
+ [ Opcodes.global_set, globals[globalName + '#glbl_inited'].idx ],
1290
+ [ Opcodes.end ]
1291
+ );
1292
+ }
1297
1293
 
1298
- return out;
1299
- },
1300
- loc: (name, type) => {
1301
- if (!scope.locals[name]) {
1302
- const idx = scope.localInd++;
1303
- scope.locals[name] = { idx, type };
1304
- }
1294
+ return out;
1295
+ },
1296
+ loc: (name, type) => {
1297
+ if (!scope.locals[name]) {
1298
+ const idx = scope.localInd++;
1299
+ scope.locals[name] = { idx, type };
1300
+ }
1305
1301
 
1306
- return scope.locals[name].idx;
1307
- },
1308
- t: (types, wasm) => {
1309
- if (types.some(x => usedTypes.has(x))) {
1310
- return wasm();
1311
- } else {
1312
- return [ [ null, () => {
1313
- if (types.some(x => usedTypes.has(x))) return wasm();
1314
- return [];
1315
- } ] ];
1316
- }
1317
- },
1318
- i32ify: wasm => {
1319
- wasm.push(Opcodes.i32_to_u);
1320
- return wasm;
1321
- },
1322
- allocPage: (scope, name) => allocPage({ scope, pages }, name)
1323
- }, extra);
1324
- };
1302
+ return scope.locals[name].idx;
1303
+ },
1304
+ t: (types, wasm) => {
1305
+ if (types.some(x => usedTypes.has(x))) {
1306
+ return wasm();
1307
+ } else {
1308
+ return [ [ null, () => {
1309
+ if (types.some(x => usedTypes.has(x))) return wasm();
1310
+ return [];
1311
+ } ] ];
1312
+ }
1313
+ },
1314
+ i32ify: wasm => {
1315
+ wasm.push(Opcodes.i32_to_u);
1316
+ return wasm;
1317
+ },
1318
+ allocPage: (scope, name) => allocPage({ scope, pages }, name)
1319
+ }, extra);
1325
1320
 
1326
1321
  const asmFunc = (name, { wasm, params = [], typedParams = false, locals: localTypes = [], globals: globalTypes = [], globalInits = [], returns = [], returnType, localNames = [], globalNames = [], table = false, constr = false, hasRestArgument = false, usesTag = false, usesImports = false, usedTypes = [] } = {}) => {
1327
1322
  if (wasm == null) { // called with no built-in
@@ -1393,9 +1388,8 @@ const includeBuiltin = (scope, builtin) => {
1393
1388
  return asmFunc(builtin, builtinFuncs[builtin]);
1394
1389
  };
1395
1390
 
1396
- const generateLogicExp = (scope, decl) => {
1397
- return performLogicOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right));
1398
- };
1391
+ const generateLogicExp = (scope, decl) =>
1392
+ performLogicOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right));
1399
1393
 
1400
1394
  const isExistingProtoFunc = name => {
1401
1395
  if (name.startsWith('__Array_prototype')) return !!prototypeFuncs[TYPES.array][name.slice(18)];
@@ -3201,7 +3195,7 @@ const setDefaultFuncName = (decl, name) => {
3201
3195
  const generateVarDstr = (scope, kind, pattern, init, defaultValue, global) => {
3202
3196
  // statically analyzed ffi dlopen hack to let 2c handle it
3203
3197
  if (init && init.type === 'CallExpression' && init.callee.name === '__Porffor_dlopen') {
3204
- if (Prefs.target !== 'native' && !Prefs.native) throw new Error('Porffor.dlopen is only supported for native target (use --native)');
3198
+ if (Prefs.target !== 'native' && Prefs.target !== 'c' && !Prefs.native) throw new Error('Porffor.dlopen is only supported for native target (use --native)');
3205
3199
 
3206
3200
  // disable pgo if using ffi (lol)
3207
3201
  Prefs.pgo = false;
@@ -5319,9 +5313,7 @@ const generateTry = (scope, decl) => {
5319
5313
  return out;
5320
5314
  };
5321
5315
 
5322
- const generateEmpty = (scope, decl) => {
5323
- return [ number(UNDEFINED) ];
5324
- };
5316
+ const generateEmpty = (scope, decl) => [ number(UNDEFINED) ];
5325
5317
 
5326
5318
  const generateMeta = (scope, decl) => {
5327
5319
  if (decl.meta.name === 'new' && decl.property.name === 'target') {
package/foo ADDED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "An ahead-of-time JavaScript compiler",
4
- "version": "0.56.2",
4
+ "version": "0.56.3",
5
5
  "author": "Oliver Medhurst <honk@goose.icu>",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/r.cjs CHANGED
@@ -1,298 +1,16 @@
1
- let obj = {
2
- wow() {}
3
- };
4
-
5
- console.log(obj.wow.prototype);
6
-
7
- // var EQUAL = 1;
8
- // var NOT_EQUAL = -1;
9
- // var UNKNOWN = 0;
10
-
11
- // function setCache(cache, left, right, result) {
12
- // var otherCache;
13
-
14
- // otherCache = cache.get(left);
15
- // if (!otherCache) cache.set(left, otherCache = new Map());
16
- // otherCache.set(right, result);
17
-
18
- // otherCache = cache.get(right);
19
- // if (!otherCache) cache.set(right, otherCache = new Map());
20
- // otherCache.set(left, result);
21
- // }
22
-
23
- // function getCache(cache, left, right) {
24
- // var otherCache;
25
- // var result;
26
-
27
- // otherCache = cache.get(left);
28
- // result = otherCache && otherCache.get(right);
29
- // if (result) return result;
30
-
31
- // otherCache = cache.get(right);
32
- // result = otherCache && otherCache.get(left);
33
- // if (result) return result;
34
-
35
- // return UNKNOWN;
36
- // }
37
-
38
- // function cacheComparison(a, b, compare, cache) {
39
- // var result = compare(a, b, cache);
40
- // if (cache && (result === EQUAL || result === NOT_EQUAL)) {
41
- // setCache(cache, a, b, result);
42
- // }
43
- // return result;
44
- // }
45
-
46
- // function isBoxed(value) {
47
- // return value instanceof String
48
- // || value instanceof Number
49
- // || value instanceof Boolean
50
- // || value instanceof Symbol;
51
- // }
52
-
53
- // function fail() {
54
- // return NOT_EQUAL;
55
- // }
56
-
57
- // function compareIf(a, b, test, compare, cache) {
58
- // return !test(a)
59
- // ? !test(b) ? UNKNOWN : NOT_EQUAL
60
- // : !test(b) ? NOT_EQUAL : cacheComparison(a, b, compare, cache);
61
- // }
62
-
63
- // function compareEquality(a, b, cache) {
64
- // return compareIf(a, b, isOptional, compareOptionality)
65
- // || compareIf(a, b, isPrimitiveEquatable, comparePrimitiveEquality)
66
- // || compareIf(a, b, isObjectEquatable, compareObjectEquality, cache)
67
- // || NOT_EQUAL;
68
- // }
69
-
70
- // function tryCompareStrictEquality(a, b) {
71
- // return a === b ? EQUAL : UNKNOWN;
72
- // }
73
-
74
- // function tryCompareTypeOfEquality(a, b) {
75
- // return typeof a !== typeof b ? NOT_EQUAL : UNKNOWN;
76
- // }
77
-
78
- // function tryCompareToStringTagEquality(a, b) {
79
- // var aTag = Symbol.toStringTag in a ? a[Symbol.toStringTag] : undefined;
80
- // var bTag = Symbol.toStringTag in b ? b[Symbol.toStringTag] : undefined;
81
- // return aTag !== bTag ? NOT_EQUAL : UNKNOWN;
82
- // }
83
-
84
- // function isOptional(value) {
85
- // return value === undefined
86
- // || value === null;
87
- // }
88
-
89
- // function compareOptionality(a, b) {
90
- // return tryCompareStrictEquality(a, b)
91
- // || NOT_EQUAL;
92
- // }
93
-
94
- // function isPrimitiveEquatable(value) {
95
- // switch (typeof value) {
96
- // case 'string':
97
- // case 'number':
98
- // case 'boolean':
99
- // case 'symbol':
100
- // return true;
101
- // default:
102
- // return isBoxed(value);
103
- // }
104
- // }
105
-
106
- // function comparePrimitiveEquality(a, b) {
107
- // if (isBoxed(a)) a = a.valueOf();
108
- // if (isBoxed(b)) b = b.valueOf();
109
-
110
- // return tryCompareStrictEquality(a, b)
111
- // || tryCompareTypeOfEquality(a, b)
112
- // || compareIf(a, b, isNaNEquatable, compareNaNEquality)
113
- // || NOT_EQUAL;
114
- // }
115
-
116
- // function isNaNEquatable(value) {
117
- // return typeof value === 'number';
118
- // }
119
-
120
- // function compareNaNEquality(a, b) {
121
- // return isNaN(a) && isNaN(b) ? EQUAL : NOT_EQUAL;
122
- // }
123
-
124
- // function isObjectEquatable(value) {
125
- // return typeof value === 'object';
126
- // }
127
-
128
- // function compareObjectEquality(a, b, cache) {
129
- // if (!cache) cache = new Map();
130
-
131
- // return getCache(cache, a, b)
132
- // || setCache(cache, a, b, EQUAL) // consider equal for now
133
- // || cacheComparison(a, b, tryCompareStrictEquality, cache)
134
- // || cacheComparison(a, b, tryCompareToStringTagEquality, cache)
135
- // || compareIf(a, b, isValueOfEquatable, compareValueOfEquality)
136
- // || compareIf(a, b, isToStringEquatable, compareToStringEquality)
137
- // || compareIf(a, b, isArrayLikeEquatable, compareArrayLikeEquality, cache)
138
- // || compareIf(a, b, isStructurallyEquatable, compareStructuralEquality, cache)
139
- // || compareIf(a, b, isIterableEquatable, compareIterableEquality, cache)
140
- // || cacheComparison(a, b, fail, cache);
141
- // }
142
-
143
- // function isValueOfEquatable(value) {
144
- // return value instanceof Date;
145
- // }
146
-
147
- // function compareValueOfEquality(a, b) {
148
- // return compareIf(a.valueOf(), b.valueOf(), isPrimitiveEquatable, comparePrimitiveEquality)
149
- // || NOT_EQUAL;
150
- // }
151
-
152
- // function isToStringEquatable(value) {
153
- // return value instanceof RegExp;
154
- // }
155
-
156
- // function compareToStringEquality(a, b) {
157
- // return compareIf(a.toString(), b.toString(), isPrimitiveEquatable, comparePrimitiveEquality)
158
- // || NOT_EQUAL;
159
- // }
160
-
161
- // function isArrayLikeEquatable(value) {
162
- // return Array.isArray(value)
163
- // || value instanceof Uint8Array
164
- // || value instanceof Uint8ClampedArray
165
- // || value instanceof Uint16Array
166
- // || value instanceof Uint32Array
167
- // || value instanceof Int8Array
168
- // || value instanceof Int16Array
169
- // || value instanceof Int32Array
170
- // || value instanceof Float32Array
171
- // || value instanceof Float64Array;
172
- // }
173
-
174
- // function compareArrayLikeEquality(a, b, cache) {
175
- // if (a.length !== b.length) return NOT_EQUAL;
176
- // for (var i = 0; i < a.length; i++) {
177
- // if (compareEquality(a[i], b[i], cache) === NOT_EQUAL) {
178
- // return NOT_EQUAL;
179
- // }
180
- // }
181
- // return EQUAL;
182
- // }
183
-
184
- // function isStructurallyEquatable(value) {
185
- // return !(value instanceof Promise // only comparable by reference
186
- // || value instanceof WeakMap // only comparable by reference
187
- // || value instanceof WeakSet // only comparable by reference
188
- // || value instanceof Map // comparable via @@iterator
189
- // || value instanceof Set); // comparable via @@iterator
190
- // }
191
-
192
- // function compareStructuralEquality(a, b, cache) {
193
- // var aKeys = [];
194
- // for (var key in a) aKeys.push(key);
195
-
196
- // var bKeys = [];
197
- // for (var key in b) bKeys.push(key);
198
-
199
- // if (aKeys.length !== bKeys.length) {
200
- // return NOT_EQUAL;
201
- // }
202
-
203
- // aKeys.sort();
204
- // bKeys.sort();
205
-
206
- // for (var i = 0; i < aKeys.length; i++) {
207
- // var aKey = aKeys[i];
208
- // var bKey = bKeys[i];
209
- // if (compareEquality(aKey, bKey, cache) === NOT_EQUAL) {
210
- // return NOT_EQUAL;
211
- // }
212
- // if (compareEquality(a[aKey], b[bKey], cache) === NOT_EQUAL) {
213
- // return NOT_EQUAL;
214
- // }
215
- // }
216
-
217
- // return EQUAL;
218
- // }
219
-
220
- // // hack: do iterables via for..of
221
- // function isIterableEquatable(value) {
222
- // try {
223
- // for (const _ of value) { break; }
224
- // return true;
225
- // } catch {
226
- // return false;
227
- // }
228
- // }
229
-
230
- // function compareIterableEquality(a, b, cache) {
231
- // let aValues = [];
232
- // for (const x of a) aValues.push(x);
233
-
234
- // let bValues = [];
235
- // for (const x of b) bValues.push(x);
236
-
237
- // return compareArrayLikeEquality(aValues, bValues, cache);
238
- // }
239
-
240
- // var __assert_deepEqual__compare = (a, b) => {
241
- // return compareEquality(a, b) === EQUAL;
242
- // };
243
-
244
- // var __assert_deepEqual = (actual, expected) => {
245
- // if (!assert.deepEqual._compare(actual, expected)) {
246
- // throw new Test262Error('assert.deepEqual failed');
247
- // }
248
- // };
249
-
250
- // __assert_deepEqual([], []);
251
-
252
- // let x = {};
253
- // x.__proto__ = { wow() { console.log(0); } };
254
- // Object.defineProperty(x, '__proto__', { value: { wow() { console.log(1); } } });
255
- // // x.__proto__ = { wow() { console.log(2); } };
256
- // x.wow();
257
-
258
- // var stringSet;
259
-
260
- // class C {
261
- // get #_() { console.log('get'); return 'get string'; }
262
- // set #_(param) { console.log('set', param); stringSet = param; }
263
-
264
- // getPrivateReference() {
265
- // return this.#_;
266
- // }
267
-
268
- // setPrivateReference(value) {
269
- // this.#_ = value;
270
- // }
271
- // };
272
-
273
- // var inst = new C();
274
- // console.log(inst.getPrivateReference());
275
- // inst.setPrivateReference('set string');
276
- // console.log(stringSet);
277
-
278
- // let o = { set foo(x) { console.log('set foo', x); }, __proto__: { set bar(x) { console.log('set bar', x); } } };
279
-
280
- // o.foo = 1;
281
- // o.bar = 2;
282
-
283
- // class C {
284
- // // static #method = () => 1;
285
- // static #method() {
286
- // return 'Test262';
287
- // }
288
-
289
- // static getPrivateMethod() {
290
- // this.#method = () => 2;
291
- // return this.#method();
292
- // }
293
- // }
294
-
295
- // console.log(C.getPrivateMethod())
1
+ class C {
2
+ // static #method = () => 1;
3
+ static #method() {
4
+ return 'Test262';
5
+ }
6
+
7
+ static getPrivateMethod() {
8
+ this.#method = () => 2;
9
+ return this.#method();
10
+ }
11
+ }
12
+
13
+ console.log(C.getPrivateMethod())
296
14
 
297
15
  // var __assert_throws = (expectedErrorConstructor, func) => {
298
16
  // if (typeof func !== 'function') {
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.56.2';
3
+ globalThis.version = '0.56.3';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {