]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/math-pow-becomes-custom-function.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / math-pow-becomes-custom-function.js
CommitLineData
ed1e77d3
A
1function mathPowWrapper(x, y) {
2 return Math.pow(x, y);
3}
4noInline(mathPowWrapper);
5
6function 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}
18testChangingMathPow();