013af36855
This behavior of JS has some implications for how interface code handles things like deletes. The following won't do what one might expect/desire (and my apologies if this is obvious or redundant, but I figure it's worth pointing out): var item = Scholar.Items.get(1); Scholar.debug(item); Scholar.DB.query("DELETE FROM items WHERE itemID=1"); Scholar.Items.reloadAll(); Scholar.debug(item); The last line will still display the old object, even though _items[1] has been deleted inside Scholar.Items. The following does work, however: var item = Scholar.Items.get(1); Scholar.debug(item); Scholar.DB.query("DELETE FROM items WHERE itemID=1"); Scholar.Items.reloadAll(); var item = Scholar.Items.get(1); Scholar.debug(item); Now item is properly undefined. Moral of the story: object references need to be deleted manually after receiving delete notifications, for if external code still has references to deleted data objects, the data layer can't do much about it. |
||
---|---|---|
.. | ||
ingester | ||
test | ||
xpcom | ||
folderTreeView.js | ||
include.js | ||
itemTreeView.js | ||
metadataPane.js | ||
metadataPane.xul | ||
overlay.js | ||
overlay.xul | ||
preferences.js | ||
preferences.xul |