summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/extensions/clone-bigint.js
blob: a40bbed8f4db3f89722d842ce08cd2ad221fa38d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// |reftest| skip-if(!xulRuntime.shell)
// -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/

function testBigInt(b) {
    var a = deserialize(serialize(b));
    assertEq(typeof b, "bigint");
    assertEq(typeof a, "bigint");
    assertEq(a, b);
}

testBigInt(0n);
testBigInt(-1n);
testBigInt(1n);

testBigInt(0xffffFFFFffffFFFFffffFFFFffffFFFFn);
testBigInt(-0xffffFFFFffffFFFFffffFFFFffffFFFFn);

reportCompare(0, 0, 'ok');