porffor 0.18.29 → 0.18.31
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/builtins/weakref.ts +10 -1
- package/compiler/builtins/weakset.ts +102 -0
- package/compiler/generated_builtins.js +54 -3
- package/compiler/types.js +2 -1
- package/compiler/wrap.js +15 -0
- package/package.json +1 -1
- package/runner/index.js +1 -1
@@ -3,6 +3,8 @@ import type {} from './porffor.d.ts';
|
|
3
3
|
export const WeakRef = function (target: any): WeakRef {
|
4
4
|
if (!new.target) throw new TypeError("Constructor WeakRef requires 'new'");
|
5
5
|
|
6
|
+
if (Porffor.rawType(target) < 0x04) throw new TypeError('Target for WeakRef needs to be an object or symbol');
|
7
|
+
|
6
8
|
const out: WeakRef = Porffor.allocateBytes(9);
|
7
9
|
|
8
10
|
Porffor.wasm`local.get ${out}
|
@@ -27,4 +29,11 @@ local.get ${_this}
|
|
27
29
|
i32.to_u
|
28
30
|
i32.load8_u 0 8
|
29
31
|
return`;
|
30
|
-
};
|
32
|
+
};
|
33
|
+
|
34
|
+
export const __WeakRef_prototype_toString = (_this: WeakRef) => {
|
35
|
+
const out: bytestring = '[object WeakRef]';
|
36
|
+
return out;
|
37
|
+
};
|
38
|
+
|
39
|
+
export const __WeakRef_prototype_toLocaleString = (_this: WeakRef) => __WeakRef_prototype_toString(_this);
|
@@ -0,0 +1,102 @@
|
|
1
|
+
import type {} from './porffor.d.ts';
|
2
|
+
|
3
|
+
export const __WeakSet_prototype_has = (_this: WeakSet, value: any) => {
|
4
|
+
const size: number = Porffor.wasm.i32.load(_this, 0, 0);
|
5
|
+
|
6
|
+
for (let i: number = 0; i < size; i++) {
|
7
|
+
if (__Porffor_set_read(_this, i) === value) return true;
|
8
|
+
}
|
9
|
+
|
10
|
+
return false;
|
11
|
+
};
|
12
|
+
|
13
|
+
export const __WeakSet_prototype_add = (_this: WeakSet, value: any) => {
|
14
|
+
if (Porffor.rawType(value) < 0x04) throw new TypeError('Value in WeakSet needs to be an object or symbol');
|
15
|
+
|
16
|
+
const size: number = Porffor.wasm.i32.load(_this, 0, 0);
|
17
|
+
|
18
|
+
// check if already in set
|
19
|
+
for (let i: number = 0; i < size; i++) {
|
20
|
+
if (__Porffor_set_read(_this, i) === value) return _this;
|
21
|
+
}
|
22
|
+
|
23
|
+
// not, add it
|
24
|
+
// increment size by 1
|
25
|
+
Porffor.wasm.i32.store(_this, size + 1, 0, 0);
|
26
|
+
|
27
|
+
// write new value at end
|
28
|
+
__Porffor_set_write(_this, size, value);
|
29
|
+
|
30
|
+
return _this;
|
31
|
+
};
|
32
|
+
|
33
|
+
export const __WeakSet_prototype_delete = (_this: WeakSet, value: any) => {
|
34
|
+
const size: number = Porffor.wasm.i32.load(_this, 0, 0);
|
35
|
+
|
36
|
+
// check if already in set
|
37
|
+
for (let i: number = 0; i < size; i++) {
|
38
|
+
if (__Porffor_set_read(_this, i) === value) {
|
39
|
+
// found, delete
|
40
|
+
// decrement size by 1
|
41
|
+
Porffor.wasm.i32.store(_this, size - 1, 0, 0);
|
42
|
+
|
43
|
+
// offset all elements after by -1 ind
|
44
|
+
Porffor.wasm`
|
45
|
+
local offset i32
|
46
|
+
local.get ${i}
|
47
|
+
i32.to_u
|
48
|
+
i32.const 9
|
49
|
+
i32.mul
|
50
|
+
local.get ${_this}
|
51
|
+
i32.to_u
|
52
|
+
i32.add
|
53
|
+
i32.const 4
|
54
|
+
i32.add
|
55
|
+
local.set offset
|
56
|
+
|
57
|
+
;; dst = offset (this element)
|
58
|
+
local.get offset
|
59
|
+
|
60
|
+
;; src = offset + 9 (this element + 1 element)
|
61
|
+
local.get offset
|
62
|
+
i32.const 9
|
63
|
+
i32.add
|
64
|
+
|
65
|
+
;; size = (size - i - 1) * 9
|
66
|
+
local.get ${size}
|
67
|
+
local.get ${i}
|
68
|
+
f64.sub
|
69
|
+
i32.to_u
|
70
|
+
i32.const 1
|
71
|
+
i32.sub
|
72
|
+
i32.const 9
|
73
|
+
i32.mul
|
74
|
+
|
75
|
+
memory.copy 0 0`;
|
76
|
+
|
77
|
+
return true;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// not, return false
|
82
|
+
return false;
|
83
|
+
};
|
84
|
+
|
85
|
+
export const WeakSet = function (iterable: any): WeakSet {
|
86
|
+
if (!new.target) throw new TypeError("Constructor Set requires 'new'");
|
87
|
+
|
88
|
+
const out: WeakSet = __Porffor_allocate();
|
89
|
+
|
90
|
+
if (Porffor.rawType(iterable) != Porffor.TYPES.undefined) for (const x of iterable) {
|
91
|
+
__WeakSet_prototype_add(out, x);
|
92
|
+
}
|
93
|
+
|
94
|
+
return out;
|
95
|
+
};
|
96
|
+
|
97
|
+
export const __WeakSet_prototype_toString = (_this: WeakSet) => {
|
98
|
+
const out: bytestring = '[object WeakSet]';
|
99
|
+
return out;
|
100
|
+
};
|
101
|
+
|
102
|
+
export const __WeakSet_prototype_toLocaleString = (_this: WeakSet) => __WeakSet_prototype_toString(_this);
|
@@ -1464,7 +1464,7 @@ export const BuiltinFuncs = function() {
|
|
1464
1464
|
constr: 1,
|
1465
1465
|
};
|
1466
1466
|
this.__Set_prototype_union = {
|
1467
|
-
wasm: (scope, {builtin,internalThrow}) => [[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,51,64],[98],[4,64],...internalThrow(scope, 'TypeError', `Set.prototype.union's 'other' argument must be a Set`),[11],[65,1],[32,0],[65,19],[16, builtin('Set')],[33,5],[33,4],[32,2],[252,3],[33,6],[65,0],[33,8],[32,6],[40,1,0],[33,7],[32,3],[33,13],[2,64],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[3,64],[32,6],[43,0,4],[32,6],[45,0,12],[33,10],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,6],[65,9],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[65,194,0],[33,10],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,6],[47,0,4],[59,0,4],[68,0,0,0,0,0,0,0,0],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,6],[65,2],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[3,64],[32,6],[43,0,4],[32,6],[45,0,12],[33,10],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,6],[65,9],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[45,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[44,0,4],[183],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[45,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,2],[108],[106],[47,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,2],[108],[106],[46,0,4],[183],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[40,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[40,0,4],[183],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[42,0,4],[187],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,8],[108],[106],[43,0,4],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[65,194,1],[33,10],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,6],[32,8],[106],[45,0,4],[58,0,4],[68,0,0,0,0,0,0,0,0],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `Tried for..of on non-iterable type`),[11,"TYPESWITCH_end"],[32,4],[65,19],[15]],
|
1467
|
+
wasm: (scope, {builtin,internalThrow}) => [[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,51,64],[98],[4,64],...internalThrow(scope, 'TypeError', `Set.prototype.union's 'other' argument must be a Set`),[11],[65,1],[32,0],[65,19],[16, builtin('Set')],[33,5],[33,4],[32,2],[252,3],[33,6],[65,0],[33,8],[32,6],[40,1,0],[33,7],[32,3],[33,13],[2,64],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[3,64],[32,6],[43,0,4],[32,6],[45,0,12],[33,10],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,6],[65,9],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[65,194,0],[33,10],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,6],[47,0,4],[59,0,4],[68,0,0,0,0,0,0,0,0],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,6],[65,2],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[3,64],[32,6],[43,0,4],[32,6],[45,0,12],[33,10],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,6],[65,9],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[45,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[44,0,4],[183],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[45,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,2],[108],[106],[47,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,2],[108],[106],[46,0,4],[183],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[40,0,4],[184],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[40,0,4],[183],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[42,0,4],[187],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,8],[108],[106],[43,0,4],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,13],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[65,194,1],[33,10],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,6],[32,8],[106],[45,0,4],[58,0,4],[68,0,0,0,0,0,0,0,0],[33,9],[2,64],[2,64],[32,4],[33,11],[65,19],[34,12],[33,13],[2,124],[32,13],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__Set_prototype_add')],[33,5],[12,1],[11],[32,13],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,11],[32,12],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,5],[12,1],[11],...internalThrow(scope, 'TypeError', `'add' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[26],[11],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `Tried for..of on non-iterable type`),[11,"TYPESWITCH_end"],[32,4],[65,19],[15]],
|
1468
1468
|
params: [124,127,124,127], typedParams: 1,
|
1469
1469
|
returns: [124,127], typedReturns: 1,
|
1470
1470
|
locals: [124,127,127,127,127,124,127,124,127,127], localNames: ["_this","_this#type","other","other#type","out","#last_type","forof_base_pointer","forof_length","forof_counter","x","x#type","#proto_target","#proto_target#type","#typeswitch_tmp"],
|
@@ -3738,7 +3738,7 @@ export const BuiltinFuncs = function() {
|
|
3738
3738
|
locals: [124,127], localNames: ["_this","_this#type","callbackFn","callbackFn#type","out","#last_type"],
|
3739
3739
|
};
|
3740
3740
|
this.WeakRef = {
|
3741
|
-
wasm: (scope, {builtin,internalThrow}) => [[32,-1],[184],[65,1],[33,2],[33,3],[32,2],[33,4],[2,124],[32,4],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,3],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,4],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,3],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,3],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Constructor WeakRef requires 'new'`),[11],[65,9],[16, builtin('__Porffor_allocateBytes')],[183],[34,5],[252,3],[32,0],[57,0,0],[32,5],[252,3],[32,1],[58,0,8],[32,5],[65,32],[15]],
|
3741
|
+
wasm: (scope, {builtin,internalThrow}) => [[32,-1],[184],[65,1],[33,2],[33,3],[32,2],[33,4],[2,124],[32,4],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,3],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,4],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,3],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,3],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Constructor WeakRef requires 'new'`),[11],[32,0],[32,1],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,16,64],[99],[4,64],...internalThrow(scope, 'TypeError', `Target for WeakRef needs to be an object or symbol`),[11],[65,9],[16, builtin('__Porffor_allocateBytes')],[183],[34,5],[252,3],[32,0],[57,0,0],[32,5],[252,3],[32,1],[58,0,8],[32,5],[65,32],[15]],
|
3742
3742
|
params: [124,127], typedParams: 1,
|
3743
3743
|
returns: [124,127], typedReturns: 1,
|
3744
3744
|
locals: [127,124,127,124], localNames: ["target","target#type","#last_type","#logicinner_tmp","#typeswitch_tmp","out"],
|
@@ -3750,6 +3750,57 @@ export const BuiltinFuncs = function() {
|
|
3750
3750
|
returns: [124,127], typedReturns: 1,
|
3751
3751
|
locals: [], localNames: ["_this","_this#type"],
|
3752
3752
|
};
|
3753
|
+
this.__WeakRef_prototype_toString = {
|
3754
|
+
wasm: (scope, {allocPage}) => [...number(allocPage(scope, 'bytestring: __WeakRef_prototype_toString/out', 'i8') * pageSize, 124),[34,2],[65,194,1],[15]],
|
3755
|
+
params: [124,127], typedParams: 1,
|
3756
|
+
returns: [124,127], typedReturns: 1,
|
3757
|
+
locals: [124], localNames: ["_this","_this#type","out"],
|
3758
|
+
data: [[0,[16,0,0,0,91,111,98,106,101,99,116,32,87,101,97,107,82,101,102,93]]],
|
3759
|
+
};
|
3760
|
+
this.__WeakRef_prototype_toLocaleString = {
|
3761
|
+
wasm: (scope, {builtin}) => [[32,0],[65,32],[16, builtin('__WeakRef_prototype_toString')],[34,2],[15]],
|
3762
|
+
params: [124,127], typedParams: 1,
|
3763
|
+
returns: [124,127], typedReturns: 1,
|
3764
|
+
locals: [127], localNames: ["_this","_this#type","#last_type"],
|
3765
|
+
};
|
3766
|
+
this.__WeakSet_prototype_has = {
|
3767
|
+
wasm: (scope, {builtin}) => [[32,0],[252,2],[40,0,0],[183],[33,4],[68,0,0,0,0,0,0,0,0],[33,5],[3,64],[32,5],[32,4],[99],[4,64],[2,64],[2,127,"string_only"],[32,0],[65,33],[32,5],[65,0],[16, builtin('__Porffor_set_read')],[33,6],[34,7,"string_only"],[32,2],[34,8,"string_only"],[32,6,"string_only|start"],[65,194,1],[70],[32,3],[65,194,1],[70],[113],[4,64],[32,7],[252,3],[34,9],[32,8],[252,3],[34,11],[71],[4,127],[32,9],[40,0,0],[34,10],[32,11],[40,0,0],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,12],[32,10],[33,13],[3,64],[32,12],[32,9],[106],[45,0,4],[32,12],[32,11],[106],[45,0,4],[71],[4,64],[65,0],[12,2],[11],[32,12],[65,1],[106],[34,12],[32,13],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11],[32,6],[65,194,0],[70],[32,6],[65,194,1],[70],[114],[32,3],[65,194,0],[70],[32,3],[65,194,1],[70],[114],[114],[4,64],[32,7],[252,3],[34,9],[32,8],[252,3],[34,11],[71],[4,127],[32,9],[40,0,0],[34,10],[32,11],[40,0,0],[32,6],[65,194,1],[70],[4,64],[32,9],[32,10],[16, builtin('__Porffor_bytestringToString')],[33,9],[11],[32,3],[65,194,1],[70],[4,64],[32,11],[32,11],[40,0,0],[16, builtin('__Porffor_bytestringToString')],[33,11],[11],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,12],[32,10],[65,2],[108],[33,13],[3,64],[32,12],[32,9],[106],[47,0,4],[32,12],[32,11],[106],[47,0,4],[71],[4,64],[65,0],[12,2],[11],[32,12],[65,2],[106],[34,12],[32,13],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11,"string_only|end"],[97],[11,"string_only"],[32,6],[65,128,1],[114],[32,3],[65,128,1],[114],[70],[113],[4,64],[68,0,0,0,0,0,0,240,63],[65,1],[15],[11],[11],[32,5],[68,0,0,0,0,0,0,240,63],[160],[33,5],[12,1],[11],[11],[68,0,0,0,0,0,0,0,0],[65,1],[15]],
|
3768
|
+
params: [124,127,124,127], typedParams: 1,
|
3769
|
+
returns: [124,127], typedReturns: 1,
|
3770
|
+
locals: [124,124,127,124,124,127,127,127,127,127], localNames: ["_this","_this#type","value","value#type","size","i","#last_type","__tmpop_left","__tmpop_right","compare_left_pointer","compare_left_length","compare_right_pointer","compare_index","compare_index_end"],
|
3771
|
+
};
|
3772
|
+
this.__WeakSet_prototype_add = {
|
3773
|
+
wasm: (scope, {builtin,internalThrow}) => [[32,2],[32,3],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,16,64],[99],[4,64],...internalThrow(scope, 'TypeError', `Value in WeakSet needs to be an object or symbol`),[11],[32,0],[252,2],[40,0,0],[183],[33,4],[68,0,0,0,0,0,0,0,0],[33,5],[3,64],[32,5],[32,4],[99],[4,64],[2,64],[2,127,"string_only"],[32,0],[65,33],[32,5],[65,0],[16, builtin('__Porffor_set_read')],[33,6],[34,7,"string_only"],[32,2],[34,8,"string_only"],[32,6,"string_only|start"],[65,194,1],[70],[32,3],[65,194,1],[70],[113],[4,64],[32,7],[252,3],[34,9],[32,8],[252,3],[34,11],[71],[4,127],[32,9],[40,0,0],[34,10],[32,11],[40,0,0],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,12],[32,10],[33,13],[3,64],[32,12],[32,9],[106],[45,0,4],[32,12],[32,11],[106],[45,0,4],[71],[4,64],[65,0],[12,2],[11],[32,12],[65,1],[106],[34,12],[32,13],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11],[32,6],[65,194,0],[70],[32,6],[65,194,1],[70],[114],[32,3],[65,194,0],[70],[32,3],[65,194,1],[70],[114],[114],[4,64],[32,7],[252,3],[34,9],[32,8],[252,3],[34,11],[71],[4,127],[32,9],[40,0,0],[34,10],[32,11],[40,0,0],[32,6],[65,194,1],[70],[4,64],[32,9],[32,10],[16, builtin('__Porffor_bytestringToString')],[33,9],[11],[32,3],[65,194,1],[70],[4,64],[32,11],[32,11],[40,0,0],[16, builtin('__Porffor_bytestringToString')],[33,11],[11],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,12],[32,10],[65,2],[108],[33,13],[3,64],[32,12],[32,9],[106],[47,0,4],[32,12],[32,11],[106],[47,0,4],[71],[4,64],[65,0],[12,2],[11],[32,12],[65,2],[106],[34,12],[32,13],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11,"string_only|end"],[97],[11,"string_only"],[32,6],[65,128,1],[114],[32,3],[65,128,1],[114],[70],[113],[4,64],[32,0],[65,33],[15],[11],[11],[32,5],[68,0,0,0,0,0,0,240,63],[160],[33,5],[12,1],[11],[11],[32,0],[252,2],[32,4],[68,0,0,0,0,0,0,240,63],[160],[252,2],[54,0,0],[32,0],[65,33],[32,4],[65,0],[32,2],[32,3],[16, builtin('__Porffor_set_write')],[33,6],[26],[32,0],[65,33],[15]],
|
3774
|
+
params: [124,127,124,127], typedParams: 1,
|
3775
|
+
returns: [124,127], typedReturns: 1,
|
3776
|
+
locals: [124,124,127,124,124,127,127,127,127,127], localNames: ["_this","_this#type","value","value#type","size","i","#last_type","__tmpop_left","__tmpop_right","compare_left_pointer","compare_left_length","compare_right_pointer","compare_index","compare_index_end"],
|
3777
|
+
};
|
3778
|
+
this.__WeakSet_prototype_delete = {
|
3779
|
+
wasm: (scope, {builtin}) => [[32,0],[252,2],[40,0,0],[183],[33,4],[68,0,0,0,0,0,0,0,0],[33,5],[3,64],[32,5],[32,4],[99],[4,64],[2,64],[2,127,"string_only"],[32,0],[65,33],[32,5],[65,0],[16, builtin('__Porffor_set_read')],[33,6],[34,7,"string_only"],[32,2],[34,8,"string_only"],[32,6,"string_only|start"],[65,194,1],[70],[32,3],[65,194,1],[70],[113],[4,64],[32,7],[252,3],[34,9],[32,8],[252,3],[34,11],[71],[4,127],[32,9],[40,0,0],[34,10],[32,11],[40,0,0],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,12],[32,10],[33,13],[3,64],[32,12],[32,9],[106],[45,0,4],[32,12],[32,11],[106],[45,0,4],[71],[4,64],[65,0],[12,2],[11],[32,12],[65,1],[106],[34,12],[32,13],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11],[32,6],[65,194,0],[70],[32,6],[65,194,1],[70],[114],[32,3],[65,194,0],[70],[32,3],[65,194,1],[70],[114],[114],[4,64],[32,7],[252,3],[34,9],[32,8],[252,3],[34,11],[71],[4,127],[32,9],[40,0,0],[34,10],[32,11],[40,0,0],[32,6],[65,194,1],[70],[4,64],[32,9],[32,10],[16, builtin('__Porffor_bytestringToString')],[33,9],[11],[32,3],[65,194,1],[70],[4,64],[32,11],[32,11],[40,0,0],[16, builtin('__Porffor_bytestringToString')],[33,11],[11],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,12],[32,10],[65,2],[108],[33,13],[3,64],[32,12],[32,9],[106],[47,0,4],[32,12],[32,11],[106],[47,0,4],[71],[4,64],[65,0],[12,2],[11],[32,12],[65,2],[106],[34,12],[32,13],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11,"string_only|end"],[97],[11,"string_only"],[32,6],[65,128,1],[114],[32,3],[65,128,1],[114],[70],[113],[4,64],[32,0],[252,2],[32,4],[68,0,0,0,0,0,0,240,63],[161],[252,2],[54,0,0],[32,5],[252,3],[65,9],[108],[32,0],[252,3],[106],[65,4],[106],[34,14],[32,14],[65,9],[106],[32,4],[32,5],[161],[252,3],[65,1],[107],[65,9],[108],[252,10,0,0],[68,0,0,0,0,0,0,240,63],[65,1],[15],[11],[11],[32,5],[68,0,0,0,0,0,0,240,63],[160],[33,5],[12,1],[11],[11],[68,0,0,0,0,0,0,0,0],[65,1],[15]],
|
3780
|
+
params: [124,127,124,127], typedParams: 1,
|
3781
|
+
returns: [124,127], typedReturns: 1,
|
3782
|
+
locals: [124,124,127,124,124,127,127,127,127,127,127], localNames: ["_this","_this#type","value","value#type","size","i","#last_type","__tmpop_left","__tmpop_right","compare_left_pointer","compare_left_length","compare_right_pointer","compare_index","compare_index_end","offset"],
|
3783
|
+
};
|
3784
|
+
this.WeakSet = {
|
3785
|
+
wasm: (scope, {builtin,internalThrow}) => [[32,-1],[184],[65,1],[33,2],[33,3],[32,2],[33,4],[2,124],[32,4],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,3],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,4],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,3],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,3],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],...internalThrow(scope, 'TypeError', `Constructor Set requires 'new'`),[11],[16, builtin('__Porffor_allocate')],[33,2],[33,5],[32,0],[32,1],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[98],[4,64],[32,0],[252,3],[33,6],[65,0],[33,8],[32,6],[40,1,0],[33,7],[32,1],[33,4],[2,64],[32,4],[65,19],[70],[4,64,"TYPESWITCH|Set"],[3,64],[32,6],[43,0,4],[32,6],[45,0,12],[33,10],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,6],[65,9],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[65,194,0],[33,10],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,6],[47,0,4],[59,0,4],[68,0,0,0,0,0,0,0,0],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,6],[65,2],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[3,64],[32,6],[43,0,4],[32,6],[45,0,12],[33,10],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,6],[65,9],[106],[33,6],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[45,0,4],[184],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[44,0,4],[183],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[106],[45,0,4],[184],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,2],[108],[106],[47,0,4],[184],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,2],[108],[106],[46,0,4],[183],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[40,0,4],[184],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[40,0,4],[183],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,4],[108],[106],[42,0,4],[187],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[65,0],[33,10],[3,64],[32,6],[40,0,4],[32,8],[65,8],[108],[106],[43,0,4],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],[32,4],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[65,194,1],[33,10],[65,0],[65,1],[54,0,0],[3,64],[65,0],[32,6],[32,8],[106],[45,0,4],[58,0,4],[68,0,0,0,0,0,0,0,0],[33,9],[2,64],[32,5],[65,33],[32,9],[32,10],[16, builtin('__WeakSet_prototype_add')],[33,2],[26],[32,8],[65,1],[106],[34,8],[32,7],[71],[13,1],[11],[11],[12,1],[11],...internalThrow(scope, 'TypeError', `Tried for..of on non-iterable type`),[11,"TYPESWITCH_end"],[11],[32,5],[65,33],[15]],
|
3786
|
+
params: [124,127], typedParams: 1,
|
3787
|
+
returns: [124,127], typedReturns: 1,
|
3788
|
+
locals: [127,124,127,124,127,127,127,124,127], localNames: ["iterable","iterable#type","#last_type","#logicinner_tmp","#typeswitch_tmp","out","forof_base_pointer","forof_length","forof_counter","x","x#type"],
|
3789
|
+
constr: 1,
|
3790
|
+
};
|
3791
|
+
this.__WeakSet_prototype_toString = {
|
3792
|
+
wasm: (scope, {allocPage}) => [...number(allocPage(scope, 'bytestring: __WeakSet_prototype_toString/out', 'i8') * pageSize, 124),[34,2],[65,194,1],[15]],
|
3793
|
+
params: [124,127], typedParams: 1,
|
3794
|
+
returns: [124,127], typedReturns: 1,
|
3795
|
+
locals: [124], localNames: ["_this","_this#type","out"],
|
3796
|
+
data: [[0,[16,0,0,0,91,111,98,106,101,99,116,32,87,101,97,107,83,101,116,93]]],
|
3797
|
+
};
|
3798
|
+
this.__WeakSet_prototype_toLocaleString = {
|
3799
|
+
wasm: (scope, {builtin}) => [[32,0],[65,33],[16, builtin('__WeakSet_prototype_toString')],[34,2],[15]],
|
3800
|
+
params: [124,127], typedParams: 1,
|
3801
|
+
returns: [124,127], typedReturns: 1,
|
3802
|
+
locals: [127], localNames: ["_this","_this#type","#last_type"],
|
3803
|
+
};
|
3753
3804
|
this.__ecma262_ToIntegerOrInfinity = {
|
3754
3805
|
wasm: (scope, {builtin}) => [[65,0],[32,0],[16, builtin('Number')],[34,2],[16, builtin('__Number_isNaN')],[252,3],[4,64],[68,0,0,0,0,0,0,0,0],[65,0],[15],[11],[32,2],[16, builtin('__Number_isFinite')],[68,0,0,0,0,0,0,0,0],[97],[4,64],[32,2],[65,0],[15],[11],[32,2],[16, builtin('__Math_trunc')],[34,2],[68,0,0,0,0,0,0,0,0],[97],[4,64],[68,0,0,0,0,0,0,0,0],[65,0],[15],[11],[32,2],[65,0],[15]],
|
3755
3806
|
params: [124,127], typedParams: 1,
|
@@ -3757,7 +3808,7 @@ export const BuiltinFuncs = function() {
|
|
3757
3808
|
locals: [124], localNames: ["argument","argument#type","number"],
|
3758
3809
|
};
|
3759
3810
|
this.__ecma262_ToString = {
|
3760
|
-
wasm: (scope, {allocPage,builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,3],[33,2],[32,0],[32,1],[16, builtin('__Porffor_rawType')],[34,4],[68,0,0,0,0,0,128,80,64],[97],[32,4],[68,0,0,0,0,0,64,104,64],[97],[114],[4,64],[32,0],[32,1],[15],[11],[32,4],[68,0,0,0,0,0,0,24,64],[97],[4,64],...internalThrow(scope, 'TypeError', `Cannot convert a Symbol value to a string`),[11],[32,4],[68,0,0,0,0,0,0,8,64],[97],[4,64],...number(allocPage(scope, 'bytestring: __ecma262_ToString/out', 'i8') * pageSize, 124),[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,16,64],[97],[32,0],[68,0,0,0,0,0,0,0,0],[97],[113],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,238,0],[58,0,4],[32,5],[65,245,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,236,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,0],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,244,0],[58,0,4],[32,5],[65,242,0],[58,0,5],[32,5],[65,245,0],[58,0,6],[32,5],[65,229,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,2],[252,3],[34,5],[65,5],[54,1,0],[32,5],[65,230,0],[58,0,4],[32,5],[65,225,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,243,0],[58,0,7],[32,5],[65,229,0],[58,0,8],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,0],[33,6],[32,1],[34,7],[33,8],[2,124],[32,8],[65,0],[70],[4,64,"TYPESWITCH|Number"],[32,6],[32,7],[68,0,0,0,0,0,0,0,0],[65,3],[16, builtin('__Number_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,1],[70],[4,64,"TYPESWITCH|Boolean"],[32,6],[32,7],[16, builtin('__Boolean_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,4],[70],[4,64,"TYPESWITCH|Object"],[32,6],[32,7],[16, builtin('__Object_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,5],[70],[4,64,"TYPESWITCH|Function"],[32,6],[32,7],[16, builtin('__Function_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,6],[70],[4,64,"TYPESWITCH|Symbol"],[32,6],[32,7],[16, builtin('__Symbol_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,18],[70],[4,64,"TYPESWITCH|Date"],[32,6],[32,7],[16, builtin('__Date_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,6],[32,7],[16, builtin('__Set_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,6],[252,2],[32,7],[16, builtin('__String_prototype_toString')],[33,3],[183],[12,1],[11],[32,8],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,6],[32,7],[16, builtin('__Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,6],[32,7],[16, builtin('__Uint8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,6],[32,7],[16, builtin('__Int8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,6],[32,7],[16, builtin('__Uint8ClampedArray_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,6],[32,7],[16, builtin('__Uint16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,6],[32,7],[16, builtin('__Int16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,6],[32,7],[16, builtin('__Uint32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,6],[32,7],[16, builtin('__Int32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,6],[32,7],[16, builtin('__Float32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,6],[32,7],[16, builtin('__Float64Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,6],[252,2],[32,7],[16, builtin('__ByteString_prototype_toString')],[33,3],[183],[12,1],[11],...internalThrow(scope, 'TypeError', `'toString' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[32,3],[15]],
|
3811
|
+
wasm: (scope, {allocPage,builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,3],[33,2],[32,0],[32,1],[16, builtin('__Porffor_rawType')],[34,4],[68,0,0,0,0,0,128,80,64],[97],[32,4],[68,0,0,0,0,0,64,104,64],[97],[114],[4,64],[32,0],[32,1],[15],[11],[32,4],[68,0,0,0,0,0,0,24,64],[97],[4,64],...internalThrow(scope, 'TypeError', `Cannot convert a Symbol value to a string`),[11],[32,4],[68,0,0,0,0,0,0,8,64],[97],[4,64],...number(allocPage(scope, 'bytestring: __ecma262_ToString/out', 'i8') * pageSize, 124),[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,16,64],[97],[32,0],[68,0,0,0,0,0,0,0,0],[97],[113],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,238,0],[58,0,4],[32,5],[65,245,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,236,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,0],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,244,0],[58,0,4],[32,5],[65,242,0],[58,0,5],[32,5],[65,245,0],[58,0,6],[32,5],[65,229,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,2],[252,3],[34,5],[65,5],[54,1,0],[32,5],[65,230,0],[58,0,4],[32,5],[65,225,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,243,0],[58,0,7],[32,5],[65,229,0],[58,0,8],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,0],[33,6],[32,1],[34,7],[33,8],[2,124],[32,8],[65,0],[70],[4,64,"TYPESWITCH|Number"],[32,6],[32,7],[68,0,0,0,0,0,0,0,0],[65,3],[16, builtin('__Number_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,1],[70],[4,64,"TYPESWITCH|Boolean"],[32,6],[32,7],[16, builtin('__Boolean_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,4],[70],[4,64,"TYPESWITCH|Object"],[32,6],[32,7],[16, builtin('__Object_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,5],[70],[4,64,"TYPESWITCH|Function"],[32,6],[32,7],[16, builtin('__Function_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,6],[70],[4,64,"TYPESWITCH|Symbol"],[32,6],[32,7],[16, builtin('__Symbol_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,18],[70],[4,64,"TYPESWITCH|Date"],[32,6],[32,7],[16, builtin('__Date_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,6],[32,7],[16, builtin('__Set_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,6],[32,7],[16, builtin('__WeakSet_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,6],[252,2],[32,7],[16, builtin('__String_prototype_toString')],[33,3],[183],[12,1],[11],[32,8],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,6],[32,7],[16, builtin('__Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,6],[32,7],[16, builtin('__Uint8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,6],[32,7],[16, builtin('__Int8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,6],[32,7],[16, builtin('__Uint8ClampedArray_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,6],[32,7],[16, builtin('__Uint16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,6],[32,7],[16, builtin('__Int16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,6],[32,7],[16, builtin('__Uint32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,6],[32,7],[16, builtin('__Int32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,6],[32,7],[16, builtin('__Float32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,6],[32,7],[16, builtin('__Float64Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,6],[252,2],[32,7],[16, builtin('__ByteString_prototype_toString')],[33,3],[183],[12,1],[11],...internalThrow(scope, 'TypeError', `'toString' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[32,3],[15]],
|
3761
3812
|
params: [124,127], typedParams: 1,
|
3762
3813
|
returns: [124,127], typedReturns: 1,
|
3763
3814
|
locals: [124,127,124,127,124,127,127], localNames: ["argument","argument#type","out","#last_type","type","#makearray_pointer_tmp","#proto_target","#proto_target#type","#typeswitch_tmp"],
|
package/compiler/types.js
CHANGED
@@ -67,4 +67,5 @@ registerInternalType('Int32Array', ['iterable', 'length']);
|
|
67
67
|
registerInternalType('Float32Array', ['iterable', 'length']);
|
68
68
|
registerInternalType('Float64Array', ['iterable', 'length']);
|
69
69
|
|
70
|
-
registerInternalType('WeakRef');
|
70
|
+
registerInternalType('WeakRef');
|
71
|
+
registerInternalType('WeakSet');
|
package/compiler/wrap.js
CHANGED
@@ -162,6 +162,21 @@ const porfToJSValue = ({ memory, funcs, pages }, value, type) => {
|
|
162
162
|
return new WeakRef(porfToJSValue({ memory, funcs, pages }, v, t));
|
163
163
|
}
|
164
164
|
|
165
|
+
case TYPES.weakset: {
|
166
|
+
const size = (new Uint32Array(memory.buffer, value, 1))[0];
|
167
|
+
|
168
|
+
const out = new WeakSet();
|
169
|
+
for (let i = 0; i < size; i++) {
|
170
|
+
const offset = value + 4 + (i * 9);
|
171
|
+
const v = (new Float64Array(memory.buffer.slice(offset, offset + 8), 0, 1))[0];
|
172
|
+
const t = (new Uint8Array(memory.buffer, offset + 8, 1))[0];
|
173
|
+
|
174
|
+
out.add(porfToJSValue({ memory, funcs, pages }, v, t));
|
175
|
+
}
|
176
|
+
|
177
|
+
return out;
|
178
|
+
}
|
179
|
+
|
165
180
|
default: return value;
|
166
181
|
}
|
167
182
|
};
|
package/package.json
CHANGED