GlobalConstants produces wrong result with Object.defineProperty

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 8u40
    • Component/s: core-libs
    • None
    • b40
    • generic
    • generic

        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

              Assignee:
              Marcus Lagergren
              Reporter:
              Attila Szegedi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: