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

push() on frozen array increases its length property

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u40
    • core-libs
    • None
    • b40
    • generic
    • generic

        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.

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

                Created:
                Updated:
                Resolved: