Bug 977016 - PlacesUtils.jsm should use Cu.cloneInto() rather than JSON.stringify/parse r=mak
authorTim Taubert <ttaubert@mozilla.com>
Wed, 26 Feb 2014 11:59:37 +0100
changeset 171091 7a4919b448ef5610e6feaf0acd29d5745623bd6d
parent 171090 319fd4968916c4974401f532e0583eb90bed6a85
child 171092 ca871fe4c350bc5420206876974aa759e71b15fc
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmak
bugs977016
milestone30.0a1
Bug 977016 - PlacesUtils.jsm should use Cu.cloneInto() rather than JSON.stringify/parse r=mak
toolkit/components/places/PlacesUtils.jsm
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -1948,17 +1948,17 @@ TransactionItemCache.prototype = {
   get siteURI()
     this._siteURI || null,
   set index(v)
     this._index = (parseInt(v) >= 0 ? v : null),
   // Index can be 0.
   get index()
     this._index != null ? this._index : PlacesUtils.bookmarks.DEFAULT_INDEX,
   set annotations(v)
-    this._annotations = Array.isArray(v) ? JSON.parse(JSON.stringify(v)) : null,
+    this._annotations = Array.isArray(v) ? Cu.cloneInto(v, {}) : null,
   get annotations()
     this._annotations || null,
   set tags(v)
     this._tags = (v && Array.isArray(v) ? Array.slice(v) : null),
   get tags()
     this._tags || null,
 };