porffor 0.55.24 → 0.55.26

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/2c.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { read_ieee754_binary64, read_signedLEB128, read_unsignedLEB128 } from './encoding.js';
2
- import { Blocktype, Opcodes, Valtype } from './wasmSpec.js';
2
+ import { Blocktype, Opcodes, Valtype, PageSize } from './wasmSpec.js';
3
3
  import { operatorOpcode } from './expression.js';
4
4
  import { log } from './log.js';
5
5
  import './prefs.js';
@@ -218,7 +218,7 @@ export default ({ funcs, globals, tags, data, exceptions, pages }) => {
218
218
  if (pages.size > 0) {
219
219
  includes.set('stdlib.h', true);
220
220
  prepend.set('_memory', `char* _memory; u32 _memoryPages = ${pages.size};\n`);
221
- prependMain.set('_initMemory', `_memory = malloc(_memoryPages * ${pageSize});\n`);
221
+ prependMain.set('_initMemory', `_memory = malloc(_memoryPages * ${PageSize});\n`);
222
222
  if (Prefs['2cMemcpy']) includes.set('string.h', true);
223
223
  }
224
224
 
@@ -1,9 +1,8 @@
1
- import { PageSize } from './wasmSpec.js';
2
1
  import './prefs.js';
3
2
 
4
3
  const pagePtr = ind => {
5
4
  if (ind === 0) return 16;
6
- return ind * PageSize;
5
+ return ind * pageSize;
7
6
  };
8
7
 
9
8
  export const nameToReason = (scope, name) => {
@@ -37,7 +36,7 @@ export const allocBytes = ({ scope, pages }, reason, bytes) => {
37
36
  return allocs.get(reason);
38
37
  }
39
38
 
40
- let bin = bins.find(x => (PageSize - x.used) >= bytes);
39
+ let bin = bins.find(x => (pageSize - x.used) >= bytes);
41
40
  if (!bin) {
42
41
  // new bin
43
42
  const page = pages.size;
@@ -1,6 +1,6 @@
1
1
  import * as PrecompiledBuiltins from './builtins_precompiled.js';
2
2
  import ObjectBuiltins from './builtins_objects.js';
3
- import { Blocktype, Opcodes, Valtype, ValtypeSize } from './wasmSpec.js';
3
+ import { PageSize, Blocktype, Opcodes, Valtype } from './wasmSpec.js';
4
4
  import { TYPES, TYPE_NAMES } from './types.js';
5
5
  import { number, unsignedLEB128 } from './encoding.js';
6
6
  import './prefs.js';
@@ -778,7 +778,7 @@ export const BuiltinFuncs = function() {
778
778
  wasm: [
779
779
  number(1, Valtype.i32),
780
780
  [ Opcodes.memory_grow, 0 ],
781
- number(pageSize, Valtype.i32),
781
+ number(PageSize, Valtype.i32),
782
782
  [ Opcodes.i32_mul ]
783
783
  ]
784
784
  },
@@ -787,23 +787,23 @@ export const BuiltinFuncs = function() {
787
787
  locals: [],
788
788
  globals: [ Valtype.i32, Valtype.i32 ],
789
789
  globalNames: [ 'chunkPtr', 'chunkOffset' ],
790
- globalInits: [ 0, 100 * pageSize ],
790
+ globalInits: [ 0, 100 * PageSize ],
791
791
  returns: [ Valtype.i32 ],
792
792
  returnType: TYPES.number,
793
793
  wasm: [
794
794
  // if chunkOffset >= chunks:
795
795
  [ Opcodes.global_get, 1 ],
796
- number(pageSize * (Prefs.allocatorChunks ?? 16), Valtype.i32),
796
+ number(PageSize * (Prefs.allocatorChunks ?? 16), Valtype.i32),
797
797
  [ Opcodes.i32_ge_s ],
798
798
  [ Opcodes.if, Valtype.i32 ],
799
799
  // chunkOffset = 1 page
800
- number(1 * pageSize, Valtype.i32),
800
+ number(pageSize, Valtype.i32),
801
801
  [ Opcodes.global_set, 1 ],
802
802
 
803
803
  // return chunkPtr = allocated
804
804
  number(Prefs.allocatorChunks ?? 16, Valtype.i32),
805
805
  [ Opcodes.memory_grow, 0 ],
806
- number(pageSize, Valtype.i32),
806
+ number(PageSize, Valtype.i32),
807
807
  [ Opcodes.i32_mul ],
808
808
  [ Opcodes.global_set, 0 ],
809
809
  [ Opcodes.global_get, 0 ],
@@ -1,4 +1,4 @@
1
- import { Blocktype, Opcodes, PageSize, Valtype } from './wasmSpec.js';
1
+ import { Blocktype, Opcodes, Valtype } from './wasmSpec.js';
2
2
  import { TYPES } from './types.js';
3
3
  import { number } from './encoding.js';
4
4
 
@@ -7,7 +7,7 @@ wasm:(_,{makeString,glbl,builtin})=>[[32,1],[184],[34,2],[68,7],[97],[4,64],[32,
7
7
  params:[124,127],typedParams:1,returns:[124,127],
8
8
  locals:[124,124,124,124,124,124,124,124,124,124,124,127,124,124,127,124,124,124,127,124,124,124,124,124],localNames:["obj","obj#type","t","idx","underlying","proto","key1","key2","key3","key4","len","key5","i","#last_type","#member_obj_0","#member_prop_0","#loadArray_offset","key6","#member_obj_1","#member_prop_1","#member_allocd","key7","#member_obj_2","#member_prop_2","#member_obj_3","#member_prop_3"],
9
9
  usedTypes:[7,80,195,67],
10
- globalInits:{underlyingKeys:(_,{allocPage,glbl})=>[number(allocPage(_,'__internal_object.ts/underlyingKeys'),124),...glbl(36,'underlyingKeys',124),[65,16],[26]],underlyingVals:(_,{allocPage,glbl})=>[number(allocPage(_,'__internal_object.ts/underlyingVals'),124),...glbl(36,'underlyingVals',124),[65,128,128,4],[26]]},
10
+ globalInits:{underlyingKeys:(_,{allocPage,glbl})=>[number(allocPage(_,'__internal_object.ts/underlyingKeys'),124),...glbl(36,'underlyingKeys',124),[65,16],[26]],underlyingVals:(_,{allocPage,glbl})=>[number(allocPage(_,'__internal_object.ts/underlyingVals'),124),...glbl(36,'underlyingVals',124),[65,128,128,1],[26]]},
11
11
  }
12
12
  this.__Porffor_strcmp = {
13
13
  wasm:()=>[[32,0],[32,2],[70],[4,64],[65,1],[15],[26],[11],[32,0],[40,0,0],[33,4],[32,2],[40,0,0],[33,5],[32,4],[32,5],[71],[4,64],[65,0],[15],[26],[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],[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],[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],[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],[15],[26],[11],[11],[65,1],[15],[26],[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],[15],[26],[11],[32,10],[65,1],[106],[33,10],[12,1],[11],[11],[65,1],[15],[26],[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],[15],[26],[11],[32,10],[65,1],[106],[33,10],[12,1],[11],[11],[65,1],[15],[26],[5],[32,4],[65,2],[108],[33,4],[32,5],[65,2],[108],[33,5],[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],[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],[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],[15],[11],[32,4],[65,2],[107],[34,4],[65,2],[78],[13,0],[11],[11],[65,1],[15],[26],[11],[11],[65,0],[15]],
@@ -745,7 +745,7 @@ params:[124,127],typedParams:1,returns:[124],returnType:1,
745
745
  locals:[124,124,124,124,124],localNames:["x","x#type","negative","len","out","i","d"],
746
746
  }
747
747
  this.__Porffor_bigint_fromString = {
748
- wasm:(_,{t,makeString,builtin,internalThrow})=>[[32,0],[252,3],[40,1,0],[184],[33,2],[68,0],[33,3],[68,0],[33,4],[68,0],[33,6],[32,0],[33,5],[32,1],[33,8],[2,124],...t([67],()=>[[32,8],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,6],[252,3],[65,2],[108],[32,5],[252,3],[106],[47,0,4],[59,0,4],[32,9],[184],[65,195,0],[33,7],[12,1],[11]]),...t([80],()=>[[32,8],[65,208,0],[70],[4,64],[32,6],[252,3],[65,9],[108],[32,5],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[12,1],[11]]),...t([88],()=>[[32,8],[65,216,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([89],()=>[[32,8],[65,217,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([90],()=>[[32,8],[65,218,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([91],()=>[[32,8],[65,219,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([92],()=>[[32,8],[65,220,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([93],()=>[[32,8],[65,221,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([94],()=>[[32,8],[65,222,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([95],()=>[[32,8],[65,223,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11]]),...t([96],()=>[[32,8],[65,224,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11]]),...t([128],()=>[[32,8],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,8],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,6],[252,3],[32,5],[252,3],[106],[45,0,4],[58,0,4],[32,9],[184],[65,195,1],[33,7],[12,1],[11]]),[32,5],[252,2],[32,1],[32,6],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,11],[252,2],[32,11],[16,builtin('__Porffor_object_get')],[33,7],[11],[32,7],...makeString(_,"-",1),[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[68,1],[33,3],[68,1],[33,4],[5],[68,0],[33,13],[32,0],[33,12],[32,1],[33,8],[2,124],...t([67],()=>[[32,8],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,13],[252,3],[65,2],[108],[32,12],[252,3],[106],[47,0,4],[59,0,4],[32,9],[184],[65,195,0],[33,7],[12,1],[11]]),...t([80],()=>[[32,8],[65,208,0],[70],[4,64],[32,13],[252,3],[65,9],[108],[32,12],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[12,1],[11]]),...t([88],()=>[[32,8],[65,216,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([89],()=>[[32,8],[65,217,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([90],()=>[[32,8],[65,218,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([91],()=>[[32,8],[65,219,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([92],()=>[[32,8],[65,220,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([93],()=>[[32,8],[65,221,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([94],()=>[[32,8],[65,222,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([95],()=>[[32,8],[65,223,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11]]),...t([96],()=>[[32,8],[65,224,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11]]),...t([128],()=>[[32,8],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,8],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,13],[252,3],[32,12],[252,3],[106],[45,0,4],[58,0,4],[32,9],[184],[65,195,1],[33,7],[12,1],[11]]),[32,12],[252,2],[32,1],[32,13],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,11],[252,2],[32,11],[16,builtin('__Porffor_object_get')],[33,7],[11],[32,7],...makeString(_,"+",1),[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[68,1],[33,4],[11],[11],[68,4294967296],[33,14],[16,builtin('__Porffor_allocate')],[183],[34,15],[252,3],[32,2],[32,4],[161],[252,3],[54,1,0],[68,0],[33,16],[68,0],[33,17],[3,64],[32,16],[32,2],[99],[4,64],[32,0],[252,3],[40,1,0],[33,19],[32,1],[33,8],[2,124],...t([39],()=>[[32,8],[65,39],[70],[4,64],[65,1],[33,7],[32,4],[32,16],[160],[252,2],[65,2],[108],[32,0],[252,3],[106],[47,0,4],[184],[12,1],[11]]),...t([67],()=>[[32,8],[65,195,0],[70],[4,64],[65,1],[33,7],[32,4],[32,16],[160],[252,2],[65,2],[108],[32,0],[252,3],[106],[47,0,4],[184],[12,1],[11]]),...t([195],()=>[[32,8],[65,195,1],[70],[4,64],[65,1],[33,7],[32,4],[32,16],[160],[252,2],[32,0],[252,3],[106],[45,0,4],[184],[12,1],[11]]),...internalThrow(_,'TypeError',`'charCodeAt' proto func tried to be called on a type without an impl`),[68,0],[11],[34,18],[68,48],[161],[34,22],[68,0],[99],[32,22],[68,9],[100],[114],[4,64],...internalThrow(_,'SyntaxError',`Invalid character in BigInt string`),[26],[11],[32,15],[33,24],[32,16],[32,16],[68,1],[160],[33,16],[33,25],[32,24],[252,3],[32,25],[252,3],[65,9],[108],[106],[34,23],[32,22],[57,0,4],[32,23],[65,1],[58,0,12],[32,17],[68,10],[162],[32,22],[160],[33,17],[12,1],[11],[11],[32,17],[68,2251799813685248],[99],[4,64],[32,17],[15],[26],[11],[16,builtin('__Porffor_allocate')],[183],[33,26],[3,64],[32,15],[252,3],[40,1,0],[184],[68,0],[100],[4,64],[68,0],[33,27],[68,0],[33,28],[3,64],[32,28],[32,15],[252,3],[40,1,0],[184],[99],[4,64],[32,27],[68,10],[162],[32,28],[33,31],[32,15],[33,30],[32,31],[252,3],[65,9],[108],[32,30],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[160],[34,29],[32,14],[163],[16,builtin('__Math_floor')],[33,32],[32,29],[32,14],[16,builtin('f64_%')],[33,27],[32,15],[33,33],[32,28],[33,34],[32,33],[252,3],[32,34],[252,3],[65,9],[108],[106],[34,23],[32,32],[57,0,4],[32,23],[65,1],[58,0,12],[32,28],[68,1],[160],[33,28],[12,1],[11],[11],[3,64],[32,15],[252,3],[40,1,0],[184],[68,0],[100],[34,37],[4,127],[68,0],[33,36],[32,15],[33,35],[32,36],[252,3],[65,9],[108],[32,35],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[68,0],[97],[32,7],[65,128,1],[114],[65,1],[65,128,1],[114],[70],[113],[65,2],[33,7],[5],[32,37],[65,2],[33,7],[11],[4,64],[32,15],[252,3],[34,20],[40,1,0],[33,19],[2,64],[32,19],[69],[4,64],[68,0],[65,128,1],[33,7],[12,1],[11],[32,20],[32,19],[65,1],[107],[34,19],[54,1,0],[32,20],[43,0,4],[32,20],[45,0,12],[33,7],[65,4],[32,20],[106],[65,13],[32,20],[106],[32,19],[65,9],[108],[252,10,0,0],[26],[11],[12,1],[11],[11],[32,27],[68,0],[98],[34,37],[69],[4,127],[32,15],[252,3],[40,1,0],[184],[68,0],[100],[65,2],[33,7],[5],[32,37],[65,2],[33,7],[11],[4,64],[32,26],[33,38],[65,208,0],[33,39],[32,38],[32,39],[65,128,128,4],[32,27],[57,0,4],[65,128,128,4],[65,1],[58,0,12],[65,128,128,4],[65,1],[54,1,0],[68,65536],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,7],[26],[11],[12,1],[11],[11],[32,3],[65,2],[32,26],[65,208,0],[16,builtin('__Porffor_bigint_fromDigits')],[15]],
748
+ wasm:(_,{t,makeString,builtin,internalThrow})=>[[32,0],[252,3],[40,1,0],[184],[33,2],[68,0],[33,3],[68,0],[33,4],[68,0],[33,6],[32,0],[33,5],[32,1],[33,8],[2,124],...t([67],()=>[[32,8],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,6],[252,3],[65,2],[108],[32,5],[252,3],[106],[47,0,4],[59,0,4],[32,9],[184],[65,195,0],[33,7],[12,1],[11]]),...t([80],()=>[[32,8],[65,208,0],[70],[4,64],[32,6],[252,3],[65,9],[108],[32,5],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[12,1],[11]]),...t([88],()=>[[32,8],[65,216,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([89],()=>[[32,8],[65,217,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([90],()=>[[32,8],[65,218,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([91],()=>[[32,8],[65,219,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([92],()=>[[32,8],[65,220,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([93],()=>[[32,8],[65,221,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([94],()=>[[32,8],[65,222,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([95],()=>[[32,8],[65,223,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11]]),...t([96],()=>[[32,8],[65,224,0],[70],[4,64],[32,5],[252,3],[40,0,4],[32,6],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11]]),...t([128],()=>[[32,8],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,8],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,6],[252,3],[32,5],[252,3],[106],[45,0,4],[58,0,4],[32,9],[184],[65,195,1],[33,7],[12,1],[11]]),[32,5],[252,2],[32,1],[32,6],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,11],[252,2],[32,11],[16,builtin('__Porffor_object_get')],[33,7],[11],[32,7],...makeString(_,"-",1),[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[68,1],[33,3],[68,1],[33,4],[5],[68,0],[33,13],[32,0],[33,12],[32,1],[33,8],[2,124],...t([67],()=>[[32,8],[65,195,0],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,13],[252,3],[65,2],[108],[32,12],[252,3],[106],[47,0,4],[59,0,4],[32,9],[184],[65,195,0],[33,7],[12,1],[11]]),...t([80],()=>[[32,8],[65,208,0],[70],[4,64],[32,13],[252,3],[65,9],[108],[32,12],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[12,1],[11]]),...t([88],()=>[[32,8],[65,216,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([89],()=>[[32,8],[65,217,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[44,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([90],()=>[[32,8],[65,218,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[106],[45,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([91],()=>[[32,8],[65,219,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([92],()=>[[32,8],[65,220,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([93],()=>[[32,8],[65,221,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,7],[12,1],[11]]),...t([94],()=>[[32,8],[65,222,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,7],[12,1],[11]]),...t([95],()=>[[32,8],[65,223,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,7],[12,1],[11]]),...t([96],()=>[[32,8],[65,224,0],[70],[4,64],[32,12],[252,3],[40,0,4],[32,13],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,7],[12,1],[11]]),...t([128],()=>[[32,8],[65,128,1],[70],[4,64],...internalThrow(_,'TypeError',`Cannot read property of undefined`),[68,0],[12,1],[11]]),...t([195],()=>[[32,8],[65,195,1],[70],[4,64],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,9],[65,1],[54,0,0],[32,9],[32,13],[252,3],[32,12],[252,3],[106],[45,0,4],[58,0,4],[32,9],[184],[65,195,1],[33,7],[12,1],[11]]),[32,12],[252,2],[32,1],[32,13],[65,1],[16,builtin('__ecma262_ToPropertyKey')],[33,11],[252,2],[32,11],[16,builtin('__Porffor_object_get')],[33,7],[11],[32,7],...makeString(_,"+",1),[65,195,1],[16,builtin('__Porffor_compareStrings')],[252,3],[4,64],[68,1],[33,4],[11],[11],[68,4294967296],[33,14],[16,builtin('__Porffor_allocate')],[183],[34,15],[252,3],[32,2],[32,4],[161],[252,3],[54,1,0],[68,0],[33,16],[68,0],[33,17],[3,64],[32,16],[32,2],[99],[4,64],[32,0],[252,3],[40,1,0],[33,19],[32,1],[33,8],[2,124],...t([39],()=>[[32,8],[65,39],[70],[4,64],[65,1],[33,7],[32,4],[32,16],[160],[252,2],[65,2],[108],[32,0],[252,3],[106],[47,0,4],[184],[12,1],[11]]),...t([67],()=>[[32,8],[65,195,0],[70],[4,64],[65,1],[33,7],[32,4],[32,16],[160],[252,2],[65,2],[108],[32,0],[252,3],[106],[47,0,4],[184],[12,1],[11]]),...t([195],()=>[[32,8],[65,195,1],[70],[4,64],[65,1],[33,7],[32,4],[32,16],[160],[252,2],[32,0],[252,3],[106],[45,0,4],[184],[12,1],[11]]),...internalThrow(_,'TypeError',`'charCodeAt' proto func tried to be called on a type without an impl`),[68,0],[11],[34,18],[68,48],[161],[34,22],[68,0],[99],[32,22],[68,9],[100],[114],[4,64],...internalThrow(_,'SyntaxError',`Invalid character in BigInt string`),[26],[11],[32,15],[33,24],[32,16],[32,16],[68,1],[160],[33,16],[33,25],[32,24],[252,3],[32,25],[252,3],[65,9],[108],[106],[34,23],[32,22],[57,0,4],[32,23],[65,1],[58,0,12],[32,17],[68,10],[162],[32,22],[160],[33,17],[12,1],[11],[11],[32,17],[68,2251799813685248],[99],[4,64],[32,17],[15],[26],[11],[16,builtin('__Porffor_allocate')],[183],[33,26],[3,64],[32,15],[252,3],[40,1,0],[184],[68,0],[100],[4,64],[68,0],[33,27],[68,0],[33,28],[3,64],[32,28],[32,15],[252,3],[40,1,0],[184],[99],[4,64],[32,27],[68,10],[162],[32,28],[33,31],[32,15],[33,30],[32,31],[252,3],[65,9],[108],[32,30],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[160],[34,29],[32,14],[163],[16,builtin('__Math_floor')],[33,32],[32,29],[32,14],[16,builtin('f64_%')],[33,27],[32,15],[33,33],[32,28],[33,34],[32,33],[252,3],[32,34],[252,3],[65,9],[108],[106],[34,23],[32,32],[57,0,4],[32,23],[65,1],[58,0,12],[32,28],[68,1],[160],[33,28],[12,1],[11],[11],[3,64],[32,15],[252,3],[40,1,0],[184],[68,0],[100],[34,37],[4,127],[68,0],[33,36],[32,15],[33,35],[32,36],[252,3],[65,9],[108],[32,35],[252,3],[106],[34,10],[43,0,4],[32,10],[45,0,12],[33,7],[68,0],[97],[32,7],[65,128,1],[114],[65,1],[65,128,1],[114],[70],[113],[65,2],[33,7],[5],[32,37],[65,2],[33,7],[11],[4,64],[32,15],[252,3],[34,20],[40,1,0],[33,19],[2,64],[32,19],[69],[4,64],[68,0],[65,128,1],[33,7],[12,1],[11],[32,20],[32,19],[65,1],[107],[34,19],[54,1,0],[32,20],[43,0,4],[32,20],[45,0,12],[33,7],[65,4],[32,20],[106],[65,13],[32,20],[106],[32,19],[65,9],[108],[252,10,0,0],[26],[11],[12,1],[11],[11],[32,27],[68,0],[98],[34,37],[69],[4,127],[32,15],[252,3],[40,1,0],[184],[68,0],[100],[65,2],[33,7],[5],[32,37],[65,2],[33,7],[11],[4,64],[32,26],[33,38],[65,208,0],[33,39],[32,38],[32,39],[65,128,128,1],[32,27],[57,0,4],[65,128,128,1],[65,1],[58,0,12],[65,128,128,1],[65,1],[54,1,0],[68,16384],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,7],[26],[11],[12,1],[11],[11],[32,3],[65,2],[32,26],[65,208,0],[16,builtin('__Porffor_bigint_fromDigits')],[15]],
749
749
  params:[124,127],typedParams:1,returns:[124],returnType:4,
750
750
  locals:[124,124,124,124,124,127,127,127,127,127,124,124,124,124,124,124,124,127,127,127,124,127,124,124,124,124,124,124,124,124,124,124,124,124,124,127,124,127],localNames:["n","n#type","len","negative","offset","#member_obj_86","#member_prop_86","#last_type","#typeswitch_tmp1","#member_allocd","#loadArray_offset","#swap","#member_obj_87","#member_prop_87","BASE","digits","i","acc","char","__proto_length_cache","__proto_pointer_cache","__charCodeAt_tmp","digit","#member_setter_ptr_tmp","#member_obj_88","#member_prop_88","result","carry","j","value","#member_obj_89","#member_prop_89","quotient","#member_obj_90","#member_prop_90","#member_obj_91","#member_prop_91","logictmpi","#proto_target","#proto_target#type"],
751
751
  usedTypes:[67,195,80],
@@ -757,7 +757,7 @@ params:[124,127,124,127],typedParams:1,returns:[124,127],
757
757
  locals:[127],localNames:["x","x#type","radix","radix#type","#last_type"],
758
758
  }
759
759
  this.__Porffor_bigint_add = {
760
- wasm:(_,{builtin})=>[[32,0],[16,builtin('__Math_abs')],[68,2251799813685248],[99],[4,64],[32,2],[16,builtin('__Math_abs')],[68,2251799813685248],[99],[4,64],[32,4],[252,3],[4,64],[32,2],[154],[33,2],[11],[32,0],[32,2],[160],[16,builtin('__Math_trunc')],[65,1],[16,builtin('__Porffor_bigint_fromNumber')],[15],[26],[11],[32,0],[65,1],[16,builtin('__Porffor_bigint_inlineToDigitForm')],[33,0],[5],[32,2],[16,builtin('__Math_abs')],[68,2251799813685248],[99],[4,64],[32,2],[65,1],[16,builtin('__Porffor_bigint_inlineToDigitForm')],[33,2],[11],[11],[32,0],[68,2251799813685248],[161],[33,0],[32,2],[68,2251799813685248],[161],[33,2],[32,0],[252,2],[45,0,0],[183],[68,0],[98],[184],[33,6],[32,0],[252,2],[47,0,2],[183],[33,7],[32,2],[252,2],[45,0,0],[183],[68,0],[98],[184],[33,8],[32,4],[252,3],[4,64],[32,8],[68,0],[97],[184],[33,8],[11],[32,2],[252,2],[47,0,2],[183],[33,9],[68,"-Infinity"],[32,7],[165],[32,9],[165],[33,10],[16,builtin('__Porffor_allocate')],[183],[33,11],[68,0],[33,12],[68,0],[33,13],[32,6],[32,8],[97],[4,64],[32,6],[33,12],[68,0],[33,14],[3,64],[32,14],[32,10],[99],[4,64],[68,0],[33,15],[32,7],[32,14],[161],[34,16],[68,0],[100],[4,64],[32,0],[32,16],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,15],[11],[68,0],[33,17],[32,9],[32,14],[161],[34,18],[68,0],[100],[4,64],[32,2],[32,18],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,17],[11],[32,15],[32,17],[160],[32,13],[160],[34,19],[68,4294967296],[102],[4,64],[32,19],[68,4294967296],[161],[33,19],[68,1],[33,13],[5],[32,19],[68,0],[99],[4,64],[32,19],[68,4294967296],[160],[33,19],[68,1],[33,13],[5],[68,0],[33,13],[11],[11],[32,11],[33,20],[65,208,0],[33,21],[32,20],[32,21],[65,128,128,8],[32,19],[57,0,4],[65,128,128,8],[65,1],[58,0,12],[65,128,128,8],[65,1],[54,1,0],[68,131072],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,22],[26],[32,14],[68,1],[160],[33,14],[12,1],[11],[11],[5],[68,0],[33,23],[68,0],[33,14],[3,64],[32,14],[32,10],[99],[4,64],[68,0],[33,15],[32,7],[32,14],[161],[34,16],[68,0],[100],[4,64],[32,0],[32,16],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,15],[11],[68,0],[33,17],[32,9],[32,14],[161],[34,18],[68,0],[100],[4,64],[32,2],[32,18],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,17],[11],[32,13],[33,19],[32,6],[252,3],[4,64],[32,19],[32,15],[161],[33,19],[5],[32,19],[32,15],[160],[33,19],[11],[32,8],[252,3],[4,64],[32,19],[32,17],[161],[33,19],[5],[32,19],[32,17],[160],[33,19],[11],[32,15],[32,17],[98],[4,64],[32,15],[32,17],[100],[4,124],[68,1],[65,1],[33,22],[5],[68,-1],[65,1],[33,22],[11],[33,23],[11],[32,19],[68,4294967296],[102],[4,64],[32,19],[68,4294967296],[161],[33,19],[68,1],[33,13],[5],[32,19],[68,0],[99],[4,64],[32,19],[68,4294967296],[160],[33,19],[68,-1],[33,13],[5],[68,0],[33,13],[11],[11],[32,11],[33,20],[65,208,0],[33,21],[32,20],[32,21],[65,128,128,12],[32,19],[57,0,4],[65,128,128,12],[65,1],[58,0,12],[65,128,128,12],[65,1],[54,1,0],[68,196608],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,22],[26],[32,14],[68,1],[160],[33,14],[12,1],[11],[11],[32,23],[68,1],[97],[4,64],[32,6],[33,12],[5],[32,23],[68,-1],[97],[4,64],[32,8],[33,12],[11],[11],[11],[32,13],[68,0],[98],[4,64],[32,11],[33,20],[65,208,0],[33,21],[32,20],[32,21],[65,128,128,16],[32,13],[16,builtin('__Math_abs')],[57,0,4],[65,128,128,16],[65,1],[58,0,12],[65,128,128,16],[65,1],[54,1,0],[68,262144],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,22],[26],[32,13],[68,0],[99],[4,64],[32,12],[68,0],[97],[184],[33,12],[11],[11],[32,12],[65,2],[32,11],[65,208,0],[16,builtin('__Porffor_bigint_fromDigits')],[15]],
760
+ wasm:(_,{builtin})=>[[32,0],[16,builtin('__Math_abs')],[68,2251799813685248],[99],[4,64],[32,2],[16,builtin('__Math_abs')],[68,2251799813685248],[99],[4,64],[32,4],[252,3],[4,64],[32,2],[154],[33,2],[11],[32,0],[32,2],[160],[16,builtin('__Math_trunc')],[65,1],[16,builtin('__Porffor_bigint_fromNumber')],[15],[26],[11],[32,0],[65,1],[16,builtin('__Porffor_bigint_inlineToDigitForm')],[33,0],[5],[32,2],[16,builtin('__Math_abs')],[68,2251799813685248],[99],[4,64],[32,2],[65,1],[16,builtin('__Porffor_bigint_inlineToDigitForm')],[33,2],[11],[11],[32,0],[68,2251799813685248],[161],[33,0],[32,2],[68,2251799813685248],[161],[33,2],[32,0],[252,2],[45,0,0],[183],[68,0],[98],[184],[33,6],[32,0],[252,2],[47,0,2],[183],[33,7],[32,2],[252,2],[45,0,0],[183],[68,0],[98],[184],[33,8],[32,4],[252,3],[4,64],[32,8],[68,0],[97],[184],[33,8],[11],[32,2],[252,2],[47,0,2],[183],[33,9],[68,"-Infinity"],[32,7],[165],[32,9],[165],[33,10],[16,builtin('__Porffor_allocate')],[183],[33,11],[68,0],[33,12],[68,0],[33,13],[32,6],[32,8],[97],[4,64],[32,6],[33,12],[68,0],[33,14],[3,64],[32,14],[32,10],[99],[4,64],[68,0],[33,15],[32,7],[32,14],[161],[34,16],[68,0],[100],[4,64],[32,0],[32,16],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,15],[11],[68,0],[33,17],[32,9],[32,14],[161],[34,18],[68,0],[100],[4,64],[32,2],[32,18],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,17],[11],[32,15],[32,17],[160],[32,13],[160],[34,19],[68,4294967296],[102],[4,64],[32,19],[68,4294967296],[161],[33,19],[68,1],[33,13],[5],[32,19],[68,0],[99],[4,64],[32,19],[68,4294967296],[160],[33,19],[68,1],[33,13],[5],[68,0],[33,13],[11],[11],[32,11],[33,20],[65,208,0],[33,21],[32,20],[32,21],[65,128,128,2],[32,19],[57,0,4],[65,128,128,2],[65,1],[58,0,12],[65,128,128,2],[65,1],[54,1,0],[68,32768],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,22],[26],[32,14],[68,1],[160],[33,14],[12,1],[11],[11],[5],[68,0],[33,23],[68,0],[33,14],[3,64],[32,14],[32,10],[99],[4,64],[68,0],[33,15],[32,7],[32,14],[161],[34,16],[68,0],[100],[4,64],[32,0],[32,16],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,15],[11],[68,0],[33,17],[32,9],[32,14],[161],[34,18],[68,0],[100],[4,64],[32,2],[32,18],[68,4],[162],[160],[252,2],[40,0,0],[183],[33,17],[11],[32,13],[33,19],[32,6],[252,3],[4,64],[32,19],[32,15],[161],[33,19],[5],[32,19],[32,15],[160],[33,19],[11],[32,8],[252,3],[4,64],[32,19],[32,17],[161],[33,19],[5],[32,19],[32,17],[160],[33,19],[11],[32,15],[32,17],[98],[4,64],[32,15],[32,17],[100],[4,124],[68,1],[65,1],[33,22],[5],[68,-1],[65,1],[33,22],[11],[33,23],[11],[32,19],[68,4294967296],[102],[4,64],[32,19],[68,4294967296],[161],[33,19],[68,1],[33,13],[5],[32,19],[68,0],[99],[4,64],[32,19],[68,4294967296],[160],[33,19],[68,-1],[33,13],[5],[68,0],[33,13],[11],[11],[32,11],[33,20],[65,208,0],[33,21],[32,20],[32,21],[65,128,128,3],[32,19],[57,0,4],[65,128,128,3],[65,1],[58,0,12],[65,128,128,3],[65,1],[54,1,0],[68,49152],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,22],[26],[32,14],[68,1],[160],[33,14],[12,1],[11],[11],[32,23],[68,1],[97],[4,64],[32,6],[33,12],[5],[32,23],[68,-1],[97],[4,64],[32,8],[33,12],[11],[11],[11],[32,13],[68,0],[98],[4,64],[32,11],[33,20],[65,208,0],[33,21],[32,20],[32,21],[65,128,128,4],[32,13],[16,builtin('__Math_abs')],[57,0,4],[65,128,128,4],[65,1],[58,0,12],[65,128,128,4],[65,1],[54,1,0],[68,65536],[65,208,0],[16,builtin('__Array_prototype_unshift')],[33,22],[26],[32,13],[68,0],[99],[4,64],[32,12],[68,0],[97],[184],[33,12],[11],[11],[32,12],[65,2],[32,11],[65,208,0],[16,builtin('__Porffor_bigint_fromDigits')],[15]],
761
761
  params:[124,127,124,127,124,127],typedParams:1,returns:[124],returnType:4,
762
762
  locals:[124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,127,127,124],localNames:["a","a#type","b","b#type","sub","sub#type","aNegative","aLen","bNegative","bLen","maxLen","digits","negative","carry","i","aDigit","aOffset","bDigit","bOffset","sum","#proto_target","#proto_target#type","#last_type","aLarger"],
763
763
  usedTypes:[80],
@@ -2449,14 +2449,16 @@ globalInits:{jobQueue:(_,{allocPage,glbl})=>[number(allocPage(_,'promise.ts/jobQ
2449
2449
  table:1,usesTag:1,
2450
2450
  }
2451
2451
  this.__Porffor_promise_resolveActive = {
2452
- wasm:()=>[[15]],
2452
+ wasm:(_,{glbl,builtin})=>[[32,0],[32,1],...glbl(35,'activePromise',124),...glbl(35,'activePromise#type',127),[16,builtin('__Porffor_promise_resolve')],[68,0],[15]],
2453
2453
  params:[124,127],typedParams:1,returns:[],returnType:128,
2454
2454
  locals:[],localNames:["value","value#type"],
2455
+ globalInits:{jobQueue:(_,{allocPage,glbl})=>[number(allocPage(_,'promise.ts/jobQueue'),124),...glbl(36,'jobQueue',124),[65,16],[26]]},
2455
2456
  }
2456
2457
  this.__Porffor_promise_rejectActive = {
2457
- wasm:()=>[[15]],
2458
+ wasm:(_,{glbl,builtin})=>[[32,0],[32,1],...glbl(35,'activePromise',124),...glbl(35,'activePromise#type',127),[16,builtin('__Porffor_promise_reject')],[68,0],[15]],
2458
2459
  params:[124,127],typedParams:1,returns:[],returnType:128,
2459
2460
  locals:[],localNames:["reason","reason#type"],
2461
+ globalInits:{jobQueue:(_,{allocPage,glbl})=>[number(allocPage(_,'promise.ts/jobQueue'),124),...glbl(36,'jobQueue',124),[65,16],[26]]},
2460
2462
  }
2461
2463
  this.Promise = {
2462
2464
  wasm:(_,{t,glbl,builtin,funcRef,internalThrow})=>[[32,0],[33,6],[32,1],[33,7],[2,124],...t([67,195],()=>[[32,7],[65,195,0],[70],[32,7],[65,195,1],[70],[114],[4,64],[32,6],[252,3],[40,1,0],[69],[184],[12,1],[11]]),[32,6],[68,0],[97],[184],[11],[252,3],[4,64],...internalThrow(_,'TypeError',`Constructor Promise requires 'new'`),[26],[11],[32,5],[184],[68,6],[98],[4,64],...internalThrow(_,'TypeError',`Promise executor is not a function`),[26],[11],[16,builtin('__Porffor_promise_create')],[34,8],...glbl(36,'activePromise',124),[65,208,0],...glbl(36,'activePromise#type',127),[6,64],[32,4],[33,9],[32,5],[33,7],[2,124],...t([6],()=>[[32,7],[65,6],[70],[4,64],[68,0],[65,128,1],[68,0],[65,128,1],...funcRef('__Porffor_promise_resolveActive'),[65,6],...funcRef('__Porffor_promise_rejectActive'),[65,6],[68,0],[65,128,1],[68,0],[65,128,1],[68,0],[65,128,1],[68,0],[65,128,1],[68,0],[65,128,1],[68,0],[65,128,1],[68,0],[65,128,1],[68,0],[65,128,1],[32,9],[252,3],[17,12,0],[26],[12,1],[11]]),...internalThrow(_,'TypeError',`executor is not a function`),[68,0],[11],[26],[7,0],[33,12],[34,11],[33,13],[32,12],[33,14],[32,8],[65,208,0],[32,13],[32,14],[16,builtin('__ecma262_RejectPromise')],[11],[32,8],[15]],
@@ -588,6 +588,7 @@ const generateReturn = (scope, decl) => {
588
588
  }
589
589
 
590
590
  if (scope.returns.length === 0) return [
591
+ ...(arg.type !== 'Identifier' ? generate(scope, arg) : []),
591
592
  [ Opcodes.return ]
592
593
  ];
593
594
 
@@ -596,6 +597,27 @@ const generateReturn = (scope, decl) => {
596
597
  !globalThis.precompile // skip in precompiled built-ins, we should not require this and handle it ourselves
597
598
  ) {
598
599
  // perform return value checks for constructors and (sub)classes
600
+
601
+ // just return this if `return undefined` or `return this`
602
+ if ((arg.type === 'Identifier' && arg.name === 'undefined') || (arg.type === 'ThisExpression')) {
603
+ return [
604
+ ...(scope._onlyConstr ? [] : [
605
+ [ Opcodes.local_get, scope.locals['#newtarget'].idx ],
606
+ Opcodes.i32_to_u,
607
+ [ Opcodes.if, Blocktype.void ]
608
+ ]),
609
+ [ Opcodes.local_get, scope.locals['#this'].idx ],
610
+ ...(scope.returnType != null ? [] : [ [ Opcodes.local_get, scope.locals['#this#type'].idx ] ]),
611
+ [ Opcodes.return ],
612
+ ...(scope._onlyConstr ? [] : [
613
+ [ Opcodes.end ],
614
+ ...generate(scope, arg),
615
+ ...(scope.returnType != null ? [] : getNodeType(scope, arg)),
616
+ [ Opcodes.return ],
617
+ ])
618
+ ];
619
+ }
620
+
599
621
  return [
600
622
  ...generate(scope, arg),
601
623
  [ Opcodes.local_set, localTmp(scope, '#return') ],
@@ -3545,7 +3567,7 @@ const coctcOffset = prop => {
3545
3567
 
3546
3568
  let offset = coctc.get(prop);
3547
3569
  if (offset == null) {
3548
- offset = (coctc.lastOffset ?? 60000) - 9;
3570
+ offset = (coctc.lastOffset ?? Prefs.coctcOffset ?? 16300) - 9;
3549
3571
  if (offset < 0) return 0;
3550
3572
 
3551
3573
  coctc.lastOffset = offset;
package/compiler/index.js CHANGED
@@ -73,7 +73,8 @@ export default (code, module = undefined) => {
73
73
  globalThis.valtype = Prefs.valtype ?? 'f64';
74
74
  globalThis.valtypeBinary = Valtype[valtype];
75
75
 
76
- globalThis.pageSize = (parseInt(Prefs.valtype) * 1024) || PageSize;
76
+ // use smaller page sizes internally (65536 / 4 = 16384)
77
+ globalThis.pageSize = Prefs.pageSize ?? (PageSize / 4);
77
78
 
78
79
  // change some prefs by default for c/native
79
80
  if (target !== 'wasm') {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "An ahead-of-time JavaScript compiler",
4
- "version": "0.55.24",
4
+ "version": "0.55.26",
5
5
  "author": "Oliver Medhurst <honk@goose.icu>",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/r.cjs CHANGED
@@ -1,9 +1,9 @@
1
- let a = { b: { } };
2
- a.b.foo = () => {};
3
- a.b.bar = function () {};
4
- a.b.baz = function baz() {};
1
+ function foo() {
2
+ return this;
3
+ }
4
+
5
+ console.log(foo());
5
6
 
6
- console.log(a.b);
7
7
  // let x = {};
8
8
  // x.__proto__ = { wow() { console.log(0); } };
9
9
  // Object.defineProperty(x, '__proto__', { value: { wow() { console.log(1); } } });
package/runner/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.55.24';
3
+ globalThis.version = '0.55.26';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
package/runner/repl.js CHANGED
@@ -34,10 +34,9 @@ console.log(`Welcome to \x1B[1m\x1B[35mPorffor\x1B[0m \x1B[2m(${globalThis.versi
34
34
  console.log();
35
35
 
36
36
  let lastMemory, lastPages;
37
- const PageSize = 65536;
38
37
  const memoryToString = mem => {
39
38
  let out = '';
40
- const wasmPages = mem.buffer.byteLength / PageSize;
39
+ const wasmPages = mem.buffer.byteLength / 65536;
41
40
 
42
41
  out += `\x1B[1mallocated ${mem.buffer.byteLength / 1024}KiB\x1B[0m (using ${wasmPages} Wasm page${wasmPages === 1 ? '' : 's'})\n\n`;
43
42