porffor 0.18.29 → 0.18.30
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.
@@ -3,6 +3,9 @@ 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
|
+
const targetType: i32 = Porffor.rawType(target);
|
7
|
+
if (Porffor.fastOr(targetType < 0x04)) throw new TypeError('Target for WeakRef needs to be an object or symbol');
|
8
|
+
|
6
9
|
const out: WeakRef = Porffor.allocateBytes(9);
|
7
10
|
|
8
11
|
Porffor.wasm`local.get ${out}
|
@@ -3738,10 +3738,10 @@ 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,
|
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')],[34,5],[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,6],[252,3],[32,0],[57,0,0],[32,6],[252,3],[32,1],[58,0,8],[32,6],[65,32],[15]],
|
3742
3742
|
params: [124,127], typedParams: 1,
|
3743
3743
|
returns: [124,127], typedReturns: 1,
|
3744
|
-
locals: [127,124,127,124], localNames: ["target","target#type","#last_type","#logicinner_tmp","#typeswitch_tmp","out"],
|
3744
|
+
locals: [127,124,127,124,124], localNames: ["target","target#type","#last_type","#logicinner_tmp","#typeswitch_tmp","targetType","out"],
|
3745
3745
|
constr: 1,
|
3746
3746
|
};
|
3747
3747
|
this.__WeakRef_prototype_deref = {
|
package/package.json
CHANGED