tor-browser

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

marked-atoms.js (639B)


      1 // Test basics of atom marking and check the isAtomMarked function works.
      2 
      3 gczeal(0);
      4 let global = newGlobal({newCompartment: true});
      5 global.eval('var x = {}');
      6 gc();
      7 
      8 // Make an anonymous symbol and mark it in the global.
      9 let atom = Symbol();
     10 assertEq(isAtomMarked(this, atom), true);
     11 assertEq(isAtomMarked(global, atom), false);
     12 global.x[atom] = 0;
     13 assertEq(isAtomMarked(global, atom), true);
     14 
     15 // Make a named symbol (plus an atom for the description) and mark it.
     16 let sym = Symbol("baz");
     17 assertEq(isAtomMarked(this, sym), true);
     18 assertEq(isAtomMarked(global, sym), false);
     19 global.x[sym] = 0;
     20 assertEq(isAtomMarked(global, sym), true);