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

Improve toString method of ScriptObjectMirror class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • None
    • core-libs
    • None
    • b82
    • generic
    • generic

      When nashorn script engine is used with jsr-223 API, script objects are wrapped as ScriptObjectMirror objects. "jrunscript" tool prints toString value of such objects - which results in really uninformative responses like below:

      nashorn> x = new TypeError("asd")
      jdk.nashorn.api.scripting.ScriptObjectMirror@9e493eb
      nashorn> print
      jdk.nashorn.api.scripting.ScriptObjectMirror@4c889b3c
      nashorn> function func() { print("hello") }
      jdk.nashorn.api.scripting.ScriptObjectMirror@f32b694

      It'd be better if ScriptObjectMirror.toString is implemented to return better descriptive strings.

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

              Created:
              Updated:
              Resolved: