Improve toString method of ScriptObjectMirror class

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: