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

nashorn: here document does not work if the delimiter is at the end of the file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 9
    • 8u31, 8u40
    • core-libs

      FULL PRODUCT VERSION :
      java version "1.8.0_31"
      Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

      A DESCRIPTION OF THE PROBLEM :
      If you run Example 4-2 from section 4.3 of the nashorn guide [1], and in the file scriptHereArgs.js, do not add any character after the final EOD, an exception is thrown.

      [1] http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/shell.html#sthref26

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create the file as in Example 4-2 from section 4.3 of the nashorn guide [1].
      Make sure there are no characters (newline, space, tab, ...) after the final "EOD".
      Invoke the file as in the nashorn guide.

      [1] http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/shell.html#sthref26

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      >jjs scriptHereArgs.js -- Line1 Lin2 Line3
      Line1 is normal
          Lin2 is indented

      Line3 is separated by a blank line
      ACTUAL -
      >jjs scriptHereArgs.js -- Line1 Lin2 Line3
      scriptHereArgs.js:7:3 Here string missing end marker "EOD"
      EOD
              ^


      REPRODUCIBILITY :
      This bug can be reproduced always.

            sundar Sundararajan Athijegannathan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: