dom/bindings/test/test_throwing_method_noDCE.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <!DOCTYPE html>
     2 <meta charset=utf-8>
     3 <title>Test that we don't DCE functions that can throw</title>
     4 <script src="/resources/testharness.js"></script>
     5 <script src="/resources/testharnessreport.js"></script>
     6 <div id="log"></div>
     7 <script>
     8 test(function() {
     9   function test(root) {
    10     var threw = false;
    11     try {
    12         root.querySelectorAll("");
    13     } catch(e){ threw = true; };
    14     // Hot loop to make sure the JIT heuristics ion-compile this function even
    15     // though it's throwing exceptions (which would normally make us back off
    16     // of ion compilation).
    17     for (var i=0; i<1500; i++) {}
    18     return threw;
    19   }
    21   var threw = false;
    22   var el = document.createElement("div");
    23   for (var i=0; i<200; i++)
    24       threw = test(el);
    25   assert_true(threw);
    26 }, "Shouldn't optimize away throwing functions");
    27 </script>

mercurial