tor-browser

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

object-toSource-override-on-getter.js (463B)


      1 // |reftest| skip-if(!Function.prototype.toSource)
      2 /* Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/licenses/publicdomain/ */
      4 
      5 let x = {};
      6 let y = function() {};
      7 y.toSource = function() {
      8    return "[012345678901234567890123456789]";
      9 };
     10 Object.defineProperty(x, "", {enumerable: true, get: y});
     11 assertEq(x.toSource(), "({'':[012345678901234567890123456789]})");
     12 
     13 if (typeof reportCompare === "function")
     14    reportCompare(0, 0);