author | Jared Wein <jwein@mozilla.com> |
Mon, 23 Mar 2015 16:45:58 -0400 | |
changeset 235344 | c521d136b0f3d0c1e401ed502de5a2be9756f2cb |
parent 235343 | 3ec9f77647f6116c1720bb5f9367b36e7c61eab2 |
child 235345 | 06f1b43f5a7b8f5cba9bb4ae18cdc488946154ff |
push id | 57400 |
push user | ryanvm@gmail.com |
push date | Tue, 24 Mar 2015 15:59:13 +0000 |
treeherder | mozilla-inbound@47fa87252df0 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | adw |
bugs | 1146358 |
milestone | 39.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/components/readinglist/ReadingList.jsm +++ b/browser/components/readinglist/ReadingList.jsm @@ -53,16 +53,27 @@ const ITEM_RECORD_PROPERTIES = ` addedBy addedOn storedOn markedReadBy markedReadOn readPosition `.trim().split(/\s+/); +// Article objects that are passed to ReadingList.addItem may contain +// some properties that are known but are not currently stored in the +// ReadingList records. This is the list of properties that are knowingly +// disregarded before the item is normalized. +const ITEM_DISREGARDED_PROPERTIES = ` + byline + dir + content + length +`.trim().split(/\s+/); + /** * A reading list contains ReadingListItems. * * A list maintains only one copy of an item per URL. So if for example you use * an iterator to get two references to items with the same URL, your references * actually refer to the same JS object. * * Options Objects @@ -848,16 +859,19 @@ ReadingListItemIterator.prototype = { * aren't in ITEM_RECORD_PROPERTIES. * * @param record A non-normalized record object. * @return The new normalized record. */ function normalizeRecord(nonNormalizedRecord) { let record = {}; for (let prop in nonNormalizedRecord) { + if (ITEM_DISREGARDED_PROPERTIES.includes(prop)) { + continue; + } if (!ITEM_RECORD_PROPERTIES.includes(prop)) { throw new Error("Unrecognized item property: " + prop); } switch (prop) { case "url": case "resolvedURL": if (nonNormalizedRecord[prop]) { record[prop] = normalizeURI(nonNormalizedRecord[prop]).spec;