JDK-8057930 : Remove "eval id" from eval locations
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-09-09
  • Updated: 2015-06-04
  • Resolved: 2014-09-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b31Fixed
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.
Comments
noreg-other: This change requires removal of ids from .EXPECTED files of a number of test cases (those included in the changeset). Those test cases expected outputs thus modified serve to test the correctness of this change.
09-09-2014