Back out 89c73451325e (bug 1116853) for devtools/chrome bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 02 Jan 2015 19:06:12 -0800
changeset 247684 918ab351ea214253a5b8c2289e275afbfd9f776c
parent 247683 9b62d0e8b412dd289edefdb45d2c8342dd0d8e5a
child 247685 156a06b49da823e2d71cf6b34446ee1f07f8bd37
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1116853
milestone37.0a1
backs out89c73451325ed382f267575e9470a7b9860cf774
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
Back out 89c73451325e (bug 1116853) for devtools/chrome bustage CLOSED TREE
toolkit/devtools/DevToolsUtils.js
toolkit/devtools/server/actors/script.js
toolkit/devtools/server/actors/webconsole.js
--- a/toolkit/devtools/DevToolsUtils.js
+++ b/toolkit/devtools/DevToolsUtils.js
@@ -337,16 +337,40 @@ exports.dumpv.wantVerbose = false;
 exports.dbg_assert = function dbg_assert(cond, e) {
   if (!cond) {
     return e;
   }
 };
 
 
 /**
+ * Utility function for updating an object with the properties of
+ * other objects.
+ *
+ * @param aTarget Object
+ *        The object being updated.
+ * @param aNewAttrs Object
+ *        The rest params are objects to update aTarget with. You
+ *        can pass as many as you like.
+ */
+exports.update = function update(aTarget, ...aArgs) {
+  for (let attrs of aArgs) {
+    for (let key in attrs) {
+      let desc = Object.getOwnPropertyDescriptor(attrs, key);
+
+      if (desc) {
+        Object.defineProperty(aTarget, key, desc);
+      }
+    }
+  }
+
+  return aTarget;
+}
+
+/**
  * Utility function for getting the values from an object as an array
  *
  * @param aObject Object
  *        The object to iterate over
  */
 exports.values = function values(aObject) {
   return Object.keys(aObject).map(k => aObject[k]);
 }
--- a/toolkit/devtools/server/actors/script.js
+++ b/toolkit/devtools/server/actors/script.js
@@ -6,17 +6,17 @@
 
 "use strict";
 
 const Services = require("Services");
 const { Cc, Ci, Cu, components, ChromeWorker } = require("chrome");
 const { ActorPool, getOffsetColumn } = require("devtools/server/actors/common");
 const { DebuggerServer } = require("devtools/server/main");
 const DevToolsUtils = require("devtools/toolkit/DevToolsUtils");
-const { dbg_assert, dumpn, fetch } = DevToolsUtils;
+const { dbg_assert, dumpn, update, fetch } = DevToolsUtils;
 const { dirname, joinURI } = require("devtools/toolkit/path");
 const { SourceMapConsumer, SourceMapGenerator } = require("source-map");
 const promise = require("promise");
 const PromiseDebugging = require("PromiseDebugging");
 const Debugger = require("Debugger");
 const xpcInspector = require("xpcInspector");
 const mapURIToAddonID = require("./utils/map-uri-to-addon-id");
 const ScriptStore = require("./utils/ScriptStore");
@@ -648,17 +648,17 @@ ThreadActor.prototype = {
 
     if (this.state !== "detached") {
       return { error: "wrongState",
                message: "Current state is " + this.state };
     }
 
     this._state = "attached";
 
-    Object.assign(this._options, aRequest.options || {});
+    update(this._options, aRequest.options || {});
 
     // Initialize an event loop stack. This can't be done in the constructor,
     // because this.conn is not yet initialized by the actor pool at that time.
     this._nestedEventLoops = new EventLoopStack({
       hooks: this._parent,
       connection: this.conn,
       thread: this
     });
@@ -702,17 +702,17 @@ ThreadActor.prototype = {
     };
   },
 
   onReconfigure: function (aRequest) {
     if (this.state == "exited") {
       return { error: "wrongState" };
     }
 
-    Object.assign(this._options, aRequest.options || {});
+    update(this._options, aRequest.options || {});
     // Clear existing sources, so they can be recreated on next access.
     this._sources = null;
 
     return {};
   },
 
   /**
    * Pause the debuggee, by entering a nested event loop, and return a 'paused'
@@ -4415,19 +4415,19 @@ DebuggerServer.ObjectActorPreviewers.Obj
  */
 function PauseScopedObjectActor()
 {
   ObjectActor.apply(this, arguments);
 }
 
 PauseScopedObjectActor.prototype = Object.create(PauseScopedActor.prototype);
 
-Object.assign(PauseScopedObjectActor.prototype, ObjectActor.prototype);
-
-Object.assign(PauseScopedObjectActor.prototype, {
+update(PauseScopedObjectActor.prototype, ObjectActor.prototype);
+
+update(PauseScopedObjectActor.prototype, {
   constructor: PauseScopedObjectActor,
   actorPrefix: "pausedobj",
 
   onOwnPropertyNames:
     PauseScopedActor.withPaused(ObjectActor.prototype.onOwnPropertyNames),
 
   onPrototypeAndProperties:
     PauseScopedActor.withPaused(ObjectActor.prototype.onPrototypeAndProperties),
@@ -4466,17 +4466,17 @@ Object.assign(PauseScopedObjectActor.pro
                message: "Only thread-lifetime actors can be released." };
     }
 
     this.release();
     return {};
   }),
 });
 
-Object.assign(PauseScopedObjectActor.prototype.requestTypes, {
+update(PauseScopedObjectActor.prototype.requestTypes, {
   "threadGrip": PauseScopedObjectActor.prototype.onThreadGrip,
 });
 
 
 /**
  * Creates an actor for the specied "very long" string. "Very long" is specified
  * at the server's discretion.
  *
@@ -4760,19 +4760,17 @@ BreakpointActor.prototype = {
    * Handle a protocol request to remove this breakpoint.
    *
    * @param aRequest object
    *        The protocol request object.
    */
   onDelete: function (aRequest) {
     // Remove from the breakpoint store.
     this.threadActor.breakpointActorMap.deleteActor(
-      Object.assign({},
-                    this.location,
-                    { source: this.location.sourceActor.form() })
+      update({}, this.location, { source: this.location.sourceActor.form() })
     );
     this.threadActor.threadLifetimePool.removeActor(this);
     // Remove the actual breakpoint from the associated scripts.
     this.removeScripts();
     return { from: this.actorID };
   }
 };
 
@@ -5036,17 +5034,17 @@ Object.defineProperty(Debugger.Frame.pro
  */
 function ChromeDebuggerActor(aConnection, aParent)
 {
   ThreadActor.call(this, aParent);
 }
 
 ChromeDebuggerActor.prototype = Object.create(ThreadActor.prototype);
 
-Object.assign(ChromeDebuggerActor.prototype, {
+update(ChromeDebuggerActor.prototype, {
   constructor: ChromeDebuggerActor,
 
   // A constant prefix that will be used to form the actor ID by the server.
   actorPrefix: "chromeDebugger"
 });
 
 exports.ChromeDebuggerActor = ChromeDebuggerActor;
 
@@ -5064,17 +5062,17 @@ exports.ChromeDebuggerActor = ChromeDebu
  *        properties.
  */
 function AddonThreadActor(aConnect, aParent) {
   ThreadActor.call(this, aParent);
 }
 
 AddonThreadActor.prototype = Object.create(ThreadActor.prototype);
 
-Object.assign(AddonThreadActor.prototype, {
+update(AddonThreadActor.prototype, {
   constructor: AddonThreadActor,
 
   // A constant prefix that will be used to form the actor ID by the server.
   actorPrefix: "addonThread",
 
   /**
    * Override the eligibility check for scripts and sources to make
    * sure every script and source with a URL is stored when debugging
--- a/toolkit/devtools/server/actors/webconsole.js
+++ b/toolkit/devtools/server/actors/webconsole.js
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { Cc, Ci, Cu } = require("chrome");
 const { DebuggerServer, ActorPool } = require("devtools/server/main");
 const { EnvironmentActor, LongStringActor, ObjectActor, ThreadActor } = require("devtools/server/actors/script");
+const { update } = require("devtools/toolkit/DevToolsUtils");
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Services",
                                   "resource://gre/modules/Services.jsm");
 XPCOMUtils.defineLazyGetter(this, "NetworkMonitor", () => {
   return require("devtools/toolkit/webconsole/network-monitor")
          .NetworkMonitor;
@@ -1530,17 +1531,17 @@ exports.WebConsoleActor = WebConsoleActo
 function AddonConsoleActor(aAddon, aConnection, aParentActor)
 {
   this.addon = aAddon;
   WebConsoleActor.call(this, aConnection, aParentActor);
 }
 
 AddonConsoleActor.prototype = Object.create(WebConsoleActor.prototype);
 
-Object.assign(AddonConsoleActor.prototype, {
+update(AddonConsoleActor.prototype, {
   constructor: AddonConsoleActor,
 
   actorPrefix: "addonConsole",
 
   /**
    * The add-on that this console watches.
    */
   addon: null,