porffor 0.34.15 → 0.34.16
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/CONTRIBUTING.md +1 -1
- package/compiler/builtins/_internal_object.ts +6 -4
- package/compiler/builtins_precompiled.js +5 -5
- package/compiler/codegen.js +10 -3
- package/package.json +1 -1
- package/r.js +4 -0
- package/runner/index.js +1 -1
package/CONTRIBUTING.md
CHANGED
@@ -370,7 +370,7 @@ For the first time, ensure you run `./test262/setup.sh`.
|
|
370
370
|
|
371
371
|
Run `node test262` to run all the tests and get an output of total overall test results.
|
372
372
|
|
373
|
-
Warning: this will consume 1-6GB of memory and ~90% of all CPU cores while running (depending on thread count), it should take
|
373
|
+
Warning: this will consume 1-6GB of memory and ~90% of all CPU cores while running (depending on thread count), it should take 10-30 minutes depending on machine. You can specify how many threads with `--threads=N`, it will use the number of CPU threads by default.
|
374
374
|
|
375
375
|
The main thing you want to pay attention to is the emoji summary (lol):
|
376
376
|
```
|
@@ -173,7 +173,8 @@ export const __Porffor_object_lookup = (obj: any, target: any): i32 => {
|
|
173
173
|
export const __Porffor_object_get = (obj: any, key: any): any => {
|
174
174
|
if (Porffor.wasm`local.get ${obj}` == 0) throw new TypeError('Cannot get property of null');
|
175
175
|
|
176
|
-
|
176
|
+
const trueType: i32 = Porffor.wasm`local.get ${obj+1}`;
|
177
|
+
if (trueType == Porffor.TYPES.function) {
|
177
178
|
const tmp1: bytestring = 'name';
|
178
179
|
if (key == tmp1) {
|
179
180
|
const o: bytestring = __Porffor_funcLut_name(obj);
|
@@ -196,7 +197,7 @@ return`;
|
|
196
197
|
}
|
197
198
|
}
|
198
199
|
|
199
|
-
if (
|
200
|
+
if (trueType != Porffor.TYPES.object) obj = __Porffor_object_getObject(obj);
|
200
201
|
let entryPtr: i32 = __Porffor_object_lookup(obj, key);
|
201
202
|
if (entryPtr == -1) {
|
202
203
|
if (Porffor.wasm`local.get ${obj+1}` == Porffor.TYPES.object) {
|
@@ -212,9 +213,10 @@ return`;
|
|
212
213
|
if ((entryPtr = __Porffor_object_lookup(obj, key)) != -1) break;
|
213
214
|
}
|
214
215
|
} else {
|
215
|
-
|
216
|
+
let proto: i32 = __Object_prototype;
|
217
|
+
if (trueType == Porffor.TYPES.function) proto = __Function_prototype;
|
216
218
|
Porffor.wasm`
|
217
|
-
local.get ${
|
219
|
+
local.get ${proto}
|
218
220
|
f64.convert_i32_u
|
219
221
|
i32.const 7 ;; object type
|
220
222
|
return`;
|
@@ -54,9 +54,9 @@ params:[127,127,127,127],typedParams:1,returns:[127,127],typedReturns:1,
|
|
54
54
|
locals:[127,127,127,127,127,127,127,127,127,127],localNames:["obj","obj#type","target","target#type","#last_type","targetType","ptr","size","endPtr","targetStr","keyRaw","keyStr","targetSym","keySym"],
|
55
55
|
};
|
56
56
|
this.__Porffor_object_get = {
|
57
|
-
wasm:(_,{allocPage,builtin,internalThrow})=>[[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot get property of null`),[11],[32,1],[65,6],[70],[4,64],...number(allocPage(_,'bytestring: __Porffor_object_get/tmp1','i8'),127),[33,
|
57
|
+
wasm:(_,{allocPage,builtin,internalThrow})=>[[32,0],[69],[4,64],...internalThrow(_,'TypeError',`Cannot get property of null`),[11],[32,1],[34,4],[65,6],[70],[4,64],...number(allocPage(_,'bytestring: __Porffor_object_get/tmp1','i8'),127),[33,5],[32,2],[183],[32,3],[32,5],[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[26],[252,3],[4,64],[32,0],[16,builtin('__Porffor_funcLut_name')],[33,6],[65,195,1],[33,7],[32,6],[184],[32,7],[15],[11],...number(allocPage(_,'bytestring: __Porffor_object_get/tmp2','i8'),127),[33,8],[32,2],[183],[32,3],[32,8],[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[26],[252,3],[4,64],[32,0],[16,builtin('__Porffor_funcLut_length')],[34,6],[184],[65,1],[15],[11],[11],[32,4],[65,7],[71],[4,64],[32,0],[184],[32,1],[16,builtin('__Porffor_object_getObject')],[33,9],[252,2],[34,0],[32,9],[33,1],[26],[11],[32,0],[32,1],[32,2],[32,3],[16,builtin('__Porffor_object_lookup')],[26],[34,10],[65,127],[70],[4,64],[32,1],[65,7],[70],[4,64],...number(allocPage(_,'bytestring: __Porffor_object_get/protoKey','i8'),127),[33,11],[32,0],[33,12],[32,1],[33,13],[32,2],[183],[32,3],[32,11],[183],[65,195,1],[16,builtin('__Porffor_compareStrings')],[26],[252,3],[69],[4,64],[3,64],[65,1],[4,64],[32,0],[32,1],[32,11],[65,195,1],[16,builtin('__Porffor_object_get')],[33,9],[252,2],[34,0],[32,9],[33,1],[26],[32,0],[33,14],[32,1],[33,15],[2,127],[32,15],[69],[4,64,"TYPESWITCH|empty"],[65,1],[12,1],[11],[32,15],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,14],[69],[12,1],[11],[32,15],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],[65,1],[12,1],[11],[65,0],[11,"TYPESWITCH_end"],[32,0],[32,12],[70],[114],[4,64],[12,1],[11],[32,0],[34,12],[32,1],[33,13],[26],[32,0],[32,1],[32,2],[32,3],[16,builtin('__Porffor_object_lookup')],[26],[34,10],[65,127],[71],[4,64],[12,1],[11],[12,1],[11],[11],[5],[16,builtin('#get___Object_prototype')],[33,16],[32,4],[65,6],[70],[4,64],[16,builtin('#get___Function_prototype')],[33,16],[11],[32,16],[184],[65,7],[15],[11],[11],[32,10],[65,127],[70],[4,64],[68,0],[65,128,1],[15],[11],[11],[32,10],[47,0,12],[34,17],[65,1],[113],[4,64],[32,10],[65,1],[16,builtin('__Porffor_object_accessorGet')],[26],[34,18],[69],[4,64],[68,0],[65,128,1],[15],[11],[32,18],[16,builtin('__Porffor_funcLut_flags')],[34,19],[65,2],[113],[4,64],[68,0],[65,0],[32,0],[184],[32,1],[32,18],[17,2,0],[15],[5],[32,18],[17,0,0],[15],[11],[11],[32,10],[43,0,4],[32,17],[65,8],[118],[15]],
|
58
58
|
params:[127,127,127,127],typedParams:1,returns:[124,127],typedReturns:1,
|
59
|
-
locals:[127,127,127,127,127,127,127,127,127,127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","tmp1","o","t","tmp2","#last_type","entryPtr","protoKey","lastProto","lastProto#type","#logicinner_tmp","#typeswitch_tmp1","
|
59
|
+
locals:[127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","trueType","tmp1","o","t","tmp2","#last_type","entryPtr","protoKey","lastProto","lastProto#type","#logicinner_tmp","#typeswitch_tmp1","proto","tail","get","funcFlags"],
|
60
60
|
data:{"bytestring: __Porffor_object_get/tmp1":[4,0,0,0,110,97,109,101],"bytestring: __Porffor_object_get/tmp2":[6,0,0,0,108,101,110,103,116,104],"bytestring: __Porffor_object_get/protoKey":[9,0,0,0,95,95,112,114,111,116,111,95,95]},
|
61
61
|
};
|
62
62
|
this.__Porffor_object_writeKey = {
|
@@ -1539,7 +1539,7 @@ params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
|
1539
1539
|
locals:[127],localNames:["obj","obj#type","prop","prop#type","#last_type"],
|
1540
1540
|
};
|
1541
1541
|
this.__Porffor_object_in = {
|
1542
|
-
wasm:(_,{builtin,internalThrow})=>[[32,0],[32,1],[32,2],[32,3],[16,builtin('__Object_prototype_hasOwnProperty')],[33,4],[33,5],[32,4],[33,6],[2,127],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,5],[252,3],[40,1,0],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,5],[252,3],[40,1,0],[12,1],[11],[32,5],[252,3],[11,"TYPESWITCH_end"],[4,64],[68,1],[65,2],[15],[11],[32,1],[184],[34,7],[68,7],[98],[4,64],[68,0],[65,2],[15],[11],[32,0],[33,8],[32,1],[33,9],[3,64],[65,1],[4,64],[32,0],[33,10],[65,128,128,8],[34,15],[65,9],[54,1,0],[32,15],[65,223,0],[58,0,4],[32,15],[65,223,0],[58,0,5],[32,15],[65,240,0],[58,0,6],[32,15],[65,242,0],[58,0,7],[32,15],[65,239,0],[58,0,8],[32,15],[65,244,0],[58,0,9],[32,15],[65,239,0],[58,0,10],[32,15],[65,223,0],[58,0,11],[32,15],[65,223,0],[58,0,12],[32,15],[184],[33,11],[32,1],[33,6],[2,124],[32,6],[65,1],[70],[4,64,"TYPESWITCH|Number"],[16,builtin('#get___Number_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,2],[70],[4,64,"TYPESWITCH|Boolean"],[16,builtin('#get___Boolean_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,5],[70],[4,64,"TYPESWITCH|Symbol"],[16,builtin('#get___Symbol_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,6],[70],[4,64,"TYPESWITCH|Function"],[16,builtin('
|
1542
|
+
wasm:(_,{builtin,internalThrow})=>[[32,0],[32,1],[32,2],[32,3],[16,builtin('__Object_prototype_hasOwnProperty')],[33,4],[33,5],[32,4],[33,6],[2,127],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,5],[252,3],[40,1,0],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,5],[252,3],[40,1,0],[12,1],[11],[32,5],[252,3],[11,"TYPESWITCH_end"],[4,64],[68,1],[65,2],[15],[11],[32,1],[184],[34,7],[68,7],[98],[4,64],[68,0],[65,2],[15],[11],[32,0],[33,8],[32,1],[33,9],[3,64],[65,1],[4,64],[32,0],[33,10],[65,128,128,8],[34,15],[65,9],[54,1,0],[32,15],[65,223,0],[58,0,4],[32,15],[65,223,0],[58,0,5],[32,15],[65,240,0],[58,0,6],[32,15],[65,242,0],[58,0,7],[32,15],[65,239,0],[58,0,8],[32,15],[65,244,0],[58,0,9],[32,15],[65,239,0],[58,0,10],[32,15],[65,223,0],[58,0,11],[32,15],[65,223,0],[58,0,12],[32,15],[184],[33,11],[32,1],[33,6],[2,124],[32,6],[65,1],[70],[4,64,"TYPESWITCH|Number"],[16,builtin('#get___Number_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,2],[70],[4,64,"TYPESWITCH|Boolean"],[16,builtin('#get___Boolean_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,5],[70],[4,64,"TYPESWITCH|Symbol"],[16,builtin('#get___Symbol_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,10],[252,3],[32,1],[32,11],[65,195,1],[16,builtin('__ecma262_ToPropertyKey')],[33,14],[252,3],[32,14],[16,builtin('__Porffor_object_get')],[33,4],[12,1],[11],[32,6],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,10],[252,3],[32,1],[32,11],[65,195,1],[16,builtin('__ecma262_ToPropertyKey')],[33,14],[252,3],[32,14],[16,builtin('__Porffor_object_get')],[33,4],[12,1],[11],[32,6],[65,18],[70],[4,64,"TYPESWITCH|Date"],[16,builtin('#get___Date_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,19],[70],[4,64,"TYPESWITCH|Set"],[16,builtin('#get___Set_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,20],[70],[4,64,"TYPESWITCH|Map"],[16,builtin('#get___Map_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,21],[70],[4,64,"TYPESWITCH|ArrayBuffer"],[16,builtin('#get___ArrayBuffer_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,22],[70],[4,64,"TYPESWITCH|SharedArrayBuffer"],[16,builtin('#get___SharedArrayBuffer_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,23],[70],[4,64,"TYPESWITCH|DataView"],[16,builtin('#get___DataView_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,33],[70],[4,64,"TYPESWITCH|WeakRef"],[16,builtin('#get___WeakRef_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,34],[70],[4,64,"TYPESWITCH|WeakSet"],[16,builtin('#get___WeakSet_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,35],[70],[4,64,"TYPESWITCH|WeakMap"],[16,builtin('#get___WeakMap_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,36],[70],[4,64,"TYPESWITCH|Promise"],[16,builtin('#get___Promise_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('#get___String_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[16,builtin('#get___Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[16,builtin('#get___Uint8Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[16,builtin('#get___Int8Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[16,builtin('#get___Uint8ClampedArray_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[16,builtin('#get___Uint16Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[16,builtin('#get___Int16Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[16,builtin('#get___Uint32Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[16,builtin('#get___Int32Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[16,builtin('#get___Float32Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[16,builtin('#get___Float64Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,6],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('#get___ByteString_prototype')],[184],[65,7],[33,4],[12,1],[11],[68,0],[65,128,1],[33,4],[11,"TYPESWITCH_end"],[34,0],[32,4],[33,1],[26],[32,0],[33,5],[32,1],[33,6],[2,127],[32,6],[65,0],[70],[4,64,"TYPESWITCH|empty"],[65,1],[12,1],[11],[32,6],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,5],[68,0],[97],[12,1],[11],[32,6],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],[65,1],[12,1],[11],[65,0],[11,"TYPESWITCH_end"],[32,0],[32,8],[97],[114],[4,64],[12,1],[11],[32,0],[34,8],[32,1],[33,9],[26],[32,0],[32,1],[32,2],[32,3],[16,builtin('__Object_prototype_hasOwnProperty')],[33,4],[33,5],[32,4],[33,6],[2,127],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,5],[252,3],[40,1,0],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,5],[252,3],[40,1,0],[12,1],[11],[32,5],[252,3],[11,"TYPESWITCH_end"],[4,64],[68,1],[65,2],[15],[11],[12,1],[11],[11],[68,0],[65,128,1],[15]],
|
1543
1543
|
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1544
1544
|
locals:[127,124,127,124,124,127,124,124,127,127,127,127],localNames:["obj","obj#type","prop","prop#type","#last_type","#logicinner_tmp","#typeswitch_tmp1","t","lastProto","lastProto#type","#member_obj","#member_prop","#loadArray_offset","#member_allocd","#swap","#makearray_pointer_tmp"],
|
1545
1545
|
};
|
@@ -1636,7 +1636,7 @@ locals:[124,124,127,127,127,127,124,127,124,127,124,127,127,124,127,124,127,124,
|
|
1636
1636
|
table:1,
|
1637
1637
|
};
|
1638
1638
|
this.__Object_getPrototypeOf = {
|
1639
|
-
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',`Object is nullish, expected object`),[11],[32,0],[33,5],[65,128,128,32],[34,10],[65,9],[54,1,0],[32,10],[65,223,0],[58,0,4],[32,10],[65,223,0],[58,0,5],[32,10],[65,240,0],[58,0,6],[32,10],[65,242,0],[58,0,7],[32,10],[65,239,0],[58,0,8],[32,10],[65,244,0],[58,0,9],[32,10],[65,239,0],[58,0,10],[32,10],[65,223,0],[58,0,11],[32,10],[65,223,0],[58,0,12],[32,10],[184],[33,6],[32,1],[33,3],[2,124],[32,3],[65,1],[70],[4,64,"TYPESWITCH|Number"],[16,builtin('#get___Number_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,2],[70],[4,64,"TYPESWITCH|Boolean"],[16,builtin('#get___Boolean_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,5],[70],[4,64,"TYPESWITCH|Symbol"],[16,builtin('#get___Symbol_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,6],[70],[4,64,"TYPESWITCH|Function"],[16,builtin('
|
1639
|
+
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',`Object is nullish, expected object`),[11],[32,0],[33,5],[65,128,128,32],[34,10],[65,9],[54,1,0],[32,10],[65,223,0],[58,0,4],[32,10],[65,223,0],[58,0,5],[32,10],[65,240,0],[58,0,6],[32,10],[65,242,0],[58,0,7],[32,10],[65,239,0],[58,0,8],[32,10],[65,244,0],[58,0,9],[32,10],[65,239,0],[58,0,10],[32,10],[65,223,0],[58,0,11],[32,10],[65,223,0],[58,0,12],[32,10],[184],[33,6],[32,1],[33,3],[2,124],[32,3],[65,1],[70],[4,64,"TYPESWITCH|Number"],[16,builtin('#get___Number_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,2],[70],[4,64,"TYPESWITCH|Boolean"],[16,builtin('#get___Boolean_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,5],[70],[4,64,"TYPESWITCH|Symbol"],[16,builtin('#get___Symbol_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,5],[252,3],[32,1],[32,6],[65,195,1],[16,builtin('__ecma262_ToPropertyKey')],[33,9],[252,3],[32,9],[16,builtin('__Porffor_object_get')],[33,4],[12,1],[11],[32,3],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,5],[252,3],[32,1],[32,6],[65,195,1],[16,builtin('__ecma262_ToPropertyKey')],[33,9],[252,3],[32,9],[16,builtin('__Porffor_object_get')],[33,4],[12,1],[11],[32,3],[65,18],[70],[4,64,"TYPESWITCH|Date"],[16,builtin('#get___Date_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,19],[70],[4,64,"TYPESWITCH|Set"],[16,builtin('#get___Set_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,20],[70],[4,64,"TYPESWITCH|Map"],[16,builtin('#get___Map_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,21],[70],[4,64,"TYPESWITCH|ArrayBuffer"],[16,builtin('#get___ArrayBuffer_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,22],[70],[4,64,"TYPESWITCH|SharedArrayBuffer"],[16,builtin('#get___SharedArrayBuffer_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,23],[70],[4,64,"TYPESWITCH|DataView"],[16,builtin('#get___DataView_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,33],[70],[4,64,"TYPESWITCH|WeakRef"],[16,builtin('#get___WeakRef_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,34],[70],[4,64,"TYPESWITCH|WeakSet"],[16,builtin('#get___WeakSet_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,35],[70],[4,64,"TYPESWITCH|WeakMap"],[16,builtin('#get___WeakMap_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,36],[70],[4,64,"TYPESWITCH|Promise"],[16,builtin('#get___Promise_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('#get___String_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[16,builtin('#get___Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[16,builtin('#get___Uint8Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[16,builtin('#get___Int8Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[16,builtin('#get___Uint8ClampedArray_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[16,builtin('#get___Uint16Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[16,builtin('#get___Int16Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[16,builtin('#get___Uint32Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[16,builtin('#get___Int32Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[16,builtin('#get___Float32Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[16,builtin('#get___Float64Array_prototype')],[184],[65,7],[33,4],[12,1],[11],[32,3],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11],[32,3],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[16,builtin('#get___ByteString_prototype')],[184],[65,7],[33,4],[12,1],[11],[68,0],[65,128,1],[33,4],[11,"TYPESWITCH_end"],[32,4],[15]],
|
1640
1640
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1641
1641
|
locals:[124,127,127,124,124,127,127,127,127],localNames:["obj","obj#type","#logicinner_tmp","#typeswitch_tmp1","#last_type","#member_obj","#member_prop","#loadArray_offset","#member_allocd","#swap","#makearray_pointer_tmp"],
|
1642
1642
|
};
|
@@ -1646,7 +1646,7 @@ params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
|
1646
1646
|
locals:[124,127,127,124,127,124,124,127,127],localNames:["obj","obj#type","proto","proto#type","#logicinner_tmp","#typeswitch_tmp1","#last_type","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop_assign","#makearray_pointer_tmp","#swap"],
|
1647
1647
|
};
|
1648
1648
|
this.__Object_prototype_isPrototypeOf = {
|
1649
|
-
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',`This is nullish, expected object`),[11],[2,127,"string_only"],[32,0],[34,13,"string_only"],[32,2],[33,7],[65,128,128,40],[34,12],[65,9],[54,1,0],[32,12],[65,223,0],[58,0,4],[32,12],[65,223,0],[58,0,5],[32,12],[65,240,0],[58,0,6],[32,12],[65,242,0],[58,0,7],[32,12],[65,239,0],[58,0,8],[32,12],[65,244,0],[58,0,9],[32,12],[65,239,0],[58,0,10],[32,12],[65,223,0],[58,0,11],[32,12],[65,223,0],[58,0,12],[32,12],[184],[33,8],[32,3],[33,5],[2,124],[32,5],[65,1],[70],[4,64,"TYPESWITCH|Number"],[16,builtin('#get___Number_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,2],[70],[4,64,"TYPESWITCH|Boolean"],[16,builtin('#get___Boolean_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,5],[70],[4,64,"TYPESWITCH|Symbol"],[16,builtin('#get___Symbol_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[16,builtin('
|
1649
|
+
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',`This is nullish, expected object`),[11],[2,127,"string_only"],[32,0],[34,13,"string_only"],[32,2],[33,7],[65,128,128,40],[34,12],[65,9],[54,1,0],[32,12],[65,223,0],[58,0,4],[32,12],[65,223,0],[58,0,5],[32,12],[65,240,0],[58,0,6],[32,12],[65,242,0],[58,0,7],[32,12],[65,239,0],[58,0,8],[32,12],[65,244,0],[58,0,9],[32,12],[65,239,0],[58,0,10],[32,12],[65,223,0],[58,0,11],[32,12],[65,223,0],[58,0,12],[32,12],[184],[33,8],[32,3],[33,5],[2,124],[32,5],[65,1],[70],[4,64,"TYPESWITCH|Number"],[16,builtin('#get___Number_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,2],[70],[4,64,"TYPESWITCH|Boolean"],[16,builtin('#get___Boolean_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,5],[70],[4,64,"TYPESWITCH|Symbol"],[16,builtin('#get___Symbol_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,7],[252,3],[32,3],[32,8],[65,195,1],[16,builtin('__ecma262_ToPropertyKey')],[33,11],[252,3],[32,11],[16,builtin('__Porffor_object_get')],[33,6],[12,1],[11],[32,5],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,7],[252,3],[32,3],[32,8],[65,195,1],[16,builtin('__ecma262_ToPropertyKey')],[33,11],[252,3],[32,11],[16,builtin('__Porffor_object_get')],[33,6],[12,1],[11],[32,5],[65,18],[70],[4,64,"TYPESWITCH|Date"],[16,builtin('#get___Date_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,19],[70],[4,64,"TYPESWITCH|Set"],[16,builtin('#get___Set_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,20],[70],[4,64,"TYPESWITCH|Map"],[16,builtin('#get___Map_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,21],[70],[4,64,"TYPESWITCH|ArrayBuffer"],[16,builtin('#get___ArrayBuffer_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,22],[70],[4,64,"TYPESWITCH|SharedArrayBuffer"],[16,builtin('#get___SharedArrayBuffer_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,23],[70],[4,64,"TYPESWITCH|DataView"],[16,builtin('#get___DataView_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,33],[70],[4,64,"TYPESWITCH|WeakRef"],[16,builtin('#get___WeakRef_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,34],[70],[4,64,"TYPESWITCH|WeakSet"],[16,builtin('#get___WeakSet_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,35],[70],[4,64,"TYPESWITCH|WeakMap"],[16,builtin('#get___WeakMap_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,36],[70],[4,64,"TYPESWITCH|Promise"],[16,builtin('#get___Promise_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[16,builtin('#get___String_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[16,builtin('#get___Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[16,builtin('#get___Uint8Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[16,builtin('#get___Int8Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[16,builtin('#get___Uint8ClampedArray_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[16,builtin('#get___Uint16Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[16,builtin('#get___Int16Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[16,builtin('#get___Uint32Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[16,builtin('#get___Int32Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[16,builtin('#get___Float32Array_prototype')],[184],[65,7],[33,6],[12,1],[11],[32,5],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[16,builtin('#get___Float64Array_prototype')],[184],[65,7],[33,6],[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('#get___ByteString_prototype')],[184],[65,7],[33,6],[12,1],[11],[68,0],[65,128,1],[33,6],[11,"TYPESWITCH_end"],[34,14,"string_only"],[32,1,"string_only|start"],[65,128,1],[114],[65,195,1],[70],[32,6],[65,128,1],[114],[65,195,1],[70],[114],[4,64],[32,13],[32,1],[32,14],[32,6],[16,builtin('__Porffor_compareStrings')],[26],[252,3],[12,1],[11,"string_only|end"],[97],[11,"string_only"],[184],[65,2],[15]],
|
1650
1650
|
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1651
1651
|
locals:[124,127,127,124,124,127,127,127,127,124,124],localNames:["_this","_this#type","obj","obj#type","#logicinner_tmp","#typeswitch_tmp1","#last_type","#member_obj","#member_prop","#loadArray_offset","#member_allocd","#swap","#makearray_pointer_tmp","__tmpop_left","__tmpop_right"],
|
1652
1652
|
};
|
package/compiler/codegen.js
CHANGED
@@ -5405,7 +5405,7 @@ const generateMember = (scope, decl, _global, _name, _objectWasm = undefined) =>
|
|
5405
5405
|
if (type == null) continue;
|
5406
5406
|
|
5407
5407
|
// do not __proto__ primitive hack for objects
|
5408
|
-
if (type === TYPES.object) continue;
|
5408
|
+
if (type === TYPES.object || type === TYPES.function) continue;
|
5409
5409
|
|
5410
5410
|
const ident = {
|
5411
5411
|
type: 'Identifier',
|
@@ -6084,8 +6084,15 @@ const generateFunc = (scope, decl, outUnused = false) => {
|
|
6084
6084
|
}
|
6085
6085
|
|
6086
6086
|
case 'AssignmentPattern': {
|
6087
|
-
|
6088
|
-
|
6087
|
+
if (x.left.name) {
|
6088
|
+
name = x.left.name;
|
6089
|
+
defaultValues[name] = x.right;
|
6090
|
+
} else {
|
6091
|
+
name = '#arg_dstr' + i;
|
6092
|
+
destructuredArgs[name] = x.left;
|
6093
|
+
defaultValues[name] = x.right;
|
6094
|
+
}
|
6095
|
+
|
6089
6096
|
break;
|
6090
6097
|
}
|
6091
6098
|
|
package/package.json
CHANGED
package/r.js
ADDED