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

push() on frozen array increases its length property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b40
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        x = [1, 2, 3]; Object.freeze(x); x.push(4);
        <shell>:1 TypeError: Cannot set property "3" of frozen array
        jjs> x
        1,2,3,0
        jjs> x.length
        4

        x.length should still be 3.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                lagergren Marcus Lagergren
                Reporter:
                hannesw Hannes Wallnoefer
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: