tor-browser

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

clone-bigint.js (555B)


      1 // |reftest| skip-if(!xulRuntime.shell)
      2 // -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
      3 // Any copyright is dedicated to the Public Domain.
      4 // http://creativecommons.org/licenses/publicdomain/
      5 
      6 function testBigInt(b) {
      7    var a = deserialize(serialize(b));
      8    assertEq(typeof b, "bigint");
      9    assertEq(typeof a, "bigint");
     10    assertEq(a, b);
     11 }
     12 
     13 testBigInt(0n);
     14 testBigInt(-1n);
     15 testBigInt(1n);
     16 
     17 testBigInt(0xffffFFFFffffFFFFffffFFFFffffFFFFn);
     18 testBigInt(-0xffffFFFFffffFFFFffffFFFFffffFFFFn);
     19 
     20 reportCompare(0, 0, 'ok');