Math.max_each-element-coerced.js (496B)
1 // Copyright (C) 2020 Vladislav Lazurenko. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 esid: sec-math.max 6 description: Call ToNumber on each element of params 7 info: | 8 2. For each element arg of args, do 9 Let n be ? ToNumber(arg). 10 Append n to coerced. 11 ---*/ 12 13 let valueOf_calls = 0; 14 15 const n = { 16 valueOf: function() { 17 valueOf_calls++; 18 } 19 }; 20 Math.max(NaN, n); 21 assert.sameValue(valueOf_calls, 1); 22 23 reportCompare(0, 0);