Closed
Bug 499871
Opened 16 years ago
Closed 16 years ago
Simple storage improvements
Categories
(Mozilla Labs :: Jetpack Prototype, defect, P1)
Mozilla Labs
Jetpack Prototype
Tracking
(Not tracked)
RESOLVED
FIXED
0.3
People
(Reporter: aza, Assigned: adw)
References
Details
Attachments
(2 files, 5 obsolete files)
|
60.88 KB,
patch
|
Details | Diff | Splinter Review | |
|
660 bytes,
patch
|
Details | Diff | Splinter Review |
As Myk suggests in his post <http://groups.google.com/group/mozilla-labs-jetpack/browse_thread/thread/8813c5da5b135bf3> adding a |has| and |list| commands to storage.simple would be excellent additions.
First, |has| and |list| should be added to JEP 11 <https://wiki.mozilla.org/Labs/Jetpack/JEP/11> and then added to the actual API. Finally, the documentation should be updated.
| Reporter | ||
Updated•16 years ago
|
Priority: -- → P1
Target Milestone: -- → 0.3
| Assignee | ||
Comment 1•16 years ago
|
||
Lots of changes. Since the code is fairly small and changes in this bug and bug 499872 overlap, this patch covers both bugs (plus some).
This patch adds the following methods:
clear
forEachItem
forEachKey
forEachValue
has
size
Nearly every method can be called multiple ways, e.g., to act on a single key or value, a set of keys, or all items. They're documented, so have a look.
Needs a little more polish.
| Assignee | ||
Updated•16 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
| Assignee | ||
Comment 2•16 years ago
|
||
A little more polish to go, like filtering out bad keys (actually, bad keys should cause an error to be thrown I'm thinking) and making sure values can't be null anymore, since null is now used to signify async completion for the forEach methods. I've updated the tests for the new methods, but I could write more stress tests with bad keys and values.
Attachment #385962 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•16 years ago
|
||
This patch adds polish, tests, and the methods keys and values, which yield the store's keys and values in arrays.
Attachment #385980 -
Attachment is obsolete: true
| Assignee | ||
Comment 4•16 years ago
|
||
I've gone overboard, morphing the bug accordingly.
Summary: Integrate |has| and |list| into simple storage. → Simple storage improvements
| Assignee | ||
Comment 6•16 years ago
|
||
has() wasn't passing key and keyArray back to callbacks, fixed that. A couple of other small fixes. JEP update forthcoming.
Attachment #386223 -
Attachment is obsolete: true
| Assignee | ||
Comment 7•16 years ago
|
||
Uh, has() didn't need to pass keyArray to the callback. The callback gets existsObject.
| Assignee | ||
Updated•16 years ago
|
Attachment #386332 -
Attachment is obsolete: true
| Assignee | ||
Comment 8•16 years ago
|
||
Comment on attachment 386379 [details] [diff] [review]
for your consideration v3
Will attach new version shortly.
Attachment #386379 -
Attachment is obsolete: true
| Assignee | ||
Comment 9•16 years ago
|
||
Allows passing a key array to values() to get specific values in an array. Adds mapItems() and reduceItems() and tightens up the code by using these internally. Updated the JEP with these changes also.
| Reporter | ||
Comment 10•16 years ago
|
||
Hi Drew,
Do you need us to commit this? Have we given you commit access yet?
| Assignee | ||
Comment 11•16 years ago
|
||
Yes, please commit as it's ready to go. I'm still at the kid's table.
| Reporter | ||
Comment 12•16 years ago
|
||
Has been applied in this push: http://hg.mozilla.org/labs/jetpack/rev/34fb13b648b1
| Assignee | ||
Comment 13•16 years ago
|
||
Simply adds simple storage to extension/index.html.
| Assignee | ||
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•