Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8011704 Array compatibility issues from nashorn-dev alias
  3. JDK-8015355

Array.prototype functions don't honour non-writable length and / or index properties

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 8
    • core-libs
    • None
    • b96
    • generic
    • generic
    • Verified

      Object.defineProperty([],"length",{writable:false}).push(0)
      => should throw an exception (strict = true!)

      Object.defineProperty([],"length",{writable:false}).pop()
      => should throw an exception (strict = true!)

      Object.defineProperty([,,],"0",{writable:false}).reverse()
      => should throw an exception (strict = true!)

      Object.defineProperty([],"length",{writable:false}).shift()
      => should throw an exception (strict = true!)

      Array.prototype.sort() also calls ScriptObject#isStrictContext(), but
      implementations are allowed to use a custom behaviour if array index
      properties are non-writable/non-configurable. Nevertheless, I'd still
      remove isStrictContext() from this method...

      Object.defineProperty([],"length",{writable:false}).splice(0)
      => should throw an exception (strict = true!)

      Object.defineProperty([],"length",{writable:false}).unshift()
      => should throw an exception (strict = true!)

            sundar Sundararajan Athijegannathan
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: