ArrayData.getInt implementations do not convert to int32

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 8
    • Component/s: core-libs
    • None
    • b96
    • generic
    • generic

        The getInt(int) implementations in NumberArrayData and LongArrayData just casts the element value to int, which is not correct JS semantics. What we should do is call JSType.toInt32. This can be seen by running the following script:

        x = [0xffffffff, 0.5] // second element makes this a double array
        print(x[0] & -10)
        y = 0xffffffff
        print(y & -10)

        Expected output:

        -10
        -10

        Actual output:

        2147483638
        -10

              Assignee:
              Hannes Wallnoefer
              Reporter:
              Hannes Wallnoefer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: