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

    Details

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

      Description

      (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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: