porffor 0.30.9 → 0.30.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.
@@ -4,7 +4,10 @@ export const __Porffor_object_getObject = (obj: any): any => {
4
4
  const funcI32: i32 = Porffor.wasm`local.get ${obj}`;
5
5
  let underlying: object = underlyingFuncObjs.get(funcI32);
6
6
  if (underlying == null) {
7
- underlying = Porffor.allocate();
7
+ underlying = {};
8
+ underlying.prototype = {};
9
+ underlying.prototype.constructor = obj;
10
+
8
11
  underlyingFuncObjs.set(funcI32, underlying);
9
12
  }
10
13
 
@@ -3,10 +3,10 @@ import { number } from './embedding.js';
3
3
 
4
4
  export const BuiltinFuncs = function() {
5
5
  this.__Porffor_object_getObject = {
6
- wasm: (scope, {glbl,builtin}) => [[32,1],[184],[68,0,0,0,0,0,0,24,64],[97],[4,64],[32,0],[33,2],...glbl(35, 'underlyingFuncObjs', 124),[33,4],[65,20],[33,5],[32,4],[32,5],[32,2],[65,1],[16, builtin('__Map_prototype_get')],[26],[34,3],[68,0,0,0,0,0,0,0,0],[97],[4,64],[16, builtin('__Porffor_allocate')],[183],[33,3],...glbl(35, 'underlyingFuncObjs', 124),[33,4],[65,20],[33,5],[32,4],[32,5],[32,2],[65,1],[32,3],[65,7],[16, builtin('__Map_prototype_set')],[33,6],[26],[11],[32,3],[65,7],[15],[11],[32,0],[32,1],[15]],
6
+ wasm: (scope, {glbl,builtin,internalThrow}) => [[32,1],[184],[68,0,0,0,0,0,0,24,64],[97],[4,64],[32,0],[33,2],...glbl(35, 'underlyingFuncObjs', 124),[33,4],[65,20],[33,5],[32,4],[32,5],[32,2],[65,1],[16, builtin('__Map_prototype_get')],[26],[34,3],[68,0,0,0,0,0,0,0,0],[97],[4,64],[16, builtin('__Porffor_allocate')],[184],[34,3],[33,9],[16, builtin('__Porffor_allocate')],[34,11],[65,9],[54,1,0],[32,11],[65,240,0],[58,0,4],[32,11],[65,242,0],[58,0,5],[32,11],[65,239,0],[58,0,6],[32,11],[65,244,0],[58,0,7],[32,11],[65,239,0],[58,0,8],[32,11],[65,244,0],[58,0,9],[32,11],[65,249,0],[58,0,10],[32,11],[65,240,0],[58,0,11],[32,11],[65,229,0],[58,0,12],[32,11],[184],[33,10],[32,9],[252,3],[65,7],[32,10],[65,195,1],[16, builtin('__ecma262_ToPropertyKey')],[33,12],[252,3],[32,12],[16, builtin('__Porffor_allocate')],[184],[65,7],[16, builtin('__Porffor_object_set')],[26],[26],[32,3],[33,9],[65,128,128,4],[34,11],[65,9],[54,1,0],[32,11],[65,240,0],[58,0,4],[32,11],[65,242,0],[58,0,5],[32,11],[65,239,0],[58,0,6],[32,11],[65,244,0],[58,0,7],[32,11],[65,239,0],[58,0,8],[32,11],[65,244,0],[58,0,9],[32,11],[65,249,0],[58,0,10],[32,11],[65,240,0],[58,0,11],[32,11],[65,229,0],[58,0,12],[32,11],[184],[33,13],[32,9],[252,3],[65,7],[32,13],[65,195,1],[16, builtin('__ecma262_ToPropertyKey')],[33,12],[252,3],[32,12],[16, builtin('__Porffor_object_get')],[33,6],[33,9],[16, builtin('__Porffor_allocate')],[34,11],[65,11],[54,1,0],[32,11],[65,227,0],[58,0,4],[32,11],[65,239,0],[58,0,5],[32,11],[65,238,0],[58,0,6],[32,11],[65,243,0],[58,0,7],[32,11],[65,244,0],[58,0,8],[32,11],[65,242,0],[58,0,9],[32,11],[65,245,0],[58,0,10],[32,11],[65,227,0],[58,0,11],[32,11],[65,244,0],[58,0,12],[32,11],[65,239,0],[58,0,13],[32,11],[65,242,0],[58,0,14],[32,11],[184],[33,10],[32,6],[33,16],[2,124],[32,16],[65,6],[70],[4,64,"TYPESWITCH|Function"],[32,9],[252,3],[32,6],[32,10],[65,195,1],[16, builtin('__ecma262_ToPropertyKey')],[33,12],[252,3],[32,12],[32,0],[32,1],[16, builtin('__Porffor_object_set')],[26],[12,1],[11],[32,16],[65,7],[70],[4,64,"TYPESWITCH|Object"],[32,9],[252,3],[32,6],[32,10],[65,195,1],[16, builtin('__ecma262_ToPropertyKey')],[33,12],[252,3],[32,12],[32,0],[32,1],[16, builtin('__Porffor_object_set')],[26],[12,1],[11],[32,16],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,9],[252,3],[32,10],[252,3],[65,9],[108],[106],[34,8],[32,0],[34,7],[57,0,4],[32,8],[32,1],[58,0,12],[32,7],[12,1],[11],[32,16],[65,216,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[106],[32,0],[34,7],[252,3],[58,0,4],[32,7],[12,1],[11],[32,16],[65,217,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[106],[32,0],[34,7],[252,2],[58,0,4],[32,7],[12,1],[11],[32,16],[65,218,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[106],[32,0],[34,7],[68,0,0,0,0,0,0,0,0],[165],[68,0,0,0,0,0,224,111,64],[164],[252,3],[58,0,4],[32,7],[12,1],[11],[32,16],[65,219,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[65,2],[108],[106],[32,0],[34,7],[252,3],[59,0,4],[32,7],[12,1],[11],[32,16],[65,220,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[65,2],[108],[106],[32,0],[34,7],[252,2],[59,0,4],[32,7],[12,1],[11],[32,16],[65,221,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[65,4],[108],[106],[32,0],[34,7],[252,3],[54,0,4],[32,7],[12,1],[11],[32,16],[65,222,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[65,4],[108],[106],[32,0],[34,7],[252,2],[54,0,4],[32,7],[12,1],[11],[32,16],[65,223,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[65,4],[108],[106],[32,0],[34,7],[182],[56,0,4],[32,7],[12,1],[11],[32,16],[65,224,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,9],[252,3],[40,0,4],[32,10],[252,3],[65,8],[108],[106],[32,0],[34,7],[57,0,4],[32,7],[12,1],[11],[32,16],[65,128,1],[70],[4,64,"TYPESWITCH|undefined"],...internalThrow(scope, 'TypeError', `Cannot set property of undefined`),[68,0,0,0,0,0,0,0,0],[12,1],[11],[32,0],[11,"TYPESWITCH_end"],[26],...glbl(35, 'underlyingFuncObjs', 124),[33,4],[65,20],[33,5],[32,4],[32,5],[32,2],[65,1],[32,3],[65,7],[16, builtin('__Map_prototype_set')],[33,6],[26],[11],[32,3],[65,7],[15],[11],[32,0],[32,1],[15]],
7
7
  params: [124,127], typedParams: 1,
8
8
  returns: [124,127], typedReturns: 1,
9
- locals: [124,124,124,127,127], localNames: ["obj","obj#type","funcI32","underlying","#proto_target","#proto_target#type","#last_type"],
9
+ locals: [124,124,124,127,127,124,127,124,124,127,127,124,127,127,127], localNames: ["obj","obj#type","funcI32","underlying","#proto_target","#proto_target#type","#last_type","#member_setter_val_tmp","#member_setter_ptr_tmp","#member_obj","#member_prop_assign","#makearray_pointer_tmp","#swap","#member_prop","#loadArray_offset","#member_allocd","#typeswitch_tmp1"],
10
10
  globalInits: {underlyingFuncObjs: (scope, {glbl,builtin}) => [[68,0,0,0,0,0,0,240,63],[65,6],[16, builtin('__Porffor_allocate')],[184],[65,7],[68,0,0,0,0,0,0,0,0],[65,128,1],[16, builtin('Map')],[26],...glbl(36, 'underlyingFuncObjs', 124)]},
11
11
  };
12
12
  this.__Porffor_object_preventExtensions = {
package/compiler/wrap.js CHANGED
@@ -65,6 +65,8 @@ const porfToJSValue = ({ memory, funcs, pages }, value, type, override = undefin
65
65
  const kValue = kRaw & 0x3fffffff;
66
66
  const k = porfToJSValue({ memory, funcs, pages }, kValue, kType);
67
67
 
68
+ if (k === '__proto__') continue;
69
+
68
70
  const tail = read(Uint16Array, memory, value + offset + 12, 1)[0];
69
71
 
70
72
  const vValue = read(Float64Array, memory, value + offset + 4, 1)[0];
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.30.9+3fa3e04ac",
4
+ "version": "0.30.10+1ed8b1535",
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.30.9+3fa3e04ac';
3
+ globalThis.version = '0.30.10+1ed8b1535';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {