Bug 1494726 - Add a test for malformed top-level await expressions; r=jlast.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Mon, 21 Jan 2019 14:03:32 +0000
changeset 514689 46a48161f4282af4708ddd3b2eed6943da864add
parent 514688 22471aa9be27f7897495d4bb4b2d6fd1900e620b
child 514690 d536f45f5b166c4b9562caf0c41991cb5df831cc
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1494726
milestone66.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 1494726 - Add a test for malformed top-level await expressions; r=jlast. Differential Revision: https://phabricator.services.mozilla.com/D15937
devtools/client/webconsole/test/mochitest/browser_jsterm_await_error.js
--- a/devtools/client/webconsole/test/mochitest/browser_jsterm_await_error.js
+++ b/devtools/client/webconsole/test/mochitest/browser_jsterm_await_error.js
@@ -84,9 +84,14 @@ async function performTests() {
   info("Check that we have as many errors as commands");
   const expectedErrorsNumber = expectedInputsNumber;
   is(hud.ui.outputNode.querySelectorAll(".message.error").length, expectedErrorsNumber,
     "There is the expected number of error messages");
 
   info("Check that there's no result message");
   is(hud.ui.outputNode.querySelectorAll(".message.result").length, 0,
     "There is no result messages");
+
+  info("Check that malformed await expressions displays a meaningful error");
+  res = await executeAndWaitForErrorMessage(
+    `await new Promise())`, `SyntaxError: unexpected token: ')'`);
+  ok(res.node, "awaiting for a malformed expression displays a meaningful error");
 }