src/jdk/nashorn/internal/objects/Global.java

changeset 1398
2f1b9f4daec1
parent 1385
b4a5485d6ff3
child 1399
22640d19073c
equal deleted inserted replaced
1397:19263eb2ff0c 1398:2f1b9f4daec1
2711 if (System.getSecurityManager() == null) { 2711 if (System.getSecurityManager() == null) {
2712 // do not fill $ENV if we have a security manager around 2712 // do not fill $ENV if we have a security manager around
2713 // Retrieve current state of ENV variables. 2713 // Retrieve current state of ENV variables.
2714 final ScriptObject env = newObject(); 2714 final ScriptObject env = newObject();
2715 env.putAll(System.getenv(), scriptEnv._strict); 2715 env.putAll(System.getenv(), scriptEnv._strict);
2716
2717 // Some platforms, e.g., Windows, do not define the PWD environment
2718 // variable, so that the $ENV.PWD property needs to be explicitly
2719 // set.
2720 if (!env.containsKey(ScriptingFunctions.PWD_NAME)) {
2721 env.put(ScriptingFunctions.PWD_NAME, System.getProperty("user.dir"), scriptEnv._strict);
2722 }
2723
2716 addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, env); 2724 addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, env);
2717 } else { 2725 } else {
2718 addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, UNDEFINED); 2726 addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, UNDEFINED);
2719 } 2727 }
2720 2728

mercurial