blob: c607cbc86043b1ed44a536baf4b0ec28ee08f39b [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001var key;
2var count;
3
4print(count);
5
6switch (count) {
7 // engine only
8 case 1:
9 if (key != 'value in engine') {
10 throw "unexpected engine scope value";
11 }
12 if (context.getAttribute("key", context.GLOBAL_SCOPE ) != null) {
13 throw "unexpected global scope value";
14 }
15 break;
16
17 // both scopes
18 case 2:
19 if (key != 'value in engine') {
20 throw "unexpected engine scope value";
21 }
22 if (context.getAttribute("key", context.GLOBAL_SCOPE ) !=
23 "value in global") {
24 throw "unexpected global scope value";
25 }
26 break;
27
28 // global only
29 case 3:
30 if (key != 'value in global') {
31 throw "unexpected global scope value";
32 }
33 if (context.getAttribute("key", context.GLOBAL_SCOPE ) !=
34 "value in global") {
35 throw "unexpected global scope value";
36 }
37 break;
38
39 default:
40 throw "unexpected count";
41 break;
42}