Bug 1538764 - gfx/ manual ESLint no-throw-literal fixes. r=kats
authorIan Moody <moz-ian@perix.co.uk>
Mon, 25 Mar 2019 19:24:47 +0000
changeset 466120 a20d8267e39f2523a003dfd61237e9845cc765b9
parent 466119 f755066901ebb3cc0c8a2422038344bb903ea815
child 466121 2596c01bd847e7a4ff0eabaea3ad7dda2024cf65
push id81456
push userncsoregi@mozilla.com
push dateTue, 26 Mar 2019 16:56:06 +0000
treeherderautoland@1b85204856e2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1538764
milestone68.0a1
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
Bug 1538764 - gfx/ manual ESLint no-throw-literal fixes. r=kats Differential Revision: https://phabricator.services.mozilla.com/D24730
.eslintrc.js
gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -50,17 +50,16 @@ module.exports = {
     // TODO: Bug 1515949. Enable no-undef for gfx/
     "files": "gfx/layers/apz/test/mochitest/**",
     "rules": {
       "no-undef": "off",
     }
   }, {
     // TODO: Bug 1246594. Empty this list once the rule has landed for all dirs
     "files": [
-      "gfx/layers/apz/test/mochitest/**",
       "mobile/android/components/**",
       "mobile/android/modules/**",
       "modules/libmar/tests/unit/head_libmar.js",
       "netwerk/protocol/http/WellKnownOpportunisticUtils.jsm",
       "netwerk/test/httpserver/httpd.js",
       "netwerk/test/httpserver/test/**",
       "parser/htmlparser/tests/mochitest/parser_datreader.js",
       "testing/marionette/event.js",
--- a/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
+++ b/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js
@@ -272,17 +272,20 @@ function* synthesizeNativeTouchSequences
   var lastNonNullValue = -1;
   var yields = 0;
   for (let i = 0; i < aPositions.length; i++) {
     if (aPositions[i] == null) {
       yields++;
       continue;
     }
     if (aPositions[i].length != aTouchIds.length) {
-      throw "aPositions[" + i + "] did not have the expected number of positions; expected " + aTouchIds.length + " touch points but found " + aPositions[i].length;
+      throw new Error(
+        `aPositions[${i}] did not have the expected number of positions; ` +
+        `expected ${aTouchIds.length} touch points but found ${aPositions[i].length}`
+      );
     }
     for (let j = 0; j < aTouchIds.length; j++) {
       if (aPositions[i][j] != null) {
         lastNonNullValue = ((i - yields) * aTouchIds.length) + j;
       }
     }
   }
   if (lastNonNullValue < 0) {