Bug 1346797 - Fix calendar eslint issues - Fix no-eval issues. r=MakeMyDay
authoreslint <eslint@bugzilla.kewis.ch>
Sun, 30 Jul 2017 13:36:57 +0200
changeset 22302 938e0676a3cd4e0b1af046d115d2f224bc87a749
parent 22301 19af38e2d4b143f9d671a885be48eb0610e521d3
child 22303 72d3386335959217ebe27c56b2b4d1c250763f3a
push id13598
push usermozilla@jorgk.com
push dateSun, 08 Oct 2017 20:54:24 +0000
treeherdercomm-central@86066f04ca11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMakeMyDay
bugs1346797
Bug 1346797 - Fix calendar eslint issues - Fix no-eval issues. r=MakeMyDay MozReview-Commit-ID: DV26qbc5Gxt
calendar/providers/storage/calStorageUpgrade.jsm
--- a/calendar/providers/storage/calStorageUpgrade.jsm
+++ b/calendar/providers/storage/calStorageUpgrade.jsm
@@ -484,17 +484,17 @@ function deleteColumns(tblData, tblName,
  * @param tblName       The table name to copy
  * @param newTblName    The target table name.
  * @param db            (optional) The database to apply the operation on
  * @param condition     (optional) The condition to respect when copying
  * @param selectOptions (optional) Extra options for the SELECT, i.e DISTINCT
  */
 function copyTable(tblData, tblName, newTblName, db, condition, selectOptions) {
     function objcopy(obj) {
-        return eval(obj.toSource());
+        return JSON.parse(JSON.stringify(obj));
     }
 
     tblData[newTblName] = objcopy(tblData[tblName]);
 
     let columns = Object.keys(tblData[newTblName]);
     executeSimpleSQL(db, getSql(newTblName, tblData));
     executeSimpleSQL(db, "INSERT INTO " + newTblName +
                          "  (" + columns.join(",") + ") " +