Closed Bug 1215473 Opened 4 years ago Closed 4 years ago
Avoid accessing private variable places
Store in history Data Adapter
46 bytes, text/x-github-pull-request
|Details | Review|
At this line  and also two lines below, `store` is not defined.  https://github.com/mozilla-b2g/gaia/blob/4d1ff2b17850c3ec3d9c6869b73e9a45e4338db4/apps/sync/js/adapters/bookmarks.js#L123
Assignee: nobody → mbdejong
Needs a unit test, still.
The reason this is currently working is that ensureStore uses a variable that's also called 'store'. We could leave this as it is, but I think it's cleaner to rename the private variable to _store, and force the rest of the code to always use the value provided ensureStore, instead of sometimes accessing the private variable directly.
Comment on attachment 8674818 [details] [review] [gaia] michielbdejong:1215473-store-variable-in-scope > mozilla-b2g:master Hello Michiel, I leave some comments at github. BTW, how do you think if keeping store as a local variable in addBookmark function? Please f? or r? me again once you have any update. Thank you!
I am going to implement this in bug 1215086.
Attachment #8674818 - Flags: review?(selee)
Comment on attachment 8674818 [details] [review] [gaia] michielbdejong:1215473-store-variable-in-scope > mozilla-b2g:master LGTM :)
Attachment #8674818 - Flags: review?(selee) → review+
Priority: -- → P1
Target Milestone: --- → FxOS-S10 (30Oct)
Summary: 'store is not defined' error in history DataAdapter → Avoid accessing private variable placesStore in history DataAdapter
Marking this as P3 / Sprint 11 because it's code cleanup and doesn't affect functionality.
Priority: P2 → P3
Target Milestone: FxOS-S10 (30Oct) → FxOS-S11 (13Nov)
Attachment #8674818 - Flags: review+ → review?(ferjmoreno)
Attachment #8674818 - Flags: review?(ferjmoreno) → review+
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.