Closed Bug 1081254 Opened 10 years ago Closed 10 years ago

Implement update in Bookmarks.jsm

Categories

(Toolkit :: Places, defect)

defect
Not set
normal
Points:
5

Tracking

()

RESOLVED FIXED
mozilla36
Iteration:
36.1

People

(Reporter: mak, Assigned: mak)

References

(Blocks 1 open bug)

Details

Attachments

(1 obsolete file)

We still need to implement this API.
Flags: qe-verify-
Flags: in-testsuite?
Flags: firefox-backlog+
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Iteration: --- → 35.3
Attached patch patch v1 (obsolete) — Splinter Review
Attachment #8504561 - Flags: review?(mano)
Iteration: 35.3 → 36.1
Comment on attachment 8504561 [details] [diff] [review]
patch v1

Review of attachment 8504561 [details] [diff] [review]:
-----------------------------------------------------------------

Please merge this patch with the main implementation patch. I prefer to review the next revisions a single patch.

::: toolkit/components/places/Bookmarks.jsm
@@ +158,5 @@
>          info.index = parent._childCount;
>        }
>  
>        let item = yield insertBookmark(info, parent);
> +      return copyPropsForOutput(info, item);

See my comments in the main bug. I'm not sure this makes sense (same goes for the other methods).

@@ +200,2 @@
>      return Task.spawn(function* () {
> +      // We must ensure the item exists.

s/We must ensure/Ensure/

@@ +207,5 @@
> +      if (info.dateAdded && info.dateAdded.getTime() != item.dateAdded.getTime())
> +        throw new Error("The bookmark dateAdded cannot be changed");
> +
> +      // Remove any property that will stay the same.
> +      removeSameValueProperties(info, item);

It seems removeSameValueProperties expects info.url to be a URL object already at this point, but you validate it afterwards. Or is it validated anyway, and the later check just ensure it's a bookmark? In any event, you should document this two-stages validation a little bit.

@@ +219,5 @@
> +                                                       validIf: b => b.lastModified >= item.dateAdded }
> +                                     });
> +
> +        let parent;
> +        if ("parentGuid" in info) {

if you use getOwnPropertyNames as you do, prefer hasOwenProperty, here and elsewhere.
Attachment #8504561 - Flags: review?(mano) → feedback+
Comment on attachment 8504561 [details] [diff] [review]
patch v1

Patch merged into Bug 1068009.
Attachment #8504561 - Attachment is obsolete: true
Depends on: 1068009
Flags: in-testsuite? → in-testsuite+
Target Milestone: --- → mozilla36
fixed by Bug 1068009.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: