import org.xwt.util.*;
import java.io.*;
+// FIXME: could use some cleaning up
/** a JavaScript function, compiled into bytecode */
class CompiledFunctionImpl extends JS.Callable implements ByteCodes, Tokens {
private String sourceName;
public String getSourceName() throws JS.Exn { return sourceName; }
- /** the first line of this function */
- private int firstLine;
- public int getFirstLine() throws JS.Exn { return firstLine; }
-
/** the line numbers */
private int[] line = new int[10];
int pc = 0;
void eval(JS.Scope s) {
- final Vec t = JS.Thread.fromJavaThread(java.lang.Thread.currentThread()).stack;
+ final JS.Thread cx = JS.Thread.fromJavaThread(java.lang.Thread.currentThread());
+ final Vec t = cx.stack;
OUTER: for(pc=0; pc<size; pc++) {
String label = null;
+ cx.line = line[op];
switch(op[pc]) {
case LITERAL: t.push(arg[pc]); break;
case OBJECT: t.push(new JS.Obj()); break;