RFR (S): 8080087: Nashorn $ENV.PWD is originally undefined
A. Sundararajan
sundararajan.athijegannathan at oracle.com
Fri Jun 5 10:10:50 UTC 2015
Hi Michael,
Just to avoid OS name prefix check (if possible) and also define "PWD"
to be "user.dir" value on all platforms where it is not available from
the OS environment.
Thanks,
-Sundar
On Friday 05 June 2015 03:27 PM, Michael Haupt wrote:
> Hi Sundar,
>
> I'm not tied to this solution. The code is as it is because it seems to be an issue of the Windows platform in particular. Would you think checking for key presence is more robust?
>
> Best,
>
> Michael
>
>> Am 05.06.2015 um 11:49 schrieb A. Sundararajan <sundararajan.athijegannathan at oracle.com>:
>>
>> Hi,
>>
>> Can we do
>>
>> if (! env.containsKey(ScriptingFunctions.PWD_NAME)) {
>> env.put(ScriptingFunctions.PWD_NAME, System.getProperty("user.dir"), scriptEnv._strict);
>> }
>>
>> in Global.java instead of checking for Windows platform explicitly?
>>
>> -Sundar
>>
>> On Friday 05 June 2015 03:08 PM, Michael Haupt wrote:
>>> Dear all,
>>>
>>> please review and sponsor this fix.
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8080087
>>> Webrev: http://cr.openjdk.java.net/~mhaupt/8080087/webrev.00
>>>
>>> In Nashorn scripting mode, $ENV.PWD contains the current working directory. This is imported from the environment on unixy platforms. As the PWD variable is nonexistent on Windows by default, it needs to be set explicitly.
>>>
>>> Thanks,
>>>
>>> Michael
>>>
More information about the nashorn-dev
mailing list