Bug 1407164 - Fix strict warnings in Bookmarks.jsm relating to undefined property source - don't delete item properties too soon. r=mak

MozReview-Commit-ID: AJJRSHYqPch

--HG--
extra : rebase_source : bb2d043215be9e2493ddd5dff452999dd95d1db2
This commit is contained in:
Mark Banner 2017-10-10 09:13:19 +01:00
Родитель ef74dc495c
Коммит f1daedfa92
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -478,14 +478,14 @@ var Bookmarks = Object.freeze({
PlacesUtils.toPRTime(item.dateAdded), item.guid,
item.parentGuid, item.source ],
{ isTagging: false });
// Remove non-enumerable properties.
delete item.source;
// Note, annotations for livemark data are deleted from insertInfo
// within appendInsertionInfoForInfoArray, so we won't be duplicating
// the insertions here.
await handleBookmarkItemSpecialData(itemId, item);
// Remove non-enumerable properties.
delete item.source;
insertInfos[i] = Object.assign({}, item);
}
return insertInfos;
@ -1548,7 +1548,7 @@ async function handleBookmarkItemSpecialData(itemId, item) {
}
if ("tags" in item) {
try {
PlacesUtils.tagging.tagURI(NetUtil.newURI(item.url), item.tags, item._source);
PlacesUtils.tagging.tagURI(NetUtil.newURI(item.url), item.tags, item.source);
} catch (ex) {
// Invalid tag child, skip it.
Cu.reportError(`Unable to set tags "${item.tags.join(", ")}" for ${item.url}: ${ex}`);