Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Other
    • Affects Version/s: 8, 9
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description


      1. names visible in the global namespace in rhino and not in nashorn

           compile and run the test Jtest.java. the output got from rhino and nashorn, that show that
           rhino made visible the predefined javascript functions, while nashorn does not.
           Have strived to make a java program get these names out of its global object, without success.

           This is important because a java program that calls the javascript engine
           pushing function definitions into it may want to reject upfront the redefinition
           of predefined functions (which could alter the behavior of user defined functions
           that use them).

      2. the opposite

           compile and run the test Jtest3.java. Tthe output got from both rhino and nashorn shows that
           in this case some predefined names appear in the namespace of nashorn, and not in the one of rhino.

           This is a big problem for an application that with rhino did not have any name
           clashes, and that now has.

      As it seems, nashorn has a namespace that behaves quite differently from the
      one of rhino. An application has to cope with it changing substantially the way
      it handles its names.

      Also have an application that uses the javascript engine, and that runs with
      nashorn in a time that is 4 times that of running it with rhino. Admittedly, this could
      depend on the above mentioned differences.

      Proposal: document what names are in the nashorn global namespace, and how
      a java program can get them, and what happens when a java program defines
      new names. Support both engines for at least one year more, giving time to developers
      to change their applications to cope with this (there are substantial changes to be
      done).

      Priority justification:
      Impact: High, regression
      Likelhood: Medium, intermittent.
      Workaround: Medium, unknown

      ILW = HMM => P2

        Attachments

        1. Jtest.java
          2 kB
        2. Jtest3.java
          0.4 kB
        3. Jtest6.java
          0.5 kB

          Issue Links

            Activity

              People

              • Assignee:
                sundar Sundararajan Athijegannathan
                Reporter:
                tyao Ting-Yun Ingrid Yao (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: