porffor 0.30.6 → 0.30.7
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.
@@ -391,7 +391,13 @@ local.set ${err}`;
|
|
391
391
|
0, 12);
|
392
392
|
};
|
393
393
|
|
394
|
-
export const __Porffor_object_delete = (obj:
|
394
|
+
export const __Porffor_object_delete = (obj: any, key: any): boolean => {
|
395
|
+
if (Porffor.wasm`local.get ${obj}` == 0) throw new TypeError('Cannot delete property of null');
|
396
|
+
if (Porffor.rawType(obj) != Porffor.TYPES.object) {
|
397
|
+
// todo: support non-pure objects
|
398
|
+
return true;
|
399
|
+
}
|
400
|
+
|
395
401
|
const entryPtr: i32 = __Porffor_object_lookup(obj, key);
|
396
402
|
if (entryPtr == -1) {
|
397
403
|
// not found, stop
|
@@ -75,7 +75,7 @@ export const BuiltinFuncs = function() {
|
|
75
75
|
locals: [127,127,127,127,127,127,127,127], localNames: ["obj","obj#type","key","key#type","value","value#type","flags","flags#type","entryPtr","#last_type","#logicinner_tmp","#typeswitch_tmp1","size","tail","err","logictmp"],
|
76
76
|
};
|
77
77
|
this.__Porffor_object_delete = {
|
78
|
-
wasm: (scope, {builtin}) => [[32,0],[65,7],[32,2],[32,3],[16, builtin('__Porffor_object_lookup')],[26],[34,4],[65,127],[70],[4,64],[65,1],[65,2],[15],[11],[32,4],[47,0,12],[34,6],[65,2],[113],[69],[4,64],[65,0],[65,2],[15],[11],[32,4],[32,0],[107],[65,14],[109],[33,7],[32,0],[40,0,0],[33,8],[32,0],[32,8],[65,1],[107],[34,8],[54,0,0],[32,8],[32,7],[74],[4,64],[32,4],[32,4],[65,14],[106],[32,8],[32,7],[107],[65,14],[108],[252,10,0,0],[11],[65,1],[65,2],[15]],
|
78
|
+
wasm: (scope, {builtin,internalThrow}) => [[32,0],[69],[4,64],...internalThrow(scope, 'TypeError', `Cannot delete property of null`),[11],[32,1],[65,7],[71],[4,64],[65,1],[65,2],[15],[11],[32,0],[32,1],[32,2],[32,3],[16, builtin('__Porffor_object_lookup')],[26],[34,4],[65,127],[70],[4,64],[65,1],[65,2],[15],[11],[32,4],[47,0,12],[34,6],[65,2],[113],[69],[4,64],[65,0],[65,2],[15],[11],[32,4],[32,0],[107],[65,14],[109],[33,7],[32,0],[40,0,0],[33,8],[32,0],[32,8],[65,1],[107],[34,8],[54,0,0],[32,8],[32,7],[74],[4,64],[32,4],[32,4],[65,14],[106],[32,8],[32,7],[107],[65,14],[108],[252,10,0,0],[11],[65,1],[65,2],[15]],
|
79
79
|
params: [127,127,127,127], typedParams: 1,
|
80
80
|
returns: [127,127], typedReturns: 1,
|
81
81
|
locals: [127,127,127,127,127], localNames: ["obj","obj#type","key","key#type","entryPtr","#last_type","tail","ind","size"],
|
package/package.json
CHANGED