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

Remove "eval id" from eval locations

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • core-libs
    • b31
    • generic
    • generic

        Eval locations (printed in stack traces) contain an useless "eval id" (a sequential number within a Context). The stack traces of exceptions thrown from an eval() thus look something like:

        SyntaxError: test/script/basic/es6/const-redeclare-extra.js#36:8<eval>4:2:8 Variable "x" has already been declared

        Note that 4:2:8 mean the exception was thrown from line 2, column 8 of the 4th eval in that context. The number 4 seems like it somehow belongs with the line:column information, but is actually completely useless and only serves to confuse. To make things worse, the number changes with the number of recompilations, so with subtle changes to the optimistic typing, the number will also change, rendering a bunch of test cases that uses the "throw from eval" technique to unnecessarily fail, as the expected output from the test case contains this useless number.

        It should be removed.

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

                Created:
                Updated:
                Resolved: