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

Nashorn $ENV.PWD is originally undefined

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8-pool
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b69
    • CPU:
      x86
    • OS:
      windows_8

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_45"
        Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
        Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.3.9600]

        A DESCRIPTION OF THE PROBLEM :
        In Nashorn shell scripting, the variable $ENV.PWD contains the current working directory, that is used when executing commands. However, initially, $ENV.PWD is undefined.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Save the script below to a file "test.js" and run "jjs -scripting test.js" from the command-line.

        print($ENV.PWD);
        $ENV.PWD = "C:\\Users";
        print($ENV.PWD);


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        2 lines are printed: the first is the directory where you saved the script, the second is "C:\Users"
        ACTUAL -
        2 lines are printed: the first is "undefined", the second is "C:\Users"

        REPRODUCIBILITY :
        This bug can be reproduced always.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: