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

Cannot assign undefined to a function argument if the function uses arguments object

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8
    • core-libs
    • None
    • b98
    • generic
    • generic
    • Verified

      This occurs if an argument has been set to undefined before accessing to the arguments array. Any arg that would have been made undefined has a value back to the passed one.

      This creates a very confusing state.

      Testcase:

      function f(a) {
          a = undefined;
          arguments[0];
          // in one step:
          //a = arguments[1]
          print(a);
      }
      f('toto');

            sundar Sundararajan Athijegannathan
            jfdenise Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: