]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function mathPowWrapper(x, y) { |
2 | return Math.pow(x, y); | |
3 | } | |
4 | noInline(mathPowWrapper); | |
5 | ||
6 | function testChangingMathPow() { | |
7 | var result = 0; | |
8 | for (var i = 0; i < 10000; ++i) { | |
9 | result += mathPowWrapper(3, 2); | |
10 | } | |
11 | Math.pow = function(a, b) { return a + b; } | |
12 | for (var i = 0; i < 10000; ++i) { | |
13 | result += mathPowWrapper(3, 2); | |
14 | } | |
15 | if (result !== 140000) | |
16 | throw "Result = " + result + ", expected 140000"; | |
17 | } | |
18 | testChangingMathPow(); |