porffor 0.41.0 → 0.41.1
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/__internal_object.ts +1 -1
- package/compiler/builtins/array.ts +17 -7
- package/compiler/builtins/error.js +0 -2
- package/compiler/builtins/porffor.d.ts +1 -0
- package/compiler/builtins_precompiled.js +15 -8
- package/compiler/codegen.js +14 -2
- package/compiler/index.js +20 -2
- package/package.json +1 -1
- package/r.js +5 -0
- package/runner/index.js +1 -1
@@ -13,7 +13,7 @@ export const __Porffor_object_underlying = (obj: any): any => {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
if (Porffor.fastAnd(t > 0x05, t != Porffor.TYPES.undefined)) {
|
16
|
-
let idx: i32 =
|
16
|
+
let idx: i32 = Porffor.array.fastIndexOf(underlyingKeys, obj);
|
17
17
|
if (idx == -1) {
|
18
18
|
const underlying: object = {};
|
19
19
|
|
@@ -68,13 +68,6 @@ export const __Array_from = (arg: any, mapFn: any): any[] => {
|
|
68
68
|
return out;
|
69
69
|
};
|
70
70
|
|
71
|
-
export const __Porffor_array_fastPush = (arr: any[], el: any): i32 => {
|
72
|
-
let len: i32 = arr.length;
|
73
|
-
arr[len] = el;
|
74
|
-
arr.length = ++len;
|
75
|
-
return len;
|
76
|
-
};
|
77
|
-
|
78
71
|
export const __Array_prototype_push = (_this: any[], ...items: any[]) => {
|
79
72
|
let len: i32 = _this.length;
|
80
73
|
const itemsLen: i32 = items.length;
|
@@ -871,4 +864,21 @@ export const __Array_prototype_flat = (_this: any[], _depth: any) => {
|
|
871
864
|
out.length = j;
|
872
865
|
|
873
866
|
return out;
|
867
|
+
};
|
868
|
+
|
869
|
+
|
870
|
+
export const __Porffor_array_fastPush = (arr: any[], el: any): i32 => {
|
871
|
+
let len: i32 = arr.length;
|
872
|
+
arr[len] = el;
|
873
|
+
arr.length = ++len;
|
874
|
+
return len;
|
875
|
+
};
|
876
|
+
|
877
|
+
export const __Porffor_array_fastIndexOf = (arr: any[], el: any): i32 => {
|
878
|
+
const len: i32 = arr.length;
|
879
|
+
for (let i: i32 = 0; i < len; i++) {
|
880
|
+
if (arr[i] === el) return i;
|
881
|
+
}
|
882
|
+
|
883
|
+
return -1;
|
874
884
|
};
|
@@ -2,8 +2,6 @@ export default () => {
|
|
2
2
|
let out = '';
|
3
3
|
|
4
4
|
const error = name => out += `export const ${name} = function (message: any) {
|
5
|
-
new.target; // trick compiler into allowing as constructor
|
6
|
-
|
7
5
|
const _empty: bytestring = '';
|
8
6
|
if (message === undefined) message = _empty;
|
9
7
|
else message = ecma262.ToString(message);
|
@@ -3,11 +3,12 @@ import { number } from './embedding.js';
|
|
3
3
|
|
4
4
|
export const BuiltinFuncs = function() {
|
5
5
|
this.__Porffor_object_underlying = {
|
6
|
-
wasm:(_,{allocPage,glbl,builtin})=>[[32,1],[184],[34,2],[68,7],[97],[4,64],[32,0],[32,1],[15],[11],[32,2],[68,39],[102],[32,2],[68,48],[101],[113],[4,64],[32,0],[34,3],[65,7],[15],[11],[32,2],[68,5],[100],[32,2],[68,128],[98],[113],[4,64],...glbl(35,'underlyingKeys',124),[33,5],[65,
|
6
|
+
wasm:(_,{t,allocPage,glbl,builtin,internalThrow})=>[[32,1],[184],[34,2],[68,7],[97],[4,64],[32,0],[32,1],[15],[11],[32,2],[68,39],[102],[32,2],[68,48],[101],[113],[4,64],[32,0],[34,3],[65,7],[15],[11],[32,2],[68,5],[100],[32,2],[68,128],[98],[113],[4,64],...internalThrow(_,'ReferenceError',`Porffor.array.fastIndexOf is not defined`),[68,0],[33,18],[65,128,1],[33,19],[2,124],...t([6],()=>[[32,19],[65,6],[70],[4,64],...glbl(35,'underlyingKeys',124),[65,208,0],[33,5],[33,6],[32,0],[32,1],[33,7],[33,8],[68,0],[65,128,1],[33,9],[33,10],[68,0],[65,128,1],[33,11],[33,12],[68,0],[65,128,1],[33,13],[33,14],[32,18],[252,3],[34,15],[65,192,0],[108],[65,4],[106],[45,0,128,128,8,"read func lut"],[33,16],[2,124],[2,64],[2,64],[2,64],[2,64],[2,64],[2,64],[32,15],[65,192,0],[108],[47,0,128,128,8,"read func lut"],[14,6,0,1,2,3,4,5,0],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,15],[17,2,0,"no_type_return"],[5],[32,15],[17,0,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,15],[17,2,0],[33,17],[5],[32,15],[17,0,0],[33,17],[11],[11],[12,5],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,15],[17,3,0,"no_type_return"],[5],[32,6],[32,5],[32,15],[17,1,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,15],[17,3,0],[33,17],[5],[32,6],[32,5],[32,15],[17,1,0],[33,17],[11],[11],[12,4],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,15],[17,4,0,"no_type_return"],[5],[32,6],[32,5],[32,8],[32,7],[32,15],[17,2,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,15],[17,4,0],[33,17],[5],[32,6],[32,5],[32,8],[32,7],[32,15],[17,2,0],[33,17],[11],[11],[12,3],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,15],[17,5,0,"no_type_return"],[5],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,15],[17,3,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,15],[17,5,0],[33,17],[5],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,15],[17,3,0],[33,17],[11],[11],[12,2],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,15],[17,6,0,"no_type_return"],[5],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,15],[17,4,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,15],[17,6,0],[33,17],[5],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,15],[17,4,0],[33,17],[11],[11],[12,1],[11],[32,16],[65,1],[113],[4,124],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,7,0,"no_type_return"],[5],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,5,0,"no_type_return"],[11],[5],[32,16],[65,2],[113],[4,124],[68,0],[65,128,1],[68,0],[65,128,1],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,7,0],[33,17],[5],[32,6],[32,5],[32,8],[32,7],[32,10],[32,9],[32,12],[32,11],[32,14],[32,13],[32,15],[17,5,0],[33,17],[11],[11],[11],[12,1],[11]]),...internalThrow(_,'TypeError',`Porffor.array.fastIndexOf is not a function`),[68,0],[11],[34,4],[68,-1],[97],[4,64],[16,builtin('__Porffor_allocate')],[184],[33,20],[32,2],[68,6],[97],[4,64],[32,0],[252,2],[16,builtin('__Porffor_funcLut_flags')],[183],[34,21],[68,2],[16,builtin('f64_&')],[252,3],[4,64],[16,builtin('__Porffor_allocate')],[184],[33,22],[65,7],[33,23],...number(allocPage(_,'bytestring: __Porffor_object_underlying/key1','i8'),124),[33,24],[32,20],[252,2],[65,7],[32,24],[252,2],[65,195,1],[32,22],[32,23],[65,8],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],...number(allocPage(_,'bytestring: __Porffor_object_underlying/key2','i8'),124),[33,25],[32,22],[252,2],[32,23],[32,25],[252,2],[65,195,1],[32,0],[32,1],[65,10],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],[11],[11],[32,2],[68,80],[97],[4,64],[32,0],[34,26],[252,3],[40,1,0],[184],[33,27],...number(allocPage(_,'bytestring: __Porffor_object_underlying/key3','i8'),124),[33,28],[32,20],[252,2],[65,7],[32,28],[252,2],[65,195,1],[32,27],[65,1],[65,8],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],[68,0],[33,29],[3,64],[32,29],[32,27],[99],[4,64],[32,20],[252,2],[65,7],[32,29],[65,1],[68,0],[65,128,1],[16,builtin('__Number_prototype_toString')],[33,17],[252,2],[32,17],[32,26],[33,30],[32,29],[34,31],[252,3],[65,9],[108],[32,30],[252,3],[106],[34,32],[43,0,4],[32,32],[45,0,12],[34,17],[65,14],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],[32,29],[68,1],[160],[33,29],[12,1],[11],[11],[11],[32,2],[68,67],[97],[4,64],[32,0],[34,33],[252,3],[40,1,0],[184],[33,27],[32,28],[252,3],[34,34],[65,6],[54,1,0],[32,34],[65,236,0],[58,0,4],[32,34],[65,229,0],[58,0,5],[32,34],[65,238,0],[58,0,6],[32,34],[65,231,0],[58,0,7],[32,34],[65,244,0],[58,0,8],[32,34],[65,232,0],[58,0,9],[32,34],[184],[33,28],[32,20],[252,2],[65,7],[32,24],[252,2],[65,195,1],[32,27],[65,1],[65,0],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],[68,0],[33,29],[3,64],[32,29],[32,27],[99],[4,64],[32,20],[252,2],[65,7],[32,29],[65,1],[68,0],[65,128,1],[16,builtin('__Number_prototype_toString')],[33,17],[252,2],[32,17],[32,33],[33,30],[32,29],[33,31],[16,builtin('__Porffor_allocate')],[34,35],[65,1],[54,0,0],[32,35],[32,31],[252,3],[65,2],[108],[32,30],[252,3],[106],[47,0,4],[59,0,4],[32,35],[184],[65,195,0],[33,17],[65,195,0],[65,4],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],[32,29],[68,1],[160],[33,29],[12,1],[11],[11],[32,20],[252,2],[65,7],[16,builtin('__Porffor_object_preventExtensions')],[33,17],[183],[26],[11],[32,2],[68,195],[97],[4,64],[32,0],[34,33],[252,3],[40,1,0],[184],[33,27],[32,28],[252,3],[34,34],[65,6],[54,1,0],[32,34],[65,236,0],[58,0,4],[32,34],[65,229,0],[58,0,5],[32,34],[65,238,0],[58,0,6],[32,34],[65,231,0],[58,0,7],[32,34],[65,244,0],[58,0,8],[32,34],[65,232,0],[58,0,9],[32,34],[184],[33,28],[32,20],[252,2],[65,7],[32,24],[252,2],[65,195,1],[32,27],[65,1],[65,0],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],[68,0],[33,29],[3,64],[32,29],[32,27],[99],[4,64],[32,20],[252,2],[65,7],[32,29],[65,1],[68,0],[65,128,1],[16,builtin('__Number_prototype_toString')],[33,17],[252,2],[32,17],[32,33],[33,30],[32,29],[33,31],[16,builtin('__Porffor_allocate')],[34,35],[65,1],[54,0,0],[32,35],[32,31],[252,3],[32,30],[252,3],[106],[45,0,4],[58,0,4],[32,35],[184],[65,195,1],[33,17],[65,195,1],[65,4],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,17],[183],[26],[32,29],[68,1],[160],[33,29],[12,1],[11],[11],[32,20],[252,2],[65,7],[16,builtin('__Porffor_object_preventExtensions')],[33,17],[183],[26],[11],...glbl(35,'underlyingVals',124),[65,208,0],[32,20],[65,7],[16,builtin('__Porffor_array_fastPush')],[33,17],[26],...glbl(35,'underlyingKeys',124),[65,208,0],[32,0],[32,1],[16,builtin('__Porffor_array_fastPush')],[33,17],[68,1],[161],[33,4],[11],...glbl(35,'underlyingVals',124),[33,30],[32,4],[34,31],[252,3],[65,9],[108],[32,30],[252,3],[106],[34,32],[43,0,4],[32,32],[45,0,12],[34,17],[15],[11],[32,0],[32,1],[15]],
|
7
7
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
8
|
-
locals:[124,124,124,124,127,127,124,124,124,127,124,124,124,124,124,124,124,124,127,124,127,127],localNames:["obj","obj#type","t","remap","idx","#
|
8
|
+
locals:[124,124,124,127,124,127,124,127,124,127,124,127,124,127,127,127,124,127,124,124,124,127,124,124,124,124,124,124,124,124,127,124,127,127],localNames:["obj","obj#type","t","remap","idx","#indirect_arg0_type","#indirect_arg0_val","#indirect_arg1_type","#indirect_arg1_val","#indirect_arg2_type","#indirect_arg2_val","#indirect_arg3_type","#indirect_arg3_val","#indirect_arg4_type","#indirect_arg4_val","#indirect_func","#indirect_flags","#last_type","#indirect_callee","#typeswitch_tmp1","underlying","flags","proto","proto#type","key1","key2","arr","len","key3","i","#member_obj","#member_prop","#loadArray_offset","str","#makearray_pointer_tmp","#member_allocd"],
|
9
9
|
usedTypes:[7,80,195,67],
|
10
10
|
globalInits:{underlyingKeys:(_,{allocPage,glbl,loc})=>[...number(allocPage(_,'array: __internal_object.ts/underlyingKeys','f64'),124),...glbl(36,'underlyingKeys',124),...glbl(35,'underlyingKeys',124),[252,3],[33,loc('#makearray_pointer_tmp',127)],[32,loc('#makearray_pointer_tmp',127)],[65,0],[54,1,0],[32,loc('#makearray_pointer_tmp',127)],[26]],underlyingVals:(_,{allocPage,glbl,loc})=>[...number(allocPage(_,'array: __internal_object.ts/underlyingVals','f64'),124),...glbl(36,'underlyingVals',124),...glbl(35,'underlyingVals',124),[252,3],[33,loc('#makearray_pointer_tmp',127)],[32,loc('#makearray_pointer_tmp',127)],[65,0],[54,1,0],[32,loc('#makearray_pointer_tmp',127)],[26]]},data:{"bytestring: __Porffor_object_underlying/key1":[9,0,0,0,112,114,111,116,111,116,121,112,101],"bytestring: __Porffor_object_underlying/key2":[11,0,0,0,99,111,110,115,116,114,117,99,116,111,114],"bytestring: __Porffor_object_underlying/key3":[6,0,0,0,108,101,110,103,116,104]},
|
11
|
+
table:1,
|
11
12
|
};
|
12
13
|
this.__Porffor_strcmp = {
|
13
14
|
wasm:()=>[[32,0],[32,2],[70],[4,64],[65,1],[65,2],[15],[11],[32,0],[40,0,0],[33,4],[32,2],[40,0,0],[33,5],[32,4],[32,5],[71],[4,64],[65,0],[65,2],[15],[11],[32,1],[65,195,1],[70],[4,64],[32,3],[65,195,1],[70],[4,64],[32,0],[65,28],[107],[33,6],[32,2],[65,28],[107],[33,7],[32,0],[65,4],[107],[33,8],[32,2],[65,4],[107],[33,9],[32,4],[65,32],[78],[4,64],[3,64],[32,6],[32,4],[106],[253,0,0,0],[32,7],[32,4],[106],[253,0,0,0],[253,81],[32,6],[32,4],[106],[253,0,0,16],[32,7],[32,4],[106],[253,0,0,16],[253,81],[253,80],[253,83],[4,64],[65,0],[65,2],[15],[11],[32,4],[65,32],[107],[34,4],[65,32],[78],[13,0],[11],[11],[32,4],[65,8],[78],[4,64],[3,64],[32,8],[32,4],[106],[41,0,0],[32,9],[32,4],[106],[41,0,0],[82],[4,64],[65,0],[65,2],[15],[11],[32,4],[65,8],[107],[34,4],[65,8],[78],[13,0],[11],[11],[32,4],[65,2],[78],[4,64],[3,64],[32,0],[32,4],[106],[47,0,2],[32,2],[32,4],[106],[47,0,2],[71],[4,64],[65,0],[65,2],[15],[11],[32,4],[65,2],[107],[34,4],[65,2],[78],[13,0],[11],[11],[32,4],[65,1],[70],[4,64],[32,0],[45,0,4],[32,2],[45,0,4],[71],[4,64],[65,0],[65,2],[15],[11],[11],[65,1],[65,2],[15],[5],[65,0],[33,10],[3,64],[32,10],[32,4],[72],[4,64],[32,0],[32,10],[106],[45,0,4],[32,2],[32,10],[65,2],[108],[106],[47,0,4],[71],[4,64],[65,0],[65,2],[15],[11],[32,10],[65,1],[106],[33,10],[12,1],[11],[11],[65,1],[65,2],[15],[11],[5],[32,3],[65,195,1],[70],[4,64],[65,0],[33,10],[3,64],[32,10],[32,4],[72],[4,64],[32,0],[32,10],[65,2],[108],[106],[47,0,4],[32,2],[32,10],[106],[45,0,4],[71],[4,64],[65,0],[65,2],[15],[11],[32,10],[65,1],[106],[33,10],[12,1],[11],[11],[65,1],[65,2],[15],[5],[32,0],[65,4],[107],[33,11],[32,2],[65,4],[107],[33,12],[3,64],[32,11],[32,4],[65,2],[108],[106],[41,0,0],[32,12],[32,4],[65,2],[108],[106],[41,0,0],[82],[4,64],[65,0],[65,2],[15],[11],[32,4],[65,4],[107],[34,4],[65,4],[78],[13,0],[11],[65,0],[33,10],[3,64],[32,10],[32,4],[72],[4,64],[32,0],[32,10],[65,2],[108],[106],[47,0,4],[32,2],[32,10],[65,2],[108],[106],[47,0,4],[71],[4,64],[65,0],[65,2],[15],[11],[32,10],[65,1],[106],[33,10],[12,1],[11],[11],[65,1],[65,2],[15],[11],[11],[65,0],[65,128,1],[15]],
|
@@ -347,12 +348,6 @@ locals:[124,124,124,127,124,127,124,124,127,127,127,127,127,124,127,124,127,124,
|
|
347
348
|
usedTypes:[80,67,195],
|
348
349
|
table:1,
|
349
350
|
};
|
350
|
-
this.__Porffor_array_fastPush = {
|
351
|
-
wasm:()=>[[32,0],[252,3],[40,1,0],[184],[33,4],[32,0],[33,7],[32,4],[33,8],[32,7],[252,3],[32,8],[252,3],[65,9],[108],[106],[34,6],[32,2],[34,5],[57,0,4],[32,6],[32,3],[58,0,12],[32,0],[252,3],[34,10],[32,4],[68,1],[160],[34,4],[34,9],[252,3],[54,1,0],[32,4],[65,1],[15]],
|
352
|
-
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
353
|
-
locals:[124,124,127,124,124,124,127],localNames:["arr","arr#type","el","el#type","len","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop_assign","__length_setter_tmp","__member_setter_ptr_tmp"],
|
354
|
-
usedTypes:[80],
|
355
|
-
};
|
356
351
|
this.__Array_prototype_push = {
|
357
352
|
wasm:()=>[[32,0],[252,3],[40,1,0],[184],[33,4],[32,2],[252,3],[40,1,0],[184],[33,5],[68,0],[33,6],[3,64],[32,6],[32,5],[99],[4,64],[32,0],[33,9],[32,6],[32,4],[160],[33,10],[32,9],[252,3],[32,10],[252,3],[65,9],[108],[106],[34,8],[32,2],[33,9],[32,6],[34,11],[252,3],[65,9],[108],[32,9],[252,3],[106],[34,13],[43,0,4],[32,13],[45,0,12],[33,12],[34,7],[57,0,4],[32,8],[32,12],[58,0,12],[32,6],[68,1],[160],[33,6],[12,1],[11],[11],[32,0],[252,3],[34,15],[32,4],[32,5],[160],[34,14],[252,3],[54,1,0],[32,14],[65,1],[15]],
|
358
353
|
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
@@ -580,6 +575,18 @@ params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
|
580
575
|
locals:[124,127,124,124,124,124,124,127,124,124,127,127,127,127,127,124,127,124,127,124,127,124,127,127,124,127],localNames:["_this","_this#type","_depth","_depth#type","depth","#last_type","out","len","i","j","x","x#type","#member_obj","#member_prop","#loadArray_offset","#forof_base_pointer0","#forof_length0","#forof_counter0","#forof_itertype0","#forof_tmp0","#forof_tmp0#type","y","y#type","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_prop_assign","#typeswitch_tmp1","#forof_allocd","__length_setter_tmp","__member_setter_ptr_tmp"],
|
581
576
|
usedTypes:[80,67,195],
|
582
577
|
};
|
578
|
+
this.__Porffor_array_fastPush = {
|
579
|
+
wasm:()=>[[32,0],[252,3],[40,1,0],[184],[33,4],[32,0],[33,7],[32,4],[33,8],[32,7],[252,3],[32,8],[252,3],[65,9],[108],[106],[34,6],[32,2],[34,5],[57,0,4],[32,6],[32,3],[58,0,12],[32,0],[252,3],[34,10],[32,4],[68,1],[160],[34,4],[34,9],[252,3],[54,1,0],[32,4],[65,1],[15]],
|
580
|
+
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
581
|
+
locals:[124,124,127,124,124,124,127],localNames:["arr","arr#type","el","el#type","len","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop_assign","__length_setter_tmp","__member_setter_ptr_tmp"],
|
582
|
+
usedTypes:[80],
|
583
|
+
};
|
584
|
+
this.__Porffor_array_fastIndexOf = {
|
585
|
+
wasm:(_,{builtin})=>[[32,0],[252,3],[40,1,0],[184],[33,4],[68,0],[33,5],[3,64],[32,5],[32,4],[99],[4,64],[2,64],[2,127],[32,0],[33,6],[32,5],[34,7],[252,3],[65,9],[108],[32,6],[252,3],[106],[34,9],[43,0,4],[32,9],[45,0,12],[33,8],[34,10],[32,2],[34,11],[32,8],[65,128,1],[114],[65,195,1],[70],[32,3],[65,128,1],[114],[65,195,1],[70],[114],[4,64],[32,10],[32,8],[32,11],[32,3],[16,builtin('__Porffor_compareStrings')],[26],[252,3],[12,1],[11],[97],[11],[32,8],[65,128,1],[114],[32,3],[65,128,1],[114],[70],[113],[4,64],[32,5],[65,1],[15],[11],[11],[32,5],[68,1],[160],[33,5],[12,1],[11],[11],[68,-1],[65,1],[15]],
|
586
|
+
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
587
|
+
locals:[124,124,124,124,127,127,124,124],localNames:["arr","arr#type","el","el#type","len","i","#member_obj","#member_prop","#last_type","#loadArray_offset","__tmpop_left","__tmpop_right"],
|
588
|
+
usedTypes:[80],
|
589
|
+
};
|
583
590
|
this.__ArrayBuffer_isView = {
|
584
591
|
wasm:()=>[[32,1],[184],[34,2],[68,23],[97],[32,2],[68,88],[102],[32,2],[68,96],[101],[113],[114],[4,64],[68,1],[65,2],[15],[11],[68,0],[65,2],[15]],
|
585
592
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
package/compiler/codegen.js
CHANGED
@@ -3747,8 +3747,20 @@ const ifIdentifierErrors = (scope, decl) => {
|
|
3747
3747
|
const generateUnary = (scope, decl) => {
|
3748
3748
|
switch (decl.operator) {
|
3749
3749
|
case '+':
|
3750
|
-
//
|
3751
|
-
|
3750
|
+
// 13.5.4 Unary + Operator, 13.5.4.1 Runtime Semantics: Evaluation
|
3751
|
+
// https://tc39.es/ecma262/#sec-unary-plus-operator-runtime-semantics-evaluation
|
3752
|
+
// 1. Let expr be ? Evaluation of UnaryExpression.
|
3753
|
+
// 2. Return ? ToNumber(? GetValue(expr)).
|
3754
|
+
return generate(scope, {
|
3755
|
+
type: 'CallExpression',
|
3756
|
+
callee: {
|
3757
|
+
type: 'Identifier',
|
3758
|
+
name: '__ecma262_ToNumber'
|
3759
|
+
},
|
3760
|
+
arguments: [
|
3761
|
+
decl.argument
|
3762
|
+
]
|
3763
|
+
});
|
3752
3764
|
|
3753
3765
|
case '-':
|
3754
3766
|
// * -1
|
package/compiler/index.js
CHANGED
@@ -164,8 +164,26 @@ export default (code, module = undefined) => {
|
|
164
164
|
data[i] = run(data[i]);
|
165
165
|
}
|
166
166
|
|
167
|
-
const
|
168
|
-
|
167
|
+
const print = (x, depth = []) => {
|
168
|
+
for (const [ name, inc ] of x) {
|
169
|
+
if (inc.length === 0) continue;
|
170
|
+
console.log(name);
|
171
|
+
|
172
|
+
for (let i = 0; i < inc.length; i++) {
|
173
|
+
if (inc[i][1].length === 0) continue;
|
174
|
+
process.stdout.write(`${depth.join(' ')}${depth.length > 0 ? ' ' : ''}${i != inc.length - 1 ? '├' : '└' } `);
|
175
|
+
|
176
|
+
const newDepth = [...depth];
|
177
|
+
newDepth.push(i != inc.length - 1 ? '│' : '');
|
178
|
+
|
179
|
+
print([ inc[i] ], newDepth);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
};
|
183
|
+
print(data);
|
184
|
+
|
185
|
+
// const url = Diagram.url(Diagram.tree(data));
|
186
|
+
// console.log(`built-in tree: ${url}`);
|
169
187
|
}
|
170
188
|
|
171
189
|
if (logProgress) progressStart('assembling...');
|
package/package.json
CHANGED