summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testObjectToNumber.js
blob: d6353a6a683c07c3f52efc5464dbc120227718dc (plain)
1
2
3
4
5
6
7
8
function testObjectToNumber() {
    var o = {valueOf: () => -3};
    var x = 0;
    for (var i = 0; i < 10; i++)
        x -= o;
    return x;
}
assertEq(testObjectToNumber(), 30);