Bug 1202458 - part2: fix eslint errors in string actor;r=pbro
☠☠ backed out by e75f2d129de0 ☠ ☠
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 02 Jun 2016 10:35:03 +0200
changeset 300086 49d7963e43d890488ad0ad9b1a592c57bdc2be49
parent 300085 f3bdf3ebaf4cbf3bb426d10cf95e702bc8e981f4
child 300087 e74192b1a9c82ebcb431e5b4c28775a8111c8864
push id19488
push userjdescottes@mozilla.com
push dateThu, 02 Jun 2016 11:16:50 +0000
treeherderfx-team@e74192b1a9c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1202458
milestone49.0a1
Bug 1202458 - part2: fix eslint errors in string actor;r=pbro MozReview-Commit-ID: 1nguzarA57L
.eslintignore
devtools/server/actors/string.js
--- a/.eslintignore
+++ b/.eslintignore
@@ -105,16 +105,17 @@ 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,22 +1,21 @@
 /* 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, Option, RetVal} = protocol;
+var {method, Arg, 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);
@@ -59,19 +58,27 @@ 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);
@@ -94,23 +101,22 @@ 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;
   }
 });
 
@@ -119,21 +125,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);
     }