summaryrefslogtreecommitdiffstats
path: root/devtools/client/webconsole/test/browser/browser_jsterm_error_outside_valid_range.js
blob: 46a0d74529204b3938ef3ff1fa1f13768ded77e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Ensure that dom errors, with error numbers outside of the range
// of valid js.msg errors, don't cause crashes (See Bug 1270721).

const TEST_URI = "data:text/html,<!DOCTYPE html>Test error documentation";

add_task(async function () {
  const hud = await openNewTabAndConsole(TEST_URI);

  const text =
    "TypeError: Request constructor: 'foo' (value of 'redirect' member of RequestInit) is not a valid value " +
    "for enumeration RequestRedirect";
  await executeAndWaitForErrorMessage(
    hud,
    "new Request('',{redirect:'foo'})",
    text
  );
  ok(
    true,
    "Error message displayed as expected, without crashing the console."
  );
});