porffor 0.48.7 → 0.48.8
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/README.md +3 -4
- package/compiler/builtins/promise.ts +2 -0
- package/compiler/builtins_precompiled.js +7 -0
- package/compiler/codegen.js +21 -13
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/README.md
CHANGED
@@ -83,11 +83,10 @@ Rhemyn is Porffor's own regex engine; it compiles literal regex to Wasm bytecode
|
|
83
83
|
2c is Porffor's own Wasm -> C compiler, using generated Wasm bytecode and internal info to generate specific and efficient/fast C code. Little boilerplate/preluded code or required external files, just for CLI binaries (not like wasm2c very much).
|
84
84
|
|
85
85
|
## Versioning
|
86
|
-
Porffor uses a unique versioning system, here's an example: `0.
|
86
|
+
Porffor uses a unique versioning system, here's an example: `0.48.7`. Let's break it down:
|
87
87
|
1. `0` - major, always `0` as Porffor is not ready yet
|
88
|
-
2. `
|
89
|
-
3. `
|
90
|
-
4. `2aa3f0589` - commit hash
|
88
|
+
2. `48` - minor, total Test262 pass percentage (rounded half down, eg `49.4%` -> `48`, `49.5%` -> `49`)
|
89
|
+
3. `7` - micro, build number for that minor (incremented each git push)
|
91
90
|
|
92
91
|
## Performance
|
93
92
|
*For the features it supports most of the time*, Porffor is *blazingly fast* compared to most interpreters and common engines running without JIT. For those with JIT, it is usually slower by default, but can catch up with compiler arguments and typed input, even more so when compiling to native binaries.
|
@@ -473,6 +473,8 @@ export const __Promise_race = (promises: any): Promise => {
|
|
473
473
|
});
|
474
474
|
};
|
475
475
|
|
476
|
+
// export const __Promise_try = function (cb: any, ...args: any[]) { return new this(res => res(cb(...args))) };
|
477
|
+
export const __Promise_try = async (cb: any, ...args: any[]) => cb(...args);
|
476
478
|
|
477
479
|
export const __Promise_prototype_toString = (_this: any) => '[object Promise]';
|
478
480
|
export const __Promise_prototype_toLocaleString = (_this: any) => __Promise_prototype_toString(_this);
|
@@ -2460,6 +2460,13 @@ locals:[124,127,127],localNames:["r","r#type","#indirect_callee","#typeswitch_tm
|
|
2460
2460
|
globalInits:{jobQueue:(_,{allocPage,glbl})=>[...number(allocPage(_,'promise.ts/jobQueue'),124),...glbl(36,'jobQueue',124),[65,16],[26]]},
|
2461
2461
|
table:1,usesTag:1,
|
2462
2462
|
}
|
2463
|
+
this.__Promise_try = {
|
2464
|
+
wasm:(_,{t,builtin,internalThrow})=>[[16,builtin('__Porffor_promise_create')],[26],[33,4],[6,64],[32,0],[33,14],[32,1],[33,10],[2,124],...t([6],()=>[[32,10],[65,6],[70],[4,64],[68,0],[65,128,1],[68,0],[65,128,1],[32,2],[33,5],[65,208,0],[34,6],[65,208,0],[70],[32,6],[65,19],[70],[114],[32,6],[65,195,0],[70],[114],[32,6],[65,195,1],[70],[114],[32,6],[65,50],[70],[114],[32,6],[65,216,0],[78],[32,6],[65,224,0],[76],[113],[114],[69],[4,64],...internalThrow(_,'TypeError',`Cannot spread a non-iterable`),[11],[32,5],[33,7],[68,0],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,5],[33,7],[68,1],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,5],[33,7],[68,2],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,5],[33,7],[68,3],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,5],[33,7],[68,4],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,5],[33,7],[68,5],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,5],[33,7],[68,6],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,5],[33,7],[68,7],[33,8],[32,6],[33,10],[2,124],...t([67],()=>[[32,10],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[65,2],[108],[32,7],[252,3],[106],[47,0,4],[59,0,4],[32,11],[184],[65,195,0],[33,9],[12,1],[11]]),...t([80],()=>[[32,10],[65,208,0],[70],[4,64],[32,8],[252,3],[65,9],[108],[32,7],[252,3],[106],[34,12],[43,0,4],[32,12],[45,0,12],[33,9],[12,1],[11]]),...t([88],()=>[[32,10],[65,216,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([89],()=>[[32,10],[65,217,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[44,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([90],()=>[[32,10],[65,218,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[106],[45,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([91],()=>[[32,10],[65,219,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([92],()=>[[32,10],[65,220,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([93],()=>[[32,10],[65,221,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,9],[12,1],[11]]),...t([94],()=>[[32,10],[65,222,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,9],[12,1],[11]]),...t([95],()=>[[32,10],[65,223,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,9],[12,1],[11]]),...t([96],()=>[[32,10],[65,224,0],[70],[4,64],[32,7],[252,3],[40,0,4],[32,8],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,9],[12,1],[11]]),...t([128],()=>[[32,10],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,10],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,11],[65,1],[54,0,0],[32,11],[32,8],[252,3],[32,7],[252,3],[106],[45,0,4],[58,0,4],[32,11],[184],[65,195,1],[33,9],[12,1],[11]]),[32,7],[252,2],[32,6],[32,8],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,13],[252,2],[32,13],[16,builtin('__Porffor_object_get')],[33,9],[11],[32,9],[32,14],[252,3],[17,10,0],[33,9],[12,1],[11]]),...internalThrow(_,'TypeError',`cb is not a function`),[68,0],[11],[32,9],[32,4],[65,36],[16,builtin('__Porffor_promise_resolve')],[26],[26],[32,4],[65,36],[15],[7,0],[32,4],[65,36],[16,builtin('__Porffor_promise_reject')],[26],[26],[11],[32,4],[65,36],[15]],
|
2465
|
+
params:[124,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
2466
|
+
locals:[124,124,127,124,124,127,127,127,127,127,124],localNames:["cb","cb#type","args","args#type","#async_out_promise","#spread","#spread#type","#member_obj","#member_prop","#last_type","#typeswitch_tmp1","#member_allocd","#loadArray_offset","#swap","#indirect_callee"],
|
2467
|
+
usedTypes:[36,80,67,195],
|
2468
|
+
table:1,hasRestArgument:1,usesTag:1,
|
2469
|
+
}
|
2463
2470
|
this.__Promise_prototype_toString = {
|
2464
2471
|
wasm:(_,{makeString})=>[...makeString(_,"[object Promise]",1),[65,195,1],[15]],
|
2465
2472
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
package/compiler/codegen.js
CHANGED
@@ -1922,21 +1922,29 @@ const createThisArg = (scope, decl) => {
|
|
1922
1922
|
...number(TYPES.object, Valtype.i32)
|
1923
1923
|
];
|
1924
1924
|
} else {
|
1925
|
-
if (name && name.startsWith('__')
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1925
|
+
if (name && name.startsWith('__')) {
|
1926
|
+
let node = null;
|
1927
|
+
|
1928
|
+
if (name.includes('_prototype_')) {
|
1929
|
+
node = {
|
1930
|
+
type: 'NewExpression',
|
1931
|
+
callee: {
|
1932
|
+
type: 'Identifier',
|
1933
|
+
name: name.slice(2, name.indexOf('_', 2))
|
1934
|
+
},
|
1935
|
+
arguments: [],
|
1936
|
+
_new: true
|
1937
|
+
};
|
1938
|
+
} else {
|
1939
|
+
node = {
|
1932
1940
|
type: 'Identifier',
|
1933
|
-
name: name.slice(2, name.
|
1934
|
-
}
|
1935
|
-
arguments: [],
|
1936
|
-
_new: true
|
1937
|
-
};
|
1941
|
+
name: name.slice(2, name.lastIndexOf('_'))
|
1942
|
+
};
|
1938
1943
|
|
1939
|
-
|
1944
|
+
if (ifIdentifierErrors(scope, node)) node = null;
|
1945
|
+
}
|
1946
|
+
|
1947
|
+
if (node) return [
|
1940
1948
|
...generate(scope, node),
|
1941
1949
|
...getNodeType(scope, node)
|
1942
1950
|
];
|
package/package.json
CHANGED