Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8026858

Array length does not handle defined properties correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • core-libs
    • None
    • b115
    • generic
    • generic

      ES5 #15.4.5.2 says:

      "The length property of this Array object is a data property whose value is always numerically greater than the name of every deletable property whose name is an array index."

      This means that when setting length to a lower value, deletable array elements with ids higher or equal than new length must be deleted, while non-deletable elements must cause the new length to be one greater than the biggest non-deletable id.

      Both is currently not done for elements defined via Object.defineProperty with non-standard attributes (stored as generic property instead of in array data).

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

              Created:
              Updated:
              Resolved: