added top-level "environment" associative array - which provides JavaScript access to Java System properties.

git-svn-id: svn://10.0.0.236/trunk@33757 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com 1999-06-04 18:06:25 +00:00
parent a640fc495b
commit 7e586f42e5
2 changed files with 16 additions and 2 deletions

View File

@ -100,7 +100,14 @@ public class Main extends ScriptableObject {
Scriptable argsObj = cx.newArray(global, array);
global.defineProperty("arguments", argsObj,
ScriptableObject.DONTENUM);
// Set up "environment" in the global scope to provide access to the
// System environment variables.
Environment.defineClass(sharedGlobal);
Environment environment = new Environment(global);
global.defineProperty("environment", environment,
ScriptableObject.DONTENUM);
/*
TODO: enable debugger
if (global.debug) {

View File

@ -100,7 +100,14 @@ public class Main extends ScriptableObject {
Scriptable argsObj = cx.newArray(global, array);
global.defineProperty("arguments", argsObj,
ScriptableObject.DONTENUM);
// Set up "environment" in the global scope to provide access to the
// System environment variables.
Environment.defineClass(sharedGlobal);
Environment environment = new Environment(global);
global.defineProperty("environment", environment,
ScriptableObject.DONTENUM);
/*
TODO: enable debugger
if (global.debug) {