porffor 0.60.14 → 0.60.15

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.
@@ -81,22 +81,22 @@ export const __Object_values = (obj: any): any[] => {
81
81
 
82
82
  let i: i32 = 0;
83
83
  for (; ptr < endPtr; ptr += 18) {
84
- if (!Porffor.object.isEnumerable(ptr)) continue;
85
-
86
- let val: any;
87
- Porffor.wasm`local ptr32 i32
88
- local.get ${ptr}
89
- i32.to_u
90
- local.tee ptr32
91
-
92
- f64.load 0 8
93
- local.set ${val}
94
-
95
- local.get ptr32
96
- i32.load8_u 0 17
97
- local.set ${val+1}`;
84
+ const tail: i32 = Porffor.wasm.i32.load16_u(ptr, 0, 16);
85
+ if (!(tail & 0b0100)) continue; // not enumerable
86
+
87
+ if (tail & 0b0001) {
88
+ // accessor
89
+ const get: Function = Porffor.object.accessorGet(ptr);
90
+ if (Porffor.wasm`local.get ${get}` == 0) {
91
+ out[i++] = undefined;
92
+ continue;
93
+ }
94
+
95
+ out[i++] = get.call(obj);
96
+ continue;
97
+ }
98
98
 
99
- out[i++] = val;
99
+ out[i++] = Porffor.object.readValue(ptr);
100
100
  }
101
101
 
102
102
  out.length = i;
@@ -731,7 +731,6 @@ export const __Porffor_object_spread = (dst: object, src: any): object => {
731
731
 
732
732
  const len: i32 = keys.length;
733
733
  for (let i: i32 = 0; i < len; i++) {
734
- // target[keys[i]] = vals[i];
735
734
  Porffor.object.expr.init(dst, keys[i], vals[i]);
736
735
  }
737
736