DXR will be turned off on Tuesday, December 29th. It will redirect to Searchfox.
See the announcement on Discourse.

DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (c68fe15a81fc)

VCS Links

Line Code
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support/helper.sub.js"></script>

<body>
<script>
  test(t => {
    const empty = trustedTypes.emptyHTML;
    assert_true(trustedTypes.isHTML(empty));
    assert_equals(empty.toString(), "");
  }, 'trustedTypes.emptyHTML returns the intended value.');

  test(t => {
    try { trustedTypes.emptyHTML = 'fake'; } catch { }
    assert_true(trustedTypes.isHTML(trustedTypes.emptyHTML));
    assert_equals(trustedTypes.emptyHTML.toString(), "");
  }, 'trustedTypes.emptyHTML cannot be redefined.');

  test(t => {
    try { Object.defineProperty(TrustedTypes, 'emptyHTML', 'fake'); } catch { }
    assert_true(trustedTypes.isHTML(trustedTypes.emptyHTML));
    assert_equals(trustedTypes.emptyHTML.toString(), "");
  }, 'trustedTypes.emptyHTML cannot be redefined via defineProperty.');

  test(t => {
    const empty = trustedTypes.emptyScript;
    assert_true(trustedTypes.isScript(empty));
    assert_equals(empty.toString(), "");
  }, 'trustedTypes.emptyScript returns the intended value.');

  test(t => {
    try { trustedTypes.emptyScript = 'fake'; } catch { }
    assert_true(trustedTypes.isScript(trustedTypes.emptyScript));
    assert_equals(trustedTypes.emptyScript.toString(), "");
  }, 'trustedTypes.emptyScript cannot be redefined.');

  test(t => {
    try { Object.defineProperty(TrustedTypes, 'emptyScript', 'fake'); } catch { }
    assert_true(trustedTypes.isScript(trustedTypes.emptyScript));
    assert_equals(trustedTypes.emptyScript.toString(), "");
  }, 'trustedTypes.emptyScript cannot be redefined via defineProperty.');
</script>