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

Remove "eval id" from eval locations

    XMLWordPrintable

    Details

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

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: