js-runtime: Add Object.attributeCount to get the number of user added

attributes to that object
This commit is contained in:
iddev5 2022-07-08 18:02:54 +05:30 committed by Stephen Gutekanst
parent 1919595adc
commit e8f5ca9117
2 changed files with 10 additions and 0 deletions

View file

@ -252,6 +252,11 @@ const zig = {
delete values[id][index];
},
zigGetAttributeCount(id) {
let obj = values[id];
return Object.keys(obj).length;
},
zigCleanupObject(id) {
const idx = Number(id);
delete value_map[values[idx].__uindex];