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

Nashorn should return "undefined" when looking for properties that don't exist

    Details

    • Subcomponent:
    • Introduced In Build:
      b99
    • Introduced In Version:
      9
    • Resolved In Build:
      b06
    • CPU:
      generic
    • OS:
      generic

      Description

      A DESCRIPTION OF THE PROBLEM :
      #Testcase:
      1. var NISLFuzzingFunc = function (placements) {
      2. var p = undefined;
      3. print(placements[p]);
      4. };
      5. var NISLParameter1 = [9814390527, 2];
      6. NISLFuzzingFunc(NISLParameter1);

      #Command:
      ./nashorn/jdk-12.0.2/bin/jjs --no-syntax-extensions=true --no-deprecation-warning=true testcase.js

      #Output:
      NaN

      #Expected output:
      undefined

      #Description:
      If the specified property can not be found, Nashorn should return "undefined" instead of "NaN". However, the output of Nashorn is "NaN" when running the testcase above.
      Is this a bug of Nashorn? Looking forward to your reply.


        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: