tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

prologue.js (1287B)


      1 /* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 var appendToActual = function(s) {
      7    actual += s + ',';
      8 }
      9 
     10 // Add dummy versions of missing functions and record whether they were
     11 // originally present.
     12 //
     13 // This only affects the main global. Any globals created by the test will
     14 // lack the function.
     15 let hasFunction = {};
     16 for (const name of [
     17    // Functions present if JS_GC_ZEAL defined:
     18    "gczeal",
     19    "unsetgczeal",
     20    "schedulegc",
     21    "selectforgc",
     22    "verifyprebarriers",
     23    "verifypostbarriers",
     24    "currentgc",
     25    "deterministicgc",
     26    "dumpGCArenaInfo",
     27    "setMarkStackLimit",
     28    // Functions present if DEBUG or JS_OOM_BREAKPOINT defined:
     29    "oomThreadTypes",
     30    "oomAfterAllocations",
     31    "oomAtAllocation",
     32    "resetOOMFailure",
     33    "oomTest",
     34    "stackTest",
     35    "interruptTest"]) {
     36    const present = name in this;
     37    if (!present) {
     38        this[name] = function() {};
     39    }
     40    hasFunction[name] = present;
     41 }
     42 
     43 // Set the minimum heap size for parallel marking to zero for testing purposes.
     44 gcparam('parallelMarkingThresholdMB', 0);