Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8062937

GlobalConstants produces wrong result with Object.defineProperty

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 8u40
    • core-libs
    • None
    • b40
    • generic
    • generic

    Backports

      Description

        var x = 1;
        for(var i = 2; i < 5; ++i) {
            print(x);
            Object.defineProperty(this, "x", {value: i });
        }
        print(x);

        Expected result:
        1
        2
        3
        4

        Observed result:
        1
        1
        1
        4

        Attachments

          Issue Links

            Activity

              People

                lagergren Marcus Lagergren
                attila Attila Szegedi
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: