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

changeset 67
6f58c28c4faa
parent 66
bee7c8a45a04
child 69
c48e8a28da90
equal deleted inserted replaced
66:bee7c8a45a04 67:6f58c28c4faa
1448 addOwnProperty("readFully", Attribute.NOT_ENUMERABLE, value); 1448 addOwnProperty("readFully", Attribute.NOT_ENUMERABLE, value);
1449 1449
1450 value = ScriptFunctionImpl.makeFunction("quit", ScriptingFunctions.QUIT); 1450 value = ScriptFunctionImpl.makeFunction("quit", ScriptingFunctions.QUIT);
1451 addOwnProperty("quit", Attribute.NOT_ENUMERABLE, value); 1451 addOwnProperty("quit", Attribute.NOT_ENUMERABLE, value);
1452 1452
1453 final String execName = ScriptingFunctions.EXEC_NAME;
1454 value = ScriptFunctionImpl.makeFunction(execName, ScriptingFunctions.EXEC);
1455 addOwnProperty(execName, Attribute.NOT_ENUMERABLE, value);
1456
1453 // Nashorn extension: global.echo (scripting-mode-only) 1457 // Nashorn extension: global.echo (scripting-mode-only)
1454 // alias for "print" 1458 // alias for "print"
1455 value = get("print"); 1459 value = get("print");
1456 addOwnProperty("echo", Attribute.NOT_ENUMERABLE, value); 1460 addOwnProperty("echo", Attribute.NOT_ENUMERABLE, value);
1457 1461
1458 // Nashorn extension: global.$OPTIONS (scripting-mode-only) 1462 // Nashorn extension: global.$OPTIONS (scripting-mode-only)
1459 value = new OptionsObject(this.getContext()); 1463 value = new OptionsObject(this.getContext());
1460 addOwnProperty("$OPTIONS", Attribute.NOT_ENUMERABLE, value); 1464 addOwnProperty("$OPTIONS", Attribute.NOT_ENUMERABLE, value);
1465
1466 // Nashorn extension: global.$ENV (scripting-mode-only)
1467 value = ScriptingFunctions.getENVValues(newEmptyInstance(), this.isStrictContext());
1468 addOwnProperty(ScriptingFunctions.ENV_NAME, Attribute.NOT_ENUMERABLE, value);
1461 } 1469 }
1462 1470
1463 private void initTypedArray() { 1471 private void initTypedArray() {
1464 this.builtinArrayBuffer = initConstructor("ArrayBuffer"); 1472 this.builtinArrayBuffer = initConstructor("ArrayBuffer");
1465 this.builtinInt8Array = initConstructor("Int8Array"); 1473 this.builtinInt8Array = initConstructor("Int8Array");

mercurial