Bug 1148060 - Fix test_Sync.js pre-39 failure due to defining `delete` on an object. r=jaws
authorDrew Willcoxon <adw@mozilla.com>
Thu, 26 Mar 2015 12:45:36 -0700
changeset 264716 b2f857d3db0e725ac146730b61808d3c6efbbd3c
parent 264715 02974be498e5062124c8b0aa162d886fdc22a966
child 264717 31034d214829a9b414c97acdbe1c4f7c3fa6a346
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1148060
milestone39.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
Bug 1148060 - Fix test_Sync.js pre-39 failure due to defining `delete` on an object. r=jaws
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);
     },