Changeset 68348 in webkit
- Timestamp:
- Sep 26, 2010 2:38:31 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r68347 r68348 1 2010-09-26 Mark Hahnenberg <mhahnenb@gmail.com> 2 3 Reviewed by Oliver Hunt. 4 5 valueOf called in wrong order in atan2 and date constructors. 6 https://bugs.webkit.org/show_bug.cgi?id=26978 7 8 Fixed the bug where the arguments to atan2 were being evaluated 9 out of order. 10 11 * runtime/MathObject.cpp: 12 (JSC::mathProtoFuncATan2): 13 1 14 2010-09-26 Mark Hahnenberg <mhahnenb@gmail.com> 2 15 -
trunk/JavaScriptCore/runtime/MathObject.cpp
r65947 r68348 136 136 EncodedJSValue JSC_HOST_CALL mathProtoFuncATan2(ExecState* exec) 137 137 { 138 return JSValue::encode(jsDoubleNumber(exec, atan2(exec->argument(0).toNumber(exec), exec->argument(1).toNumber(exec)))); 138 double arg0 = exec->argument(0).toNumber(exec); 139 double arg1 = exec->argument(1).toNumber(exec); 140 return JSValue::encode(jsDoubleNumber(exec, atan2(arg0, arg1))); 139 141 } 140 142 -
trunk/LayoutTests/ChangeLog
r68347 r68348 1 2010-09-26 Mark Hahnenberg <mhahnenb@gmail.com> 2 3 Reviewed by Oliver Hunt. 4 5 valueOf called in wrong order in atan2 and date constructors. 6 https://bugs.webkit.org/show_bug.cgi?id=26978 7 8 Regression test for the issue where the arguments to atan2 were 9 evaluated out of order. 10 11 * fast/js/math-expected.txt: 12 * fast/js/script-tests/math.js: 13 (v.valueOf): 14 (w.valueOf): 15 1 16 2010-09-26 Mark Hahnenberg <mhahnenb@gmail.com> 2 17 -
trunk/LayoutTests/fast/js/math-expected.txt
r54198 r68348 45 45 PASS Math.atan2(Infinity, NaN) is NaN 46 46 PASS Math.atan2(-Infinity, NaN) is NaN 47 PASS testStr is "onetwo" 47 48 PASS Math.ceil(NaN) is NaN 48 49 PASS Math.ceil(0) is 0 -
trunk/LayoutTests/fast/js/script-tests/math.js
r54198 r68348 50 50 shouldBe("Math.atan2(Infinity, NaN)", "NaN"); 51 51 shouldBe("Math.atan2(-Infinity, NaN)", "NaN"); 52 53 // Regression test for Bug 26978 (https://bugs.webkit.org/show_bug.cgi?id=26978) 54 var testStr = ""; 55 var v = { valueOf: function() { testStr += "one"; return 1; } }; 56 var w = { valueOf: function() { testStr += "two"; return 2; } }; 57 Math.atan2(v, w); 58 shouldBe('testStr', '\"onetwo\"'); 52 59 53 60 /*
Note: See TracChangeset
for help on using the changeset viewer.