Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8024970 André Bargull's list on Sep 17, 2013
  3. JDK-8080360

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

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • 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

            jlaskey Jim Laskey
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: