CompiledFunction currentCompiledFunction = null;
Vec stack = new Vec();
- int line = -1;
+ int pc;
/** binds this thread to the current Java Thread */
public void bindToCurrentJavaThread() { javaThreadToJSThread.put(java.lang.Thread.currentThread(), this); }
/** returns the line of code that is currently executing */
- public int getLine() { return line; }
+ public int getLine() { return currentCompiledFunction == null ? -1 : currentCompiledFunction.getLine(pc); }
/** returns the name of the source code file which declared the currently executing function */
public String getSourceName() { return currentCompiledFunction == null ? null : currentCompiledFunction.getSourceName(); }
return ret;
}
+ public static JS.Thread currentJSThread() {
+ return fromJavaThread(java.lang.Thread.currentThread());
+ }
}
}