order-of-steps.js (615B)
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.asintn 5 description: BigInt.asIntN order of parameter type coercion 6 info: | 7 BigInt.asIntN ( 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.asIntN(bits, bigint); 32 assert.sameValue(i, 2); 33 34 reportCompare(0, 0);