porffor 0.20.9 → 0.20.10

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.
@@ -196,7 +196,8 @@ local.set ${err}`;
196
196
  };
197
197
 
198
198
  export const __Porffor_object_isEnumerable = (ptr: i32): boolean => {
199
- return Porffor.wasm.i32.load8_u(ptr, 0, 12) & 0b0100;
199
+ const out: boolean = Porffor.wasm.i32.load8_u(ptr, 0, 12) & 0b0100;
200
+ return out;
200
201
  };
201
202
 
202
203
  export const __Porffor_object_isObject = (arg: any): boolean => {
@@ -234,6 +234,22 @@ export const __Object_defineProperty = (target: any, prop: any, descriptor: any)
234
234
  };
235
235
 
236
236
 
237
+ export const __Object_prototype_propertyIsEnumerable = (_this: any, prop: any) => {
238
+ const p: any = ecma262.ToPropertyKey(prop);
239
+
240
+ const t: i32 = Porffor.rawType(_this);
241
+ if (t == Porffor.TYPES.object) {
242
+ const entryPtr: i32 = Porffor.object.lookup(_this, p);
243
+ if (entryPtr == -1) return false;
244
+
245
+ return Porffor.object.isEnumerable(entryPtr);
246
+ }
247
+
248
+ const keys: any[] = __Object_keys(_this);
249
+ return __Array_prototype_includes(keys, p);
250
+ };
251
+
252
+
237
253
  export const __Object_prototype_toString = (_this: object) => {
238
254
  let out: bytestring = '[object Object]';
239
255
  return out;
@@ -27,19 +27,19 @@ export const BuiltinFuncs = function() {
27
27
  locals: [127,127,127,127,127,127,127,127,127], localNames: ["_this","_this#type","key","key#type","value","value#type","flags","flags#type","entryPtr","#last_type","size","keyEnc","tail","err","logictmp","#logicinner_tmp","#typeswitch_tmp"],
28
28
  };
29
29
  this.__Porffor_object_isEnumerable = {
30
- wasm: (scope, {}) => [[32,0],[45,0,12],[65,4],[113],[65,1],[15]],
30
+ wasm: (scope, {}) => [[32,0],[45,0,12],[65,4],[113],[34,2],[65,2],[15]],
31
31
  params: [127,127], typedParams: 1,
32
32
  returns: [127,127], typedReturns: 1,
33
- locals: [], localNames: ["ptr","ptr#type"],
33
+ locals: [127], localNames: ["ptr","ptr#type","out"],
34
34
  };
35
35
  this.__Porffor_object_isObject = {
36
- wasm: (scope, {}) => [[32,1],[33,2],[32,0],[65,0],[71],[32,2],[65,5],[74],[113],[32,2],[65,128,1],[71],[113],[32,2],[65,195,1],[71],[113],[65,2],[15]],
36
+ wasm: (scope, {}) => [[32,1],[33,2],[32,0],[65,0],[71],[32,2],[65,5],[74],[113],[32,2],[65,128,1],[71],[113],[32,2],[65,195,0],[71],[113],[32,2],[65,195,1],[71],[113],[65,2],[15]],
37
37
  params: [127,127], typedParams: 1,
38
38
  returns: [127,127], typedReturns: 1,
39
39
  locals: [127], localNames: ["arg","arg#type","t"],
40
40
  };
41
41
  this.__Porffor_object_isObjectOrSymbol = {
42
- wasm: (scope, {}) => [[32,1],[33,2],[32,0],[65,0],[71],[32,2],[65,4],[74],[113],[32,2],[65,128,1],[71],[113],[32,2],[65,195,1],[71],[113],[65,2],[15]],
42
+ wasm: (scope, {}) => [[32,1],[33,2],[32,0],[65,0],[71],[32,2],[65,4],[74],[113],[32,2],[65,128,1],[71],[113],[32,2],[65,195,0],[71],[113],[32,2],[65,195,1],[71],[113],[65,2],[15]],
43
43
  params: [127,127], typedParams: 1,
44
44
  returns: [127,127], typedReturns: 1,
45
45
  locals: [127], localNames: ["arg","arg#type","t"],
@@ -1695,6 +1695,12 @@ export const BuiltinFuncs = function() {
1695
1695
  returns: [124,127], typedReturns: 1,
1696
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"],
1697
1697
  };
1698
+ this.__Object_prototype_propertyIsEnumerable = {
1699
+ 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]],
1700
+ params: [124,127,124,127], typedParams: 1,
1701
+ returns: [124,127], typedReturns: 1,
1702
+ locals: [124,127,127,124,124,124], localNames: ["_this","_this#type","prop","prop#type","p","p#type","#last_type","t","entryPtr","keys"],
1703
+ };
1698
1704
  this.__Object_prototype_toString = {
1699
1705
  wasm: (scope, {allocPage}) => [...number(allocPage(scope, 'bytestring: __Object_prototype_toString/out', 'i8') * pageSize, 124),[34,2],[65,195,1],[15]],
1700
1706
  params: [124,127], typedParams: 1,
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.20.9+891a17fe5",
4
+ "version": "0.20.10+137dc7300",
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.20.9+891a17fe5';
3
+ globalThis.version = '0.20.10+137dc7300';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {