source: trunk/openjdk/jdk/test/javax/script/Test3.js

Last change on this file was 2, checked in by dmik, 15 years ago

Imported OpenJDK 6 b19 sources from Oracle.

File size: 632 bytes
Line 
1if (key == undefined || key != 'engine value') {
2 throw "unexpected engine scope value";
3}
4
5// pre-defined context variable refers to current ScriptContext
6if (context.getAttribute('key', context.GLOBAL_SCOPE) != 'global value') {
7 throw "unexpected global scope value";
8}
9
10// change the engine scope value
11key = 'new engine value';
12
13if (context.getAttribute('key', context.GLOBAL_SCOPE) != 'global value') {
14 throw "global scope should not change here";
15}
16
17// delete engine scope value
18delete key;
19
20if (key == undefined && key != 'xglobal value') {
21 throw 'global scope should be visible after engine scope removal';
22}
Note: See TracBrowser for help on using the repository browser.