tor-browser

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

order-of-steps.js (619B)


      1 // Copyright (C) 2017 Josh Wolfe. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-bigint.asuintn
      5 description: BigInt.asUintN order of parameter type coercion
      6 info: |
      7  BigInt.asUintN ( bits, bigint )
      8 
      9  1. Let bits be ? ToIndex(bits).
     10  2. Let bigint ? ToBigInt(bigint).
     11 
     12 features: [BigInt]
     13 ---*/
     14 
     15 var i = 0;
     16 var bits = {
     17  valueOf() {
     18    assert.sameValue(i, 0);
     19    i++;
     20    return 0;
     21  }
     22 };
     23 var bigint = {
     24  valueOf() {
     25    assert.sameValue(i, 1);
     26    i++;
     27    return 0n;
     28  }
     29 };
     30 
     31 BigInt.asUintN(bits, bigint);
     32 assert.sameValue(i, 2);
     33 
     34 reportCompare(0, 0);