porffor 0.21.0 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Porffor &nbsp;<sup><sub>/ˈpɔrfɔr/ &nbsp;*(poor-for)*</sup></sub>
2
- A from-scratch experimental **AOT** optimizing JS/TS -> Wasm/C engine/compiler/runtime in JS. Not serious/intended for (real) use. (this is a straight forward, honest readme)<br>
3
- Age: ~6 months (very on and off)
2
+ A from-scratch experimental **AOT** optimizing JS/TS -> Wasm/C engine/compiler/runtime in JS. Not serious/intended for (real) use.<br>
3
+
4
+ <img src="https://github.com/CanadaHonk/porffor/assets/19228318/de8ad753-8ce3-4dcd-838e-f4d49452f8f8" alt="Screenshot of terminal showing Porffor running and compiling a hello world" width="60%">
4
5
 
5
6
  ## Design
6
7
  Porffor is a very unique JS engine, due many wildly different approaches. It is seriously limited, but what it can do, it does pretty well. Key differences:
@@ -8,7 +9,7 @@ Porffor is a very unique JS engine, due many wildly different approaches. It is
8
9
  - No constant runtime/preluded code
9
10
  - Least Wasm imports possible (only I/O)
10
11
 
11
- Porffor is primarily built from scratch, the only thing that is not is the parser (using [Acorn](https://github.com/acornjs/acorn)). Binaryen/etc is not used, we make final wasm binaries ourself. You could imagine it as compiling a language which is a sub (some things unsupported) and super (new/custom apis) set of javascript. Not based on any particular spec version, focusing on function/working over spec compliance.
12
+ Porffor is primarily built from scratch, the only thing that is not is the parser (using [Acorn](https://github.com/acornjs/acorn)). Binaryen/etc is not used, we make final wasm binaries ourself. You could imagine it as compiling a language which is a sub (some things unsupported) and super (new/custom apis) set of javascript. Not based on any particular spec version.
12
13
 
13
14
  ## Usage
14
15
  Expect nothing to work! Only very limited JS is currently supported. See files in `bench` for examples.
@@ -218,6 +219,8 @@ Mostly for reducing size. I do not really care about compiler perf/time as long
218
219
  ## Test262
219
220
  Porffor can run Test262 via some hacks/transforms which remove unsupported features whilst still doing the same asserts (eg simpler error messages using literals only). It currently passes >14% (see latest commit desc for latest and details). Use `node test262` to test, it will also show a difference of overall results between the last commit and current results.
220
221
 
222
+ ![image](https://github.com/CanadaHonk/porffor/assets/19228318/5320da7d-e945-4d16-857b-499f3a6c1180)
223
+
221
224
  ## Codebase
222
225
  - `compiler`: contains the compiler itself
223
226
  - `builtins.js`: all built-ins of the engine (spec, custom. vars, funcs)
package/compiler/2c.js CHANGED
@@ -811,7 +811,7 @@ _time_out = _time.tv_nsec / 1000000. + _time.tv_sec * 1000.;`);
811
811
  break;
812
812
  }
813
813
 
814
- log.warning('2c', `unimplemented op: ${invOpcodes[i[0]]} \x1b[90m(${f.name})`);
814
+ // log.warning('2c', `unimplemented op: ${invOpcodes[i[0]]} \x1b[90m(${f.name})`);
815
815
  }
816
816
 
817
817
  lastCond = false;
@@ -192,11 +192,7 @@ export const __Object_assign = (target: any, ...sources: any[]) => {
192
192
 
193
193
  export const __Object_defineProperty = (target: any, prop: any, descriptor: any) => {
194
194
  if (!Porffor.object.isObject(target)) throw new TypeError('Target is a non-object');
195
-
196
- // if (Porffor.rawType(descriptor) < 0x06) {
197
- if (Porffor.rawType(descriptor) != Porffor.TYPES.object) {
198
- throw new TypeError('Descriptor is a non-object');
199
- }
195
+ if (!Porffor.object.isObject(descriptor)) throw new TypeError('Descriptor is a non-object');
200
196
 
201
197
  const p: any = ecma262.ToPropertyKey(prop);
202
198
 
@@ -215,8 +211,12 @@ export const __Object_defineProperty = (target: any, prop: any, descriptor: any)
215
211
 
216
212
  let accessor: boolean = false;
217
213
 
218
- if (get || set) {
219
- if (value || writable) {
214
+ // todo: should check if has attributes not if undefined
215
+ if (get !== undefined || set !== undefined) {
216
+ if (get !== undefined && Porffor.rawType(get) != Porffor.TYPES.function) throw new TypeError('Getter must be a function');
217
+ if (set !== undefined && Porffor.rawType(set) != Porffor.TYPES.function) throw new TypeError('Setter must be a function');
218
+
219
+ if (value !== undefined || writable !== undefined) {
220
220
  throw new TypeError('Descriptor cannot define both accessor and data descriptor attributes');
221
221
  }
222
222
 
@@ -233,6 +233,17 @@ export const __Object_defineProperty = (target: any, prop: any, descriptor: any)
233
233
  return target;
234
234
  };
235
235
 
236
+ export const __Object_defineProperties = (target: any, props: any) => {
237
+ if (!Porffor.object.isObject(target)) throw new TypeError('Target is a non-object');
238
+ if (!Porffor.object.isObjectOrSymbol(props)) throw new TypeError('Props needs to be an object or symbol');
239
+
240
+ for (const x in props) {
241
+ __Object_defineProperty(target, x, props[x]);
242
+ }
243
+
244
+ return target;
245
+ };
246
+
236
247
 
237
248
  export const __Object_prototype_propertyIsEnumerable = (_this: any, prop: any) => {
238
249
  const p: any = ecma262.ToPropertyKey(prop);
@@ -1690,10 +1690,16 @@ export const BuiltinFuncs = function() {
1690
1690
  hasRestArgument: 1,
1691
1691
  };
1692
1692
  this.__Object_defineProperty = {
1693
- wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,2],[32,1],[16, ...builtin('__Porffor_object_isObject')],[33,6],[183],[33,7],[32,6],[33,8],[2,124],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,7],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Target is a non-object`),[11],[32,4],[32,5],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,28,64],[98],[4,64],...internalThrow(scope, 'TypeError', `Descriptor is a non-object`),[11],[32,2],[32,3],[16, ...builtin('__ecma262_ToPropertyKey')],[33,10],[33,9],[32,4],[34,11],[33,14],[32,15],[252,3],[34,18],[65,12],[54,1,0],[32,18],[65,227,0],[58,0,4],[32,18],[65,239,0],[58,0,5],[32,18],[65,238,0],[58,0,6],[32,18],[65,230,0],[58,0,7],[32,18],[65,233,0],[58,0,8],[32,18],[65,231,0],[58,0,9],[32,18],[65,245,0],[58,0,10],[32,18],[65,242,0],[58,0,11],[32,18],[65,225,0],[58,0,12],[32,18],[65,226,0],[58,0,13],[32,18],[65,236,0],[58,0,14],[32,18],[65,229,0],[58,0,15],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,13],[33,12],[32,11],[33,14],[32,15],[252,3],[34,18],[65,10],[54,1,0],[32,18],[65,229,0],[58,0,4],[32,18],[65,238,0],[58,0,5],[32,18],[65,245,0],[58,0,6],[32,18],[65,237,0],[58,0,7],[32,18],[65,229,0],[58,0,8],[32,18],[65,242,0],[58,0,9],[32,18],[65,225,0],[58,0,10],[32,18],[65,226,0],[58,0,11],[32,18],[65,236,0],[58,0,12],[32,18],[65,229,0],[58,0,13],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,20],[33,19],[32,11],[33,14],[32,15],[252,3],[34,18],[65,5],[54,1,0],[32,18],[65,246,0],[58,0,4],[32,18],[65,225,0],[58,0,5],[32,18],[65,236,0],[58,0,6],[32,18],[65,245,0],[58,0,7],[32,18],[65,229,0],[58,0,8],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,22],[33,21],[32,11],[33,14],[32,15],[252,3],[34,18],[65,8],[54,1,0],[32,18],[65,247,0],[58,0,4],[32,18],[65,242,0],[58,0,5],[32,18],[65,233,0],[58,0,6],[32,18],[65,244,0],[58,0,7],[32,18],[65,225,0],[58,0,8],[32,18],[65,226,0],[58,0,9],[32,18],[65,236,0],[58,0,10],[32,18],[65,229,0],[58,0,11],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,24],[33,23],[32,11],[33,14],[32,15],[252,3],[34,18],[65,3],[54,1,0],[32,18],[65,231,0],[58,0,4],[32,18],[65,229,0],[58,0,5],[32,18],[65,244,0],[58,0,6],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,26],[33,25],[32,11],[33,14],[32,15],[252,3],[34,18],[65,3],[54,1,0],[32,18],[65,243,0],[58,0,4],[32,18],[65,229,0],[58,0,5],[32,18],[65,244,0],[58,0,6],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,28],[33,27],[68,0,0,0,0,0,0,0,0],[33,29],[32,25],[34,30],[33,7],[32,26],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[69],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[69],[12,1],[11],[32,7],[68,0,0,0,0,0,0,0,0],[97],[11,"TYPESWITCH_end"],[4,124],[32,27],[32,28],[33,6],[5],[32,30],[32,26],[33,6],[11],[33,7],[32,6],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,21],[34,30],[33,7],[32,22],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[69],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[69],[12,1],[11],[32,7],[68,0,0,0,0,0,0,0,0],[97],[11,"TYPESWITCH_end"],[4,124],[32,23],[32,24],[33,6],[5],[32,30],[32,22],[33,6],[11],[33,7],[32,6],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],...internalThrow(scope, 'TypeError', `Descriptor cannot define both accessor and data descriptor attributes`),[11],[68,0,0,0,0,0,0,240,63],[33,29],[11],[68,0,0,0,0,0,0,0,0],[33,31],[32,29],[252,3],[4,64],[32,31],[68,0,0,0,0,0,0,240,63],[16, ...builtin('f64_|')],[33,31],[11],[32,12],[33,7],[32,13],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,31],[68,0,0,0,0,0,0,0,64],[16, ...builtin('f64_|')],[33,31],[11],[32,19],[33,7],[32,20],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,31],[68,0,0,0,0,0,0,16,64],[16, ...builtin('f64_|')],[33,31],[11],[32,23],[33,7],[32,24],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,31],[68,0,0,0,0,0,0,32,64],[16, ...builtin('f64_|')],[33,31],[11],[32,0],[252,2],[32,1],[32,9],[252,2],[32,10],[32,21],[32,22],[32,31],[252,2],[65,1],[16, ...builtin('__Porffor_object_define')],[33,6],[183],[26],[32,0],[32,1],[15]],
1693
+ wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,2],[32,1],[16, ...builtin('__Porffor_object_isObject')],[33,6],[183],[33,7],[32,6],[33,8],[2,124],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,7],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Target is a non-object`),[11],[32,4],[252,2],[32,5],[16, ...builtin('__Porffor_object_isObject')],[33,6],[183],[33,7],[32,6],[33,8],[2,124],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,7],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Descriptor is a non-object`),[11],[32,2],[32,3],[16, ...builtin('__ecma262_ToPropertyKey')],[33,10],[33,9],[32,4],[34,11],[33,14],[32,15],[252,3],[34,18],[65,12],[54,1,0],[32,18],[65,227,0],[58,0,4],[32,18],[65,239,0],[58,0,5],[32,18],[65,238,0],[58,0,6],[32,18],[65,230,0],[58,0,7],[32,18],[65,233,0],[58,0,8],[32,18],[65,231,0],[58,0,9],[32,18],[65,245,0],[58,0,10],[32,18],[65,242,0],[58,0,11],[32,18],[65,225,0],[58,0,12],[32,18],[65,226,0],[58,0,13],[32,18],[65,236,0],[58,0,14],[32,18],[65,229,0],[58,0,15],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,13],[33,12],[32,11],[33,14],[32,15],[252,3],[34,18],[65,10],[54,1,0],[32,18],[65,229,0],[58,0,4],[32,18],[65,238,0],[58,0,5],[32,18],[65,245,0],[58,0,6],[32,18],[65,237,0],[58,0,7],[32,18],[65,229,0],[58,0,8],[32,18],[65,242,0],[58,0,9],[32,18],[65,225,0],[58,0,10],[32,18],[65,226,0],[58,0,11],[32,18],[65,236,0],[58,0,12],[32,18],[65,229,0],[58,0,13],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,20],[33,19],[32,11],[33,14],[32,15],[252,3],[34,18],[65,5],[54,1,0],[32,18],[65,246,0],[58,0,4],[32,18],[65,225,0],[58,0,5],[32,18],[65,236,0],[58,0,6],[32,18],[65,245,0],[58,0,7],[32,18],[65,229,0],[58,0,8],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,22],[33,21],[32,11],[33,14],[32,15],[252,3],[34,18],[65,8],[54,1,0],[32,18],[65,247,0],[58,0,4],[32,18],[65,242,0],[58,0,5],[32,18],[65,233,0],[58,0,6],[32,18],[65,244,0],[58,0,7],[32,18],[65,225,0],[58,0,8],[32,18],[65,226,0],[58,0,9],[32,18],[65,236,0],[58,0,10],[32,18],[65,229,0],[58,0,11],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,24],[33,23],[32,11],[33,14],[32,15],[252,3],[34,18],[65,3],[54,1,0],[32,18],[65,231,0],[58,0,4],[32,18],[65,229,0],[58,0,5],[32,18],[65,244,0],[58,0,6],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,26],[33,25],[32,11],[33,14],[32,15],[252,3],[34,18],[65,3],[54,1,0],[32,18],[65,243,0],[58,0,4],[32,18],[65,229,0],[58,0,5],[32,18],[65,244,0],[58,0,6],[32,18],[184],[33,15],[32,14],[252,3],[65,7],[32,15],[65,195,1],[16, ...builtin('__ecma262_ToPropertyKey')],[33,17],[252,3],[32,17],[16, ...builtin('__Porffor_object_get')],[33,28],[33,27],[68,0,0,0,0,0,0,0,0],[33,29],[32,25],[68,0,0,0,0,0,0,0,0],[98],[32,26],[65,128,1],[114],[65,128,1],[65,128,1],[114],[71],[114],[34,30],[69],[4,127],[32,27],[68,0,0,0,0,0,0,0,0],[98],[32,28],[65,128,1],[114],[65,128,1],[65,128,1],[114],[71],[114],[65,2],[33,6],[5],[32,30],[65,2],[33,6],[11],[4,64],[32,25],[68,0,0,0,0,0,0,0,0],[98],[32,26],[65,128,1],[114],[65,128,1],[65,128,1],[114],[71],[114],[34,30],[4,127],[32,25],[32,26],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,24,64],[98],[65,2],[33,6],[5],[32,30],[65,2],[33,6],[11],[4,64],...internalThrow(scope, 'TypeError', `Getter must be a function`),[11],[32,27],[68,0,0,0,0,0,0,0,0],[98],[32,28],[65,128,1],[114],[65,128,1],[65,128,1],[114],[71],[114],[34,30],[4,127],[32,27],[32,28],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,24,64],[98],[65,2],[33,6],[5],[32,30],[65,2],[33,6],[11],[4,64],...internalThrow(scope, 'TypeError', `Setter must be a function`),[11],[32,21],[68,0,0,0,0,0,0,0,0],[98],[32,22],[65,128,1],[114],[65,128,1],[65,128,1],[114],[71],[114],[34,30],[69],[4,127],[32,23],[68,0,0,0,0,0,0,0,0],[98],[32,24],[65,128,1],[114],[65,128,1],[65,128,1],[114],[71],[114],[65,2],[33,6],[5],[32,30],[65,2],[33,6],[11],[4,64],...internalThrow(scope, 'TypeError', `Descriptor cannot define both accessor and data descriptor attributes`),[11],[68,0,0,0,0,0,0,240,63],[33,29],[11],[68,0,0,0,0,0,0,0,0],[33,31],[32,29],[252,3],[4,64],[32,31],[68,0,0,0,0,0,0,240,63],[16, ...builtin('f64_|')],[33,31],[11],[32,12],[33,7],[32,13],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,31],[68,0,0,0,0,0,0,0,64],[16, ...builtin('f64_|')],[33,31],[11],[32,19],[33,7],[32,20],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,31],[68,0,0,0,0,0,0,16,64],[16, ...builtin('f64_|')],[33,31],[11],[32,23],[33,7],[32,24],[33,8],[2,127],[32,8],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,8],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,7],[252,3],[40,1,0],[12,1],[11],[32,7],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,31],[68,0,0,0,0,0,0,32,64],[16, ...builtin('f64_|')],[33,31],[11],[32,0],[252,2],[32,1],[32,9],[252,2],[32,10],[32,21],[32,22],[32,31],[252,2],[65,1],[16, ...builtin('__Porffor_object_define')],[33,6],[183],[26],[32,0],[32,1],[15]],
1694
1694
  params: [124,127,124,127,124,127], typedParams: 1,
1695
1695
  returns: [124,127], typedReturns: 1,
1696
- locals: [127,124,127,124,127,124,124,127,124,124,127,127,127,124,127,124,127,124,127,124,127,124,127,124,124,124], localNames: ["target","target#type","prop","prop#type","descriptor","descriptor#type","#last_type","#logicinner_tmp","#typeswitch_tmp","p","p#type","desc","configurable","configurable#type","#member_obj","#member_prop","#loadArray_offset","#swap","#makearray_pointer_tmp","enumerable","enumerable#type","value","value#type","writable","writable#type","get","get#type","set","set#type","accessor","logictmp","flags"],
1696
+ locals: [127,124,127,124,127,124,124,127,124,124,127,127,127,124,127,124,127,124,127,124,127,124,127,124,127,124], localNames: ["target","target#type","prop","prop#type","descriptor","descriptor#type","#last_type","#logicinner_tmp","#typeswitch_tmp","p","p#type","desc","configurable","configurable#type","#member_obj","#member_prop","#loadArray_offset","#swap","#makearray_pointer_tmp","enumerable","enumerable#type","value","value#type","writable","writable#type","get","get#type","set","set#type","accessor","logictmpi","flags"],
1697
+ };
1698
+ this.__Object_defineProperties = {
1699
+ wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,2],[32,1],[16, ...builtin('__Porffor_object_isObject')],[33,4],[183],[33,5],[32,4],[33,6],[2,124],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,5],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,5],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,5],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Target is a non-object`),[11],[32,2],[252,2],[32,3],[16, ...builtin('__Porffor_object_isObjectOrSymbol')],[33,4],[183],[33,5],[32,4],[33,6],[2,124],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,5],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,5],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,5],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Props needs to be an object or symbol`),[11],[32,2],[252,3],[33,7],[65,0],[33,9],[32,7],[40,1,0],[34,8],[4,64],[32,3],[33,6],[2,64],[32,6],[65,7],[70],[4,64,"TYPESWITCH|Object"],[3,64],[32,7],[40,0,4],[34,12],[65,31],[118],[4,127],[32,12],[65,255,255,255,255,7],[113],[33,12],[65,67],[5],[65,195,1],[11],[33,11],[32,12],[184],[33,10],[2,64],[2,64],[32,0],[32,1],[32,10],[32,11],[32,2],[33,13],[32,10],[33,14],[32,3],[33,6],[2,124],[32,6],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,13],[252,3],[32,3],[32,14],[32,11],[16, ...builtin('__ecma262_ToPropertyKey')],[33,16],[252,3],[32,16],[16, ...builtin('__Porffor_object_get')],[33,4],[12,1],[11],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[65,128,128,4],[65,1],[54,0,0],[65,128,128,4],[32,14],[252,3],[65,2],[108],[32,13],[252,3],[106],[47,0,4],[59,0,4],[68,0,0,0,0,0,0,240,64],[65,195,0],[33,4],[12,1],[11],[32,6],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,14],[252,3],[65,9],[108],[32,13],[252,3],[106],[34,15],[43,0,4],[32,15],[45,0,12],[33,4],[12,1],[11],[32,6],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[106],[45,0,4],[184],[65,1],[33,4],[12,1],[11],[32,6],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[106],[44,0,4],[183],[65,1],[33,4],[12,1],[11],[32,6],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[106],[45,0,4],[184],[65,1],[33,4],[12,1],[11],[32,6],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,2],[108],[106],[47,0,4],[184],[65,1],[33,4],[12,1],[11],[32,6],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,2],[108],[106],[46,0,4],[183],[65,1],[33,4],[12,1],[11],[32,6],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,4],[108],[106],[40,0,4],[184],[65,1],[33,4],[12,1],[11],[32,6],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,4],[108],[106],[40,0,4],[183],[65,1],[33,4],[12,1],[11],[32,6],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,4],[108],[106],[42,0,4],[187],[65,1],[33,4],[12,1],[11],[32,6],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,13],[252,3],[40,0,4],[32,14],[252,3],[65,8],[108],[106],[43,0,4],[65,1],[33,4],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[65,128,128,4],[65,1],[54,0,0],[65,128,128,4],[32,14],[252,3],[32,13],[252,3],[106],[45,0,4],[58,0,4],[68,0,0,0,0,0,0,240,64],[65,195,1],[33,4],[12,1],[11],...internalThrow(scope, 'TypeError', `Unsupported member expression object`),[68,0,0,0,0,0,0,0,0],[11,"TYPESWITCH_end"],[32,4],[16, ...builtin('__Object_defineProperty')],[33,4],[26],[11],[32,7],[65,14],[106],[33,7],[32,9],[65,1],[106],[34,9],[32,8],[71],[13,1],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `Tried for..in on unsupported type`),[11,"TYPESWITCH_end"],[11],[32,0],[32,1],[15]],
1700
+ params: [124,127,124,127], typedParams: 1,
1701
+ returns: [124,127], typedReturns: 1,
1702
+ locals: [127,124,127,127,127,127,124,127,127,124,124,127,127], localNames: ["target","target#type","props","props#type","#last_type","#logicinner_tmp","#typeswitch_tmp","#forin_base_pointer","#forin_length","#forin_counter","x","x#type","#forin_tmp","#member_obj","#member_prop","#loadArray_offset","#swap"],
1697
1703
  };
1698
1704
  this.__Object_prototype_propertyIsEnumerable = {
1699
1705
  wasm: (scope, {builtin}) => [[32,2],[32,3],[16, ...builtin('__ecma262_ToPropertyKey')],[33,5],[33,4],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[34,7],[68,0,0,0,0,0,0,28,64],[97],[4,64],[32,0],[252,2],[32,1],[32,4],[252,2],[32,5],[16, ...builtin('__Porffor_object_lookup')],[33,6],[183],[34,8],[68,0,0,0,0,0,0,240,191],[97],[4,64],[68,0,0,0,0,0,0,0,0],[65,2],[15],[11],[32,8],[252,2],[65,1],[16, ...builtin('__Porffor_object_isEnumerable')],[33,6],[183],[32,6],[15],[11],[32,0],[32,1],[16, ...builtin('__Object_keys')],[26],[34,9],[65,208,0],[32,4],[32,5],[68,0,0,0,0,0,0,0,0],[65,128,1],[16, ...builtin('__Array_prototype_includes')],[34,6],[15]],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
4
- "version": "0.21.0+0c514ac58",
4
+ "version": "0.21.2+856c111a5",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {},
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.21.0+0c514ac58';
3
+ globalThis.version = '0.21.2+856c111a5';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {