Backed out changeset 49d7963e43d8 (bug 1202458) for test failures in test_inspector-mutations-value.html
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 02 Jun 2016 16:30:08 +0200
changeset 300096 e75f2d129de069681d0a690915c3e9c8f2a671e4
parent 300095 4f76ef821616e650c416159b7ee9442dcbd7a581
child 300097 c26aac8cf086fae326a34b4ff809dbfc054bec7e
push id19493
push usercbook@mozilla.com
push dateThu, 02 Jun 2016 14:30:50 +0000
treeherderfx-team@e75f2d129de0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1202458
milestone49.0a1
backs out49d7963e43d890488ad0ad9b1a592c57bdc2be49
Backed out changeset 49d7963e43d8 (bug 1202458) for test failures in test_inspector-mutations-value.html
.eslintignore
devtools/server/actors/string.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -105,17 +105,16 @@ devtools/client/webaudioeditor/**
 devtools/client/webconsole/**
 !devtools/client/webconsole/panel.js
 !devtools/client/webconsole/jsterm.js
 !devtools/client/webconsole/console-commands.js
 devtools/client/webide/**
 devtools/server/**
 !devtools/server/actors/webbrowser.js
 !devtools/server/actors/styles.js
-!devtools/server/actors/string.js
 devtools/shared/*.js
 !devtools/shared/css-lexer.js
 !devtools/shared/defer.js
 !devtools/shared/task.js
 devtools/shared/*.jsm
 devtools/shared/apps/**
 devtools/shared/client/**
 devtools/shared/discovery/**
--- a/devtools/server/actors/string.js
+++ b/devtools/server/actors/string.js
@@ -1,21 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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";
 
+var {Cu} = require("chrome");
 var {DebuggerServer} = require("devtools/server/main");
 
 var promise = require("promise");
 var {Class} = require("sdk/core/heritage");
 
 var protocol = require("devtools/shared/protocol");
-var {method, Arg, RetVal} = protocol;
+var {method, Arg, Option, RetVal} = protocol;
 
 exports.LongStringActor = protocol.ActorClass({
   typeName: "longstractor",
 
   initialize: function (conn, str) {
     protocol.Actor.prototype.initialize.call(this, conn);
     this.str = str;
     this.short = (this.str.length < DebuggerServer.LONG_STRING_LENGTH);
@@ -58,27 +59,19 @@ exports.LongStringActor = protocol.Actor
  *
  * I'm very proud of this name.
  */
 exports.ShortLongString = Class({
   initialize: function (str) {
     this.str = str;
   },
 
-  get length() {
-    return this.str.length;
-  },
-
-  get initial() {
-    return this.str;
-  },
-
-  string: function () {
-    return promise.resolve(this.str);
-  },
+  get length() { return this.str.length; },
+  get initial() { return this.str; },
+  string: function () { return promise.resolve(this.str); },
 
   substring: function (start, end) {
     return promise.resolve(this.str.substring(start, end));
   },
 
   release: function () {
     this.str = null;
     return promise.resolve(undefined);
@@ -101,22 +94,23 @@ exports.LongStringFront = protocol.Front
     this.actorID = form.actor;
     this.initial = form.initial;
     this.length = form.length;
   },
 
   string: function () {
     if (!this.strPromise) {
       let promiseRest = (thusFar) => {
-        if (thusFar.length === this.length) {
+        if (thusFar.length === this.length)
           return promise.resolve(thusFar);
+        else {
+          return this.substring(thusFar.length,
+                                thusFar.length + DebuggerServer.LONG_STRING_READ_LENGTH)
+            .then((next) => promiseRest(thusFar + next));
         }
-        return this.substring(thusFar.length,
-          thusFar.length + DebuggerServer.LONG_STRING_READ_LENGTH)
-          .then((next) => promiseRest(thusFar + next));
       };
 
       this.strPromise = promiseRest(this.initial);
     }
     return this.strPromise;
   }
 });
 
@@ -125,21 +119,21 @@ exports.LongStringFront = protocol.Front
 
 var stringActorType = protocol.types.getType("longstractor");
 protocol.types.addType("longstring", {
   _actor: true,
   write: (value, context, detail) => {
     if (!(context instanceof protocol.Actor)) {
       throw Error("Passing a longstring as an argument isn't supported.");
     }
-
     if (value.short) {
       return value.str;
+    } else {
+      return stringActorType.write(value, context, detail);
     }
-    return stringActorType.write(value, context, detail);
   },
   read: (value, context, detail) => {
     if (context instanceof protocol.Actor) {
       throw Error("Passing a longstring as an argument isn't supported.");
     }
     if (typeof (value) === "string") {
       return exports.ShortLongString(value);
     }