tor-browser

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

Number-toSource.js (950B)


      1 // |reftest| skip-if(!Number.prototype.toSource)
      2 
      3 /*
      4 * Any copyright is dedicated to the Public Domain.
      5 * http://creativecommons.org/licenses/publicdomain/
      6 */
      7 
      8 assertEq(raisesException(TypeError)('Number.prototype.toSource.call("")'), true);
      9 assertEq(raisesException(TypeError)('Number.prototype.toSource.call(true)'), true);
     10 assertEq(raisesException(TypeError)('Number.prototype.toSource.call({})'), true);
     11 assertEq(raisesException(TypeError)('Number.prototype.toSource.call(null)'), true);
     12 assertEq(raisesException(TypeError)('Number.prototype.toSource.call([])'), true);
     13 assertEq(raisesException(TypeError)('Number.prototype.toSource.call(undefined)'), true);
     14 assertEq(raisesException(TypeError)('Number.prototype.toSource.call(new Boolean(true))'), true);
     15 
     16 assertEq(completesNormally('Number.prototype.toSource.call(42)'), true);
     17 assertEq(completesNormally('Number.prototype.toSource.call(new Number(42))'), true);
     18 
     19 reportCompare(true, true);