Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/jdk/javax/script/Test5.js
41144 views
1
2
var ScriptContext = javax.script.ScriptContext;
3
print(count);
4
5
switch (count) {
6
// engine only
7
case 1:
8
if (key != 'value in engine') {
9
throw "unexpected engine scope value";
10
}
11
if (context.getAttribute("key", ScriptContext.GLOBAL_SCOPE ) != null) {
12
throw "unexpected global scope value";
13
}
14
break;
15
16
// both scopes
17
case 2:
18
if (key != 'value in engine') {
19
throw "unexpected engine scope value";
20
}
21
if (context.getAttribute("key", ScriptContext.GLOBAL_SCOPE ) !=
22
"value in global") {
23
throw "unexpected global scope value";
24
}
25
break;
26
27
// global only
28
case 3:
29
if (key != 'value in global') {
30
throw "unexpected global scope value";
31
}
32
if (context.getAttribute("key", ScriptContext.GLOBAL_SCOPE ) !=
33
"value in global") {
34
throw "unexpected global scope value";
35
}
36
break;
37
38
default:
39
throw "unexpected count";
40
break;
41
}
42
43