File size: 3,236 Bytes
233f6d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Clazz.declarePackage ("JS");
Clazz.load (null, "JS.ScriptContext", ["java.util.Hashtable", "JS.SV"], function () {
c$ = Clazz.decorateAsClass (function () {
this.aatoken = null;
this.allowJSThreads = false;
this.chk = false;
this.contextPath = " >> ";
this.vars = null;
this.displayLoadErrorsSave = false;
this.errorMessage = null;
this.errorMessageUntranslated = null;
this.errorType = null;
this.executionPaused = false;
this.executionStepping = false;
this.functionName = null;
this.iCommandError = -1;
this.id = 0;
this.isComplete = true;
this.isFunction = false;
this.isJSThread = false;
this.isStateScript = false;
this.isTryCatch = false;
this.forVars = null;
this.iToken = 0;
this.lineEnd = 2147483647;
this.lineIndices = null;
this.lineNumbers = null;
this.mustResumeEval = false;
this.outputBuffer = null;
this.parallelProcessor = null;
this.parentContext = null;
this.pc = 0;
this.pc0 = 0;
this.pcEnd = 2147483647;
this.script = null;
this.scriptExtensions = null;
this.scriptFileName = null;
this.scriptLevel = 0;
this.statement = null;
this.htFileCache = null;
this.statementLength = 0;
this.token = null;
this.tryPt = 0;
this.theToken = null;
this.theTok = 0;
this.pointers = null;
Clazz.instantialize (this, arguments);
}, JS, "ScriptContext");
Clazz.makeConstructor (c$, 
function () {
this.id = ++JS.ScriptContext.contextCount;
});
Clazz.defineMethod (c$, "setMustResume", 
function () {
var sc = this;
while (sc != null) {
sc.mustResumeEval = true;
sc.pc = sc.pc0;
sc = sc.parentContext;
}
});
Clazz.defineMethod (c$, "getVariable", 
function ($var) {
var context = this;
while (context != null && !context.isFunction) {
if (context.vars != null && context.vars.containsKey ($var)) return context.vars.get ($var);
context = context.parentContext;
}
return null;
}, "~S");
Clazz.defineMethod (c$, "getFullMap", 
function () {
var ht =  new java.util.Hashtable ();
var context = this;
if (this.contextPath != null) ht.put ("_path", JS.SV.newS (this.contextPath));
while (context != null && !context.isFunction) {
if (context.vars != null) for (var key, $key = context.vars.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) if (!ht.containsKey (key)) {
var val = context.vars.get (key);
if (val.tok != 2 || val.intValue != 2147483647) ht.put (key, val);
}
context = context.parentContext;
}
return ht;
});
Clazz.defineMethod (c$, "saveTokens", 
function (aa) {
this.aatoken = aa;
if (aa == null) {
this.pointers = null;
return;
}this.pointers =  Clazz.newIntArray (aa.length, 0);
for (var i = this.pointers.length; --i >= 0; ) this.pointers[i] = (aa[i] == null ? -1 : aa[i][0].intValue);

}, "~A");
Clazz.defineMethod (c$, "restoreTokens", 
function () {
if (this.pointers != null) for (var i = this.pointers.length; --i >= 0; ) if (this.aatoken[i] != null) this.aatoken[i][0].intValue = this.pointers[i];

return this.aatoken;
});
Clazz.defineMethod (c$, "getTokenCount", 
function () {
return (this.aatoken == null ? -1 : this.aatoken.length);
});
Clazz.defineMethod (c$, "getToken", 
function (i) {
return this.aatoken[i];
}, "~N");
Clazz.defineStatics (c$,
"contextCount", 0);
});