Bug 1213875 - Lint arguments in capture module; r?whimboo draft
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 20 Dec 2016 14:26:58 +0000
changeset 451502 e72d11c024a1d2435c219207878d0f4ea7fd3f85
parent 451501 5206da513654c0e0b36293c9ce149ef9ed907a41
child 451503 36cb430f527e968839fbcfb19877775b87dd2f1a
push id39207
push userbmo:ato@mozilla.com
push dateTue, 20 Dec 2016 14:39:38 +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 doc = node.ownerDocument;
   let win = doc.defaultView;
   let rect = node.getBoundingClientRect();
 
   return capture.canvas(
       doc,
       rect.left,
       rect.top,
@@ -52,17 +52,17 @@ capture.element = function (node, highli
  *     and a window for determining the offset of 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 (document, highlights=[]) {
+capture.viewport = function (document, highlights = []) {
   let win = document.defaultView;
   let docEl = document.documentElement;
 
   return capture.canvas(
       document,
       win.pageXOffset,
       win.pageYOffset,
       docEl.clientWidth,
@@ -87,31 +87,31 @@ capture.viewport = function (document, h
  * @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 (document, left, top, width, height, highlights=[]) {
+capture.canvas = function (document, left, top, width, height, highlights = []) {
   let win = document.defaultView;
 
   let canvas = document.createElementNS(XHTML_NS, "canvas");
   canvas.width = width;
   canvas.height = height;
 
   let ctx = canvas.getContext(CONTEXT_2D);
   ctx.drawWindow(win, left, top, width, height, BG_COLOUR);
   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();