Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8034892 nashorn compatibility issues
  3. JDK-8035182

delete of top-level function declarated with function keyword

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • None
    • core-libs
    • None

      4) issues

      ---- rhino-----
      >jrunscript
      js> function f(){return "a"}
      sun.org.mozilla.javascript.internal.InterpretedFunction@1cfa965
      js> function del(){delete f}
      sun.org.mozilla.javascript.internal.InterpretedFunction@1e064c
      js> f()
      a
      js> del()
      js> typeof(f)
      undefined
      js>

      ---- noshorn ------

      >jrunscript
      nashorn> function f(){return "a"}
      function f(){return "a"}
      nashorn> function del(){delete f}
      function del(){delete f}
      nashorn> f()
      a
      nashorn> del()
      nashorn> typeof(f)
      function
      nashorn> f
      function f(){return "a"}

      In rhino, the "delete f" execute from within the del() function deletes the name "f"; in nashorn it does not.

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

              Created:
              Updated:
              Resolved: