Bug 1148060 - Fix test_Sync.js pre-39 failure due to defining `delete` on an object. r=jaws a=readinglist
authorDrew Willcoxon <adw@mozilla.com>
Thu, 26 Mar 2015 20:25:14 -0400
changeset 248485 572a200405b45407c4c2f358d65fe7309c6442db
parent 248484 a3e6d4e1890cbad8c82071ee2b3da0c87a061d99
child 248486 cb0db44ce60e0eebe6e1682672a31674a241b4b6
push id7837
push userjwein@mozilla.com
push dateFri, 27 Mar 2015 00:27:16 +0000
treeherdermozilla-aurora@cb0db44ce60e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, readinglist
bugs1148060
milestone38.0a2
Bug 1148060 - Fix test_Sync.js pre-39 failure due to defining `delete` on an object. r=jaws a=readinglist
browser/components/readinglist/test/xpcshell/test_Sync.js
--- a/browser/components/readinglist/test/xpcshell/test_Sync.js
+++ b/browser/components/readinglist/test/xpcshell/test_Sync.js
@@ -260,17 +260,20 @@ MockClient.prototype = {
       }
       for (let prop in body) {
         item[prop] = body[prop];
       }
       item.last_modified = this._nextLastModifiedToken++;
       return new MockResponse(200, item);
     },
 
-    delete(body, routeMatch) {
+    // There's a bug in pre-39's ES strict mode around forbidding the
+    // redefinition of reserved keywords that flags defining `delete` on an
+    // object as a syntax error.  This weird syntax works around that.
+    ["delete"](body, routeMatch) {
       let id = routeMatch[1];
       let item = this.itemByID(id);
       if (!item) {
         return new MockResponse(404);
       }
       item.deleted = true;
       return new MockResponse(200);
     },