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

eval within 'with' statement does not use correct scope if with scope expression has a copy of eval

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        print((function(global){
            var x = 1;
            with(global) {
                eval("eval('var x=0')");
            }
            return x;
        })(this));
        print("typeof x?" + typeof x);

        Expected:
        0
        typeof x? undefined

        Actual:
        1
        typeof x? number


        print((function(global){
           var x = 1;
           with({eval: global.eval}) {
               eval("eval('var x=0')");
           }
           return x;
        })(this));
        print("typeof x? " + typeof x);

        Expected:
        0
        typeof x? undefined


        Actual:
        1
        typeof x? number

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sundar Sundararajan Athijegannathan
                  Reporter:
                  sundar Sundararajan Athijegannathan
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: