delete of top-level function declarated with function keyword

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Not an Issue
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: