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

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 8
    • Component/s: 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!)

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

              Created:
              Updated:
              Resolved: