fixup! Bug 1388082 - Switch to async/await in interaction module. r?automatedtester draft
authorAndreas Tolfsen <ato@sny.no>
Mon, 07 Aug 2017 19:00:11 +0100
changeset 642094 ffc7357e15df3e3a5eefd1aa53070df04e24a15f
parent 642093 faafc015638da548a15aadf6eed5e600bd61ada0
child 642095 406d24472b4230308908ffbba78db46f099d7c48
push id72654
push userbmo:ato@sny.no
push dateMon, 07 Aug 2017 18:02:52 +0000
reviewersautomatedtester
bugs1388082
milestone57.0a1
fixup! Bug 1388082 - Switch to async/await in interaction module. r?automatedtester
testing/marionette/interaction.js
--- a/testing/marionette/interaction.js
+++ b/testing/marionette/interaction.js
@@ -346,20 +346,21 @@ interaction.flushEventLoop = async funct
  * file list.
  *
  * @param {HTMLInputElement} el
  *     An <tt>&lt;input type=file&gt;</tt> element.
  * @param {string} path
  *     Full path to file.
  */
 interaction.uploadFile = async function(el, path) {
+  let file;
   try {
-    let file = await File.createFromFileName(path);
+    file = await File.createFromFileName(path);
   } catch (e) {
-    return null;
+    return;
   }
 
   if (!file) {
     throw new InvalidArgumentError("File not found: " + path);
   }
 
   let fs = Array.prototype.slice.call(el.files);
   fs.push(file);