porffor 0.33.1 → 0.33.2
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/builtins/object.ts +14 -1
- package/compiler/builtins_precompiled.js +7 -2
- package/compiler/codegen.js +68 -77
- package/package.json +1 -1
- package/runner/index.js +1 -1
@@ -226,6 +226,18 @@ export const __Object_assign = (target: any, ...sources: any[]) => {
|
|
226
226
|
return target;
|
227
227
|
};
|
228
228
|
|
229
|
+
// Object.assign but also non enumerable properties and 1 source
|
230
|
+
export const __Porffor_object_assignAll = (target: any, source: any) => {
|
231
|
+
if (target == null) throw new TypeError('Argument is nullish, expected object');
|
232
|
+
|
233
|
+
const keys: any[] = Reflect.ownKeys(source);
|
234
|
+
for (const x of keys) {
|
235
|
+
target[x] = source[x];
|
236
|
+
}
|
237
|
+
|
238
|
+
return target;
|
239
|
+
};
|
240
|
+
|
229
241
|
|
230
242
|
export const __Object_prototype_propertyIsEnumerable = (_this: any, prop: any) => {
|
231
243
|
const p: any = ecma262.ToPropertyKey(prop);
|
@@ -384,7 +396,8 @@ export const __Object_getOwnPropertyDescriptors = (obj: any): any => {
|
|
384
396
|
if (Porffor.rawType(obj) != Porffor.TYPES.object) return out;
|
385
397
|
}
|
386
398
|
|
387
|
-
|
399
|
+
const keys: any[] = Reflect.ownKeys(obj);
|
400
|
+
for (const x of keys) {
|
388
401
|
out[x] = __Object_getOwnPropertyDescriptor(obj, x);
|
389
402
|
}
|
390
403
|
|
@@ -1529,6 +1529,11 @@ params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
|
1529
1529
|
locals:[124,127,127,127,127,124,127,124,127,124,127,124,124,124,124,127,124,124,124,127,127,127,127],localNames:["target","target#type","sources","sources#type","#logicinner_tmp","#typeswitch_tmp1","#forof_base_pointer0","#forof_length0","#forof_counter0","#forof_tmp0","#forof_tmp0#type","x","x#type","keys","#last_type","vals","len","i","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop_assign","#member_prop","#loadArray_offset","#member_allocd","#swap","#forof_allocd"],
|
1530
1530
|
hasRestArgument:1,
|
1531
1531
|
};
|
1532
|
+
this.__Porffor_object_assignAll = {
|
1533
|
+
wasm:(_,{builtin,internalThrow})=>[[32,0],[33,4],[32,1],[33,5],[2,127],[32,5],[65,0],[70],[4,64,"TYPESWITCH|empty"],[65,1],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,4],[68,0],[97],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],[65,1],[12,1],[11],[65,0],[11,"TYPESWITCH_end"],[4,64],...internalThrow(_,'TypeError',`Argument is nullish, expected object`),[11],[32,2],[32,3],[16,builtin('__Reflect_ownKeys')],[26],[34,6],[252,3],[33,8],[65,0],[33,10],[65,208,0],[65,208,0],[70],[65,208,0],[65,19],[70],[114],[65,208,0],[65,195,0],[70],[114],[65,208,0],[65,195,1],[70],[114],[65,208,0],[65,216,0],[78],[65,208,0],[65,224,0],[76],[113],[114],[69],[4,64],...internalThrow(_,'TypeError',`Tried for..of on non-iterable type`),[11],[32,8],[40,1,0],[34,9],[4,64],[3,64],[32,8],[43,0,4],[33,11],[32,8],[45,0,12],[33,12],[32,11],[33,13],[32,12],[33,14],[2,64],[2,64],[32,0],[33,17],[32,13],[33,18],[32,1],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,1],[32,18],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[32,7],[16,builtin('__Porffor_object_set')],[26],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,1],[32,18],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[32,7],[16,builtin('__Porffor_object_set')],[26],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,17],[252,3],[32,18],[252,3],[65,9],[108],[106],[34,16],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[57,0,4],[32,16],[32,7],[58,0,12],[32,15],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[252,3],[58,0,4],[32,15],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[252,2],[58,0,4],[32,15],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[68,0],[165],[68,255],[164],[252,3],[58,0,4],[32,15],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[65,2],[108],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[252,3],[59,0,4],[32,15],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[65,2],[108],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[252,2],[59,0,4],[32,15],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[65,4],[108],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[252,3],[54,0,4],[32,15],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[65,4],[108],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[252,2],[54,0,4],[32,15],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[65,4],[108],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[182],[56,0,4],[32,15],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,18],[252,3],[65,8],[108],[106],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[34,15],[57,0,4],[32,15],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot set property of undefined`),[68,0],[12,1],[11],[32,2],[33,17],[32,13],[33,19],[32,3],[33,5],[2,124],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,17],[252,3],[32,3],[32,19],[32,14],[16,builtin('__ecma262_ToPropertyKey')],[33,22],[252,3],[32,22],[16,builtin('__Porffor_object_get')],[33,7],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[65,2],[108],[32,17],[252,3],[106],[47,0,4],[59,0,4],[32,21],[184],[65,195,0],[33,7],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,19],[252,3],[65,9],[108],[32,17],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[33,7],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,17],[252,3],[40,0,4],[32,19],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11],[32,5],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,5],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('__Porffor_allocate')],[34,21],[65,1],[54,0,0],[32,21],[32,19],[252,3],[32,17],[252,3],[106],[45,0,4],[58,0,4],[32,21],[184],[65,195,1],[33,7],[12,1],[11],[68,0],[65,128,1],[33,7],[11,"TYPESWITCH_end"],[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,9],[106],[33,8],[32,10],[65,1],[106],[34,10],[32,9],[71],[13,1],[11],[11],[11],[32,0],[32,1],[15]],
|
1534
|
+
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1535
|
+
locals:[124,127,124,127,127,127,127,124,127,124,127,124,127,124,124,124,127,127,127,127],localNames:["target","target#type","source","source#type","#logicinner_tmp","#typeswitch_tmp1","keys","#last_type","#forof_base_pointer1","#forof_length1","#forof_counter1","#forof_tmp1","#forof_tmp1#type","x","x#type","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop_assign","#member_prop","#loadArray_offset","#member_allocd","#swap","#forof_allocd"],
|
1536
|
+
};
|
1532
1537
|
this.__Object_prototype_propertyIsEnumerable = {
|
1533
1538
|
wasm:(_,{builtin})=>[[32,2],[32,3],[16,builtin('__ecma262_ToPropertyKey')],[33,5],[33,4],[32,1],[184],[34,7],[68,7],[97],[4,64],[32,0],[252,2],[32,1],[32,4],[252,2],[32,5],[16,builtin('__Porffor_object_lookup')],[33,6],[183],[34,8],[68,-1],[97],[4,64],[68,0],[65,2],[15],[11],[32,8],[252,2],[65,1],[16,builtin('__Porffor_object_isEnumerable')],[33,6],[183],[32,6],[15],[11],[32,0],[32,1],[16,builtin('__Object_keys')],[26],[34,9],[65,208,0],[32,4],[32,5],[68,0],[65,128,1],[16,builtin('__Array_prototype_includes')],[34,6],[15]],
|
1534
1539
|
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
@@ -1575,9 +1580,9 @@ params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
|
1575
1580
|
locals:[124,127,127,124,124,127,124,124,127,127,127,127,124,124,124,127,124,127,124,124,124,127],localNames:["obj","obj#type","prop","prop#type","p","p#type","#last_type","objType","v","v#type","#member_obj","#member_prop","#loadArray_offset","#member_allocd","#swap","#typeswitch_tmp1","#logicinner_tmp","out","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_prop_assign","#makearray_pointer_tmp","entryPtr","tail","value","value#type"],
|
1576
1581
|
};
|
1577
1582
|
this.__Object_getOwnPropertyDescriptors = {
|
1578
|
-
wasm:(_,{builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[184],[33,2],[32,1],[184],[68,7],[98],[4,64],[32,0],[32,1],[16,builtin('__Porffor_object_getObject')],[33,1],[33,0],[32,1],[184],[68,7],[98],[4,64],[32,2],[65,7],[15],[11],[11],[32,0],[252,3],[33,
|
1583
|
+
wasm:(_,{builtin,internalThrow})=>[[16,builtin('__Porffor_allocate')],[184],[33,2],[32,1],[184],[68,7],[98],[4,64],[32,0],[32,1],[16,builtin('__Porffor_object_getObject')],[33,1],[33,0],[32,1],[184],[68,7],[98],[4,64],[32,2],[65,7],[15],[11],[11],[32,0],[32,1],[16,builtin('__Reflect_ownKeys')],[26],[34,4],[252,3],[33,5],[65,0],[33,7],[65,208,0],[65,208,0],[70],[65,208,0],[65,19],[70],[114],[65,208,0],[65,195,0],[70],[114],[65,208,0],[65,195,1],[70],[114],[65,208,0],[65,216,0],[78],[65,208,0],[65,224,0],[76],[113],[114],[69],[4,64],...internalThrow(_,'TypeError',`Tried for..of on non-iterable type`),[11],[32,5],[40,1,0],[34,6],[4,64],[3,64],[32,5],[43,0,4],[33,8],[32,5],[45,0,12],[33,9],[32,8],[33,10],[32,9],[33,11],[2,64],[32,2],[33,14],[32,10],[33,15],[32,14],[252,3],[65,7],[32,15],[32,11],[16,builtin('__ecma262_ToPropertyKey')],[33,16],[252,3],[32,16],[32,0],[32,1],[32,10],[32,11],[16,builtin('__Object_getOwnPropertyDescriptor')],[34,3],[16,builtin('__Porffor_object_set')],[26],[26],[32,5],[65,9],[106],[33,5],[32,7],[65,1],[106],[34,7],[32,6],[71],[13,1],[11],[11],[11],[32,2],[65,7],[15]],
|
1579
1584
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1580
|
-
locals:[124,127,
|
1585
|
+
locals:[124,127,124,127,127,127,124,127,124,127,124,127,124,124,127,127],localNames:["obj","obj#type","out","#last_type","keys","#forof_base_pointer1","#forof_length1","#forof_counter1","#forof_tmp1","#forof_tmp1#type","x","x#type","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop_assign","#swap","#forof_allocd"],
|
1581
1586
|
};
|
1582
1587
|
this.__Object_getOwnPropertyNames = {
|
1583
1588
|
wasm:(_,{builtin,internalThrow})=>[[32,0],[33,2],[32,1],[33,3],[2,127],[32,3],[65,0],[70],[4,64,"TYPESWITCH|empty"],[65,1],[12,1],[11],[32,3],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,2],[68,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(_,'TypeError',`Argument is nullish, expected object`),[11],[16,builtin('__Porffor_allocate')],[183],[33,4],[32,1],[184],[34,5],[68,7],[97],[4,64],[32,0],[68,5],[160],[34,6],[32,0],[252,2],[40,0,0],[183],[68,14],[162],[160],[33,7],[68,0],[33,8],[3,64],[32,6],[32,7],[99],[4,64],[2,64],[32,6],[252,3],[40,0,0],[34,11],[65,30],[118],[34,12],[4,127],[65,5],[65,195,0],[32,12],[65,3],[70],[27],[33,10],[32,11],[65,255,255,255,255,3],[113],[5],[65,195,1],[33,10],[32,11],[11],[184],[33,9],[32,10],[184],[68,5],[97],[4,64],[12,1],[11],[32,4],[33,15],[32,8],[32,8],[68,1],[160],[33,8],[33,16],[32,15],[252,3],[32,16],[252,3],[65,9],[108],[106],[34,14],[32,9],[34,13],[57,0,4],[32,14],[32,10],[58,0,12],[11],[32,6],[68,14],[160],[34,6],[12,1],[11],[11],[32,4],[252,3],[34,19],[32,8],[34,18],[252,3],[54,1,0],[5],[32,5],[68,80],[97],[32,5],[68,195],[97],[114],[32,5],[68,67],[97],[114],[4,64],[32,0],[252,3],[40,1,0],[184],[33,20],[32,4],[252,3],[34,19],[32,20],[34,18],[252,3],[54,1,0],[68,0],[33,8],[3,64],[32,8],[32,20],[99],[4,64],[32,4],[33,15],[32,8],[33,16],[32,15],[252,3],[32,16],[252,3],[65,9],[108],[106],[34,14],[32,8],[65,1],[68,0],[65,128,1],[16,builtin('__Number_prototype_toString')],[33,21],[34,13],[57,0,4],[32,14],[32,21],[58,0,12],[32,8],[68,1],[160],[33,8],[12,1],[11],[11],[11],[11],[32,4],[65,208,0],[15]],
|
package/compiler/codegen.js
CHANGED
@@ -399,12 +399,12 @@ const generateReturn = (scope, decl) => {
|
|
399
399
|
// ignore return value and return this if being constructed
|
400
400
|
// todo: only do this when trying to return a primitive?
|
401
401
|
out.push(
|
402
|
-
// ...truthy(scope, [ [ Opcodes.local_get, '#newtarget' ] ], [ [ Opcodes.local_get, '#newtarget#type' ] ], false, true),
|
403
|
-
[ Opcodes.local_get, '#newtarget' ],
|
402
|
+
// ...truthy(scope, [ [ Opcodes.local_get, scope.locals['#newtarget'].idx ] ], [ [ Opcodes.local_get, scope.locals['#newtarget#type'].idx ] ], false, true),
|
403
|
+
[ Opcodes.local_get, scope.locals['#newtarget'].idx ],
|
404
404
|
Opcodes.i32_to_u,
|
405
405
|
[ Opcodes.if, Blocktype.void ],
|
406
|
-
[ Opcodes.local_get, '#this' ],
|
407
|
-
...(scope.returnType != null ? [] : [ [ Opcodes.local_get, '#this#type' ] ]),
|
406
|
+
[ Opcodes.local_get, scope.locals['#this'].idx ],
|
407
|
+
...(scope.returnType != null ? [] : [ [ Opcodes.local_get, scope.locals['#this#type'].idx ] ]),
|
408
408
|
[ Opcodes.return ],
|
409
409
|
[ Opcodes.end ]
|
410
410
|
);
|
@@ -1697,13 +1697,13 @@ const getNodeType = (scope, node) => {
|
|
1697
1697
|
|
1698
1698
|
if (node.type === 'ThisExpression') {
|
1699
1699
|
if (!scope.constr) return getType(scope, 'globalThis');
|
1700
|
-
return [ [ Opcodes.local_get, '#this#type' ] ];
|
1700
|
+
return [ [ Opcodes.local_get, scope.locals['#this#type'].idx ] ];
|
1701
1701
|
}
|
1702
1702
|
|
1703
1703
|
if (node.type === 'MetaProperty') {
|
1704
1704
|
switch (`${node.meta.name}.${node.property.name}`) {
|
1705
1705
|
case 'new.target': {
|
1706
|
-
return [ [ Opcodes.local_get, '#newtarget#type' ] ];
|
1706
|
+
return [ [ Opcodes.local_get, scope.locals['#newtarget#type'].idx ] ];
|
1707
1707
|
}
|
1708
1708
|
|
1709
1709
|
default:
|
@@ -2762,25 +2762,31 @@ const generateThis = (scope, decl, _global, _name) => {
|
|
2762
2762
|
];
|
2763
2763
|
}
|
2764
2764
|
|
2765
|
+
// opt: do not check for pure constructors
|
2766
|
+
if (scope._onlyConstr) return [
|
2767
|
+
[ Opcodes.local_get, scope.locals['#this'].idx ],
|
2768
|
+
...setLastType(scope, [ [ Opcodes.local_get, scope.locals['#this#type'].idx ] ])
|
2769
|
+
];
|
2770
|
+
|
2765
2771
|
return [
|
2766
2772
|
// default this to globalThis
|
2767
|
-
[ Opcodes.local_get, '#this' ],
|
2773
|
+
[ Opcodes.local_get, scope.locals['#this'].idx ],
|
2768
2774
|
Opcodes.i32_to_u,
|
2769
2775
|
[ Opcodes.i32_eqz ],
|
2770
2776
|
[ Opcodes.if, Blocktype.void ],
|
2771
|
-
[ Opcodes.local_get, '#this#type' ],
|
2777
|
+
[ Opcodes.local_get, scope.locals['#this#type'].idx ],
|
2772
2778
|
...number(TYPES.object, Valtype.i32),
|
2773
2779
|
[ Opcodes.i32_eq ],
|
2774
2780
|
[ Opcodes.if, Blocktype.void ],
|
2775
2781
|
...generate(scope, { type: 'Identifier', name: 'globalThis' }),
|
2776
|
-
[ Opcodes.local_set, '#this' ],
|
2782
|
+
[ Opcodes.local_set, scope.locals['#this'].idx ],
|
2777
2783
|
...getType(scope, 'globalThis'),
|
2778
|
-
[ Opcodes.local_set, '#this#type' ],
|
2784
|
+
[ Opcodes.local_set, scope.locals['#this#type'].idx ],
|
2779
2785
|
[ Opcodes.end ],
|
2780
2786
|
[ Opcodes.end ],
|
2781
2787
|
|
2782
|
-
[ Opcodes.local_get, '#this' ],
|
2783
|
-
...setLastType(scope, [ [ Opcodes.local_get, '#this#type' ] ])
|
2788
|
+
[ Opcodes.local_get, scope.locals['#this'].idx ],
|
2789
|
+
...setLastType(scope, [ [ Opcodes.local_get, scope.locals['#this#type'].idx ] ])
|
2784
2790
|
];
|
2785
2791
|
};
|
2786
2792
|
|
@@ -4908,11 +4914,9 @@ const generateEmpty = (scope, decl) => {
|
|
4908
4914
|
|
4909
4915
|
const generateMeta = (scope, decl) => {
|
4910
4916
|
switch (`${decl.meta.name}.${decl.property.name}`) {
|
4911
|
-
case 'new.target':
|
4912
|
-
|
4913
|
-
|
4914
|
-
];
|
4915
|
-
}
|
4917
|
+
case 'new.target': return [
|
4918
|
+
[ Opcodes.local_get, scope.locals['#newtarget'].idx ],
|
4919
|
+
];
|
4916
4920
|
|
4917
4921
|
default:
|
4918
4922
|
return todo(scope, `meta property object ${decl.meta.name} is not supported yet`, true);
|
@@ -5791,7 +5795,7 @@ const generateClass = (scope, decl) => {
|
|
5791
5795
|
|
5792
5796
|
const [ func, out ] = generateFunc(scope, {
|
5793
5797
|
...constr,
|
5794
|
-
_onlyConstr:
|
5798
|
+
_onlyConstr: true,
|
5795
5799
|
type: expr ? 'FunctionExpression' : 'FunctionDeclaration'
|
5796
5800
|
});
|
5797
5801
|
|
@@ -5801,7 +5805,7 @@ const generateClass = (scope, decl) => {
|
|
5801
5805
|
|
5802
5806
|
if (kind === 'constructor') continue;
|
5803
5807
|
|
5804
|
-
|
5808
|
+
let object = _static ? root : {
|
5805
5809
|
type: 'MemberExpression',
|
5806
5810
|
object: root,
|
5807
5811
|
property: {
|
@@ -5824,26 +5828,47 @@ const generateClass = (scope, decl) => {
|
|
5824
5828
|
// default value to undefined
|
5825
5829
|
value ??= DEFAULT_VALUE();
|
5826
5830
|
|
5827
|
-
out
|
5828
|
-
|
5831
|
+
let outArr = out, outOp = 'push', outScope = scope;
|
5832
|
+
if (type === 'PropertyDefinition' && !_static) {
|
5833
|
+
// define in construction instead
|
5834
|
+
outArr = func.wasm;
|
5835
|
+
outOp = 'unshift';
|
5836
|
+
object = {
|
5837
|
+
type: 'ThisExpression'
|
5838
|
+
};
|
5839
|
+
outScope = func;
|
5840
|
+
}
|
5841
|
+
|
5842
|
+
outArr[outOp](
|
5843
|
+
...generate(outScope, object),
|
5829
5844
|
Opcodes.i32_to_u,
|
5830
|
-
...getNodeType(
|
5845
|
+
...getNodeType(outScope, object),
|
5831
5846
|
|
5832
|
-
...generate(
|
5833
|
-
...getNodeType(
|
5834
|
-
...toPropertyKey(
|
5847
|
+
...generate(outScope, k),
|
5848
|
+
...getNodeType(outScope, k),
|
5849
|
+
...toPropertyKey(outScope, true),
|
5835
5850
|
|
5836
|
-
...generate(
|
5851
|
+
...generate(outScope, value),
|
5837
5852
|
...(initKind !== 'init' ? [ Opcodes.i32_to_u ] : []),
|
5838
|
-
...getNodeType(
|
5853
|
+
...getNodeType(outScope, value),
|
5839
5854
|
|
5840
|
-
[ Opcodes.call, includeBuiltin(
|
5855
|
+
[ Opcodes.call, includeBuiltin(outScope, `__Porffor_object_expr_${initKind}`).index ],
|
5841
5856
|
|
5842
5857
|
[ Opcodes.drop ],
|
5843
5858
|
[ Opcodes.drop ]
|
5844
5859
|
);
|
5845
5860
|
}
|
5846
5861
|
|
5862
|
+
// error if not being constructed
|
5863
|
+
func.wasm.unshift(
|
5864
|
+
[ Opcodes.local_get, func.locals['#newtarget'].idx ],
|
5865
|
+
Opcodes.i32_to_u,
|
5866
|
+
[ Opcodes.i32_eqz ],
|
5867
|
+
[ Opcodes.if, Blocktype.void ],
|
5868
|
+
...internalThrow(func, 'TypeError', `Class constructor ${name} requires 'new'`),
|
5869
|
+
[ Opcodes.end ]
|
5870
|
+
);
|
5871
|
+
|
5847
5872
|
return out;
|
5848
5873
|
};
|
5849
5874
|
|
@@ -5923,6 +5948,7 @@ const generateFunc = (scope, decl) => {
|
|
5923
5948
|
(decl.type && decl.type !== 'ArrowFunctionExpression' && decl.type !== 'Program') &&
|
5924
5949
|
// not async or generator
|
5925
5950
|
!decl.async && !decl.generator,
|
5951
|
+
_onlyConstr: decl._onlyConstr,
|
5926
5952
|
strict: scope.strict
|
5927
5953
|
};
|
5928
5954
|
|
@@ -5953,6 +5979,11 @@ const generateFunc = (scope, decl) => {
|
|
5953
5979
|
}
|
5954
5980
|
}
|
5955
5981
|
|
5982
|
+
if (func.constr) {
|
5983
|
+
allocVar(func, '#newtarget', false);
|
5984
|
+
allocVar(func, '#this', false);
|
5985
|
+
}
|
5986
|
+
|
5956
5987
|
const prelude = [];
|
5957
5988
|
const defaultValues = {};
|
5958
5989
|
const destructuredArgs = {};
|
@@ -5996,7 +6027,7 @@ const generateFunc = (scope, decl) => {
|
|
5996
6027
|
TYPES.arraybuffer, TYPES.sharedarraybuffer, TYPES.dataview
|
5997
6028
|
].includes(typeAnno.type)) {
|
5998
6029
|
prelude.push(
|
5999
|
-
[ Opcodes.local_get,
|
6030
|
+
[ Opcodes.local_get, func.locals[name].idx + 1 ],
|
6000
6031
|
...number(typeAnno.type, Valtype.i32),
|
6001
6032
|
[ Opcodes.i32_ne ],
|
6002
6033
|
[ Opcodes.if, Blocktype.void ],
|
@@ -6061,25 +6092,16 @@ const generateFunc = (scope, decl) => {
|
|
6061
6092
|
|
6062
6093
|
if (!globalThis.precompile && func.constr) {
|
6063
6094
|
wasm.unshift(
|
6064
|
-
//
|
6065
|
-
|
6066
|
-
|
6067
|
-
|
6095
|
+
// opt: do not check for pure constructors
|
6096
|
+
...(func._onlyConstr ? [] : [
|
6097
|
+
// if being constructed
|
6098
|
+
[ Opcodes.local_get, func.locals['#newtarget'].idx ],
|
6099
|
+
Opcodes.i32_to_u,
|
6100
|
+
[ Opcodes.if, Blocktype.void ],
|
6101
|
+
]),
|
6068
6102
|
// set prototype of this ;)
|
6069
6103
|
...generate(func, setObjProp({ type: 'ThisExpression' }, '__proto__', getObjProp(func.name, 'prototype'))),
|
6070
|
-
[ Opcodes.end ]
|
6071
|
-
);
|
6072
|
-
}
|
6073
|
-
|
6074
|
-
if (decl._onlyConstr) {
|
6075
|
-
wasm.unshift(
|
6076
|
-
// error if not being constructed
|
6077
|
-
[ Opcodes.local_get, '#newtarget' ],
|
6078
|
-
Opcodes.i32_to_u,
|
6079
|
-
[ Opcodes.i32_eqz ],
|
6080
|
-
[ Opcodes.if, Blocktype.void ],
|
6081
|
-
...internalThrow(func, 'TypeError', decl._onlyConstr),
|
6082
|
-
[ Opcodes.end ]
|
6104
|
+
...(func._onlyConstr ? [] : [ [ Opcodes.end ] ])
|
6083
6105
|
);
|
6084
6106
|
}
|
6085
6107
|
|
@@ -6135,37 +6157,6 @@ const generateFunc = (scope, decl) => {
|
|
6135
6157
|
}
|
6136
6158
|
}
|
6137
6159
|
|
6138
|
-
if (func.constr) {
|
6139
|
-
const locals = func.locals;
|
6140
|
-
let idxOffset = 4;
|
6141
|
-
func.params = [ valtypeBinary, Valtype.i32, valtypeBinary, Valtype.i32, ...func.params ];
|
6142
|
-
|
6143
|
-
// move all local indexes by idxOffset
|
6144
|
-
func.localInd += idxOffset;
|
6145
|
-
for (const x in locals) {
|
6146
|
-
locals[x].idx += idxOffset;
|
6147
|
-
}
|
6148
|
-
|
6149
|
-
let indexes = idxOffset;
|
6150
|
-
|
6151
|
-
locals['#this#type'] = { idx: --indexes, type: Valtype.i32 };
|
6152
|
-
locals['#this'] = { idx: --indexes, type: valtypeBinary };
|
6153
|
-
locals['#newtarget#type'] = { idx: --indexes, type: Valtype.i32 };
|
6154
|
-
locals['#newtarget'] = { idx: --indexes, type: valtypeBinary };
|
6155
|
-
|
6156
|
-
for (let i = 0; i < wasm.length; i++) {
|
6157
|
-
// note: these needs to be copied, even though they realistically shouldn't
|
6158
|
-
const inst = wasm[i];
|
6159
|
-
if (inst[0] === Opcodes.local_get || inst[0] === Opcodes.local_set || inst[0] === Opcodes.local_tee) {
|
6160
|
-
if (typeof inst[1] == 'string') {
|
6161
|
-
wasm[i] = [ inst[0], locals[inst[1]].idx ];
|
6162
|
-
} else {
|
6163
|
-
wasm[i] = [ inst[0], inst[1] + idxOffset ];
|
6164
|
-
}
|
6165
|
-
}
|
6166
|
-
}
|
6167
|
-
}
|
6168
|
-
|
6169
6160
|
return [ func, out ];
|
6170
6161
|
};
|
6171
6162
|
|
package/package.json
CHANGED