/** the line numbers */
private int[] line = new int[10];
+ /** the first line of this script */
+ private int firstLine = -1;
+
/** the instructions */
private int[] op = new int[10];
this.parentScope = parentScope;
if (sourceCode == null) return;
Parser p = new Parser(sourceCode, sourceName, firstLine);
- try {
- while(true) {
- int s = size();
- p.parseStatement(this, null);
- if (s == size()) break;
- }
- add(-1, Tokens.RETURN);
- } catch (Exception e) {
- if (Log.on) Log.log(Parser.class, e);
+ while(true) {
+ int s = size();
+ p.parseStatement(this, null);
+ if (s == size()) break;
}
+ add(-1, Tokens.RETURN);
}
public Object call(JS.Array args) throws JS.Exn { return call(args, new FunctionScope(sourceName, parentScope)); }
final Vec t = cx.stack;
OUTER: for(pc=0; pc<size; pc++) {
String label = null;
- cx.line = line[op];
+ cx.line = line[pc];
switch(op[pc]) {
case LITERAL: t.push(arg[pc]); break;
case OBJECT: t.push(new JS.Obj()); break;