Bug 1213875 - Lint arguments in capture module; r?whimboo draft
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 20 Dec 2016 14:26:58 +0000
changeset 455391 97b99590b32ecc1e359a915a58dd0ec991fd9481
parent 455333 cad2ea346d06ec5a3a70eda912513201dff0c21e
child 455392 4b62172973091d01bfa37a37f01ddaf40d77c4db
push id40223
push userbmo:ato@mozilla.com
push dateTue, 03 Jan 2017 18:25:16 +0000
reviewerswhimboo
bugs1213875
milestone53.0a1
Bug 1213875 - Lint arguments in capture module; r?whimboo MozReview-Commit-ID: EowxaYVwMxm
testing/marionette/capture.js
--- a/testing/marionette/capture.js
+++ b/testing/marionette/capture.js
@@ -24,17 +24,17 @@ this.capture = {};
  *     The node to take a screenshot of.
  * @param {Array.<Node>=} highlights
  *     Optional array of nodes, around which a border will be marked to
  *     highlight them in the screenshot.
  *
  * @return {HTMLCanvasElement}
  *     The canvas element where the element has been painted on.
  */
-capture.element = function (node, highlights=[]) {
+capture.element = function (node, highlights = []) {
   let win = node.ownerDocument.defaultView;
   let rect = node.getBoundingClientRect();
 
   return capture.canvas(
       win,
       rect.left,
       rect.top,
       rect.width,
@@ -51,17 +51,17 @@ capture.element = function (node, highli
  *     and the offsets for the viewport.
  * @param {Array.<Node>=} highlights
  *     Optional array of nodes, around which a border will be marked to
  *     highlight them in the screenshot.
  *
  * @return {HTMLCanvasElement}
  *     The canvas element where the viewport has been painted on.
  */
-capture.viewport = function (win, highlights=[]) {
+capture.viewport = function (win, highlights = []) {
   let rootNode = win.document.documentElement;
 
   return capture.canvas(
       win,
       win.pageXOffset,
       win.pageYOffset,
       rootNode.clientWidth,
       rootNode.clientHeight,
@@ -85,17 +85,17 @@ capture.viewport = function (win, highli
  * @param {Array.<Node>=} highlights
  *     Optional array of nodes, around which a border will be marked to
  *     highlight them in the screenshot.
  *
  * @return {HTMLCanvasElement}
  *     The canvas on which the selection from the window's framebuffer
  *     has been painted on.
  */
-capture.canvas = function (win, left, top, width, height, highlights=[]) {
+capture.canvas = function (win, left, top, width, height, highlights = []) {
   let scale = win.devicePixelRatio;
 
   let canvas = win.document.createElementNS(XHTML_NS, "canvas");
   canvas.width = width * scale;
   canvas.height = height * scale;
 
   let ctx = canvas.getContext(CONTEXT_2D);
   let flags = ctx.DRAWWINDOW_DRAW_CARET;
@@ -107,17 +107,17 @@ capture.canvas = function (win, left, to
 
   ctx.scale(scale, scale);
   ctx.drawWindow(win, left, top, width, height, BG_COLOUR, flags);
   ctx = capture.highlight_(ctx, highlights, top, left);
 
   return canvas;
 };
 
-capture.highlight_ = function (context, highlights, top=0, left=0) {
+capture.highlight_ = function (context, highlights, top = 0, left = 0) {
   if (!highlights) {
     return;
   }
 
   context.lineWidth = "2";
   context.strokeStyle = "red";
   context.save();