Ignore:
Timestamp:
Sep 26, 2010, 2:38:31 PM (15 years ago)
Author:
[email protected]
Message:

2010-09-26 Mark Hahnenberg <[email protected]>

Reviewed by Oliver Hunt.

valueOf called in wrong order in atan2 and date constructors.
https://bugs.webkit.org/show_bug.cgi?id=26978

Fixed the bug where the arguments to atan2 were being evaluated
out of order.

  • runtime/MathObject.cpp: (JSC::mathProtoFuncATan2):

2010-09-26 Mark Hahnenberg <[email protected]>

Reviewed by Oliver Hunt.

valueOf called in wrong order in atan2 and date constructors.
https://bugs.webkit.org/show_bug.cgi?id=26978

Regression test for the issue where the arguments to atan2 were
evaluated out of order.

  • fast/js/math-expected.txt:
  • fast/js/script-tests/math.js: (v.valueOf): (w.valueOf):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/MathObject.cpp

    r65947 r68348  
    136136EncodedJSValue JSC_HOST_CALL mathProtoFuncATan2(ExecState* exec)
    137137{
    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)));
    139141}
    140142
Note: See TracChangeset for help on using the changeset viewer.