BigInt.prototype.toString.js 367 B

123456789101112131415161718
  1. load("test-common.js");
  2. try {
  3. assert(BigInt.prototype.toString.length === 0);
  4. assertThrowsError(() => {
  5. BigInt.prototype.toString.call("foo");
  6. }, {
  7. error: TypeError,
  8. message: "Not a BigInt object"
  9. });
  10. assert(BigInt(123).toString() === "123");
  11. console.log("PASS");
  12. } catch (e) {
  13. console.log("FAIL: " + e);
  14. }