JavaScriptCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Oct 2007 23:36:36 +0000 (23:36 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Oct 2007 23:36:36 +0000 (23:36 +0000)
commit8ed591672499a2c6caa0e34eba361a58ff501c99
tree1b7b9bd1e6135d73b7454241275573e9404336a5
parent27e559077d85dfd592f969ebf428bc05a1fab1fc
JavaScriptCore:

        Reviewed by Geoff.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15632
          js1_5/Array/array-001.js test failing

        One of the JavaScriptCore tests was failing; it failed because of
        my change to NumberImp::getUInt32. The incorrect code I copied was
        from JSImmediate::getUInt32, and was a pre-existing bug.

        This patch fixes correctness, but will surely slow down SunSpider.
        We may be able to code this tighter and get the speed back.

        * kjs/JSImmediate.h:
        (KJS::JSImmediate::getInt32): Renamed from toInt32 to more accurately
        reflect the fact that this function only returns true if the value is
        accurate (no fractional part, etc.). Changed code so that it returns
        false when the value has a fraction.
        (KJS::JSImmediate::getUInt32): Ditto.

        * kjs/internal.cpp:
        (KJS::NumberImp::getInt32): Changed code so that it returns false when
        the value has a fraction. Restores the old behavior.
        (KJS::NumberImp::getUInt32): Ditto.

        * kjs/value.h:
        (KJS::JSValue::getInt32): Updated for name change.
        (KJS::JSValue::getUInt32): Ditto.
        (KJS::JSValue::toInt32): Ditto.
        (KJS::JSValue::toUInt32): Ditto.

LayoutTests:

        Reviewed by Geoff.

        - tests for http://bugs.webkit.org/show_bug.cgi?id=15632

        Added tests for cases where you use something that looks like an array
        index, but it has a fractional part.

        * fast/js/kde/resources/Array.js: Added tests.
        * fast/js/kde/Array-expected.txt: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/JSImmediate.h
JavaScriptCore/kjs/internal.cpp
JavaScriptCore/kjs/value.h
LayoutTests/ChangeLog
LayoutTests/fast/js/kde/Array-expected.txt
LayoutTests/fast/js/kde/resources/Array.js