diff options
Diffstat (limited to 'src/z/App/object-store.js')
| -rw-r--r-- | src/z/App/object-store.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/z/App/object-store.js b/src/z/App/object-store.js index ae581f8..096d085 100644 --- a/src/z/App/object-store.js +++ b/src/z/App/object-store.js @@ -1,6 +1,4 @@ class ObjectStore { - static id_name = "@id"; - static types = Object.freeze({ 0: "uninit", 1: "object", @@ -42,8 +40,8 @@ class ObjectStore { } static free(target) { - const id = target[ObjectStore.id_name]; - delete target[ObjectStore.id_name]; + const id = target[ZsId]; + delete target[ZsId]; delete ObjectStore.store[id]; } @@ -118,7 +116,7 @@ class ObjectStore { static registerObject(id, obj) { ObjectStore.store[id] = obj; - Object.defineProperty(obj, ObjectStore.id_name, { + Object.defineProperty(obj, ZsId, { enumerable: false, writable: false, configurable: true, @@ -131,7 +129,7 @@ class ObjectStore { if (typeof value === 'object' || typeof value === 'function') { mem.setUint8(0, ObjectStore.types['object'], true); - let id = value == null ? 0 : value[ObjectStore.id_name]; + let id = value == null ? 0 : value[ZsId]; if (id === undefined) { id = ObjectStore.generateFreeId(); |