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

eval within a 'with' leaks definitions into global scope

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • core-libs
    • None
    • b70
    • generic
    • generic

        function func() {
            var obj = { foo: 344 };
            with (obj) {
               eval("var x = foo + 3");
            }
            print(x);
        }

        func();

        // should result in ReferenceError
        print(x);

              hannesw Hannes Wallnoefer
              sundar Sundararajan Athijegannathan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: