Compound assigment of a property that deletes itself in it's "getter" function

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: core-libs
    • None

      (function f() {
          var a,b;
          with(a = { set x(v) { print("fail") } }) {
              with(b = { get x() { delete this.x; return 0 } }) {
                  x-=1;
              }
          }

          return b.x
      })()

      should not print "fail"

      Other variants:

      jjs> (function(global){"use strict";
      Object.defineProperty(global,"x",{get: function(){delete global.x;
      return 0}, configurable:true}); x-=1 })(this)

      Expected: global "x" is -1
      Actual: ReferenceError


      jjs> (function(global){"use strict";
      Object.defineProperty(global,"x",{get: function(){delete global.x;
      return 0}, configurable:true}); x-- })(this)

      Expected: global "x" is -1
      Actual: ReferenceError

            Assignee:
            Jim Laskey
            Reporter:
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: