use of php.runtime.env.CallStackItem in project jphp by jphp-compiler.
the class Generator method _next.
protected Memory _next(Environment env) {
if (busy) {
env.error(env.trace(), "Cannot resume an already running generator");
}
boolean x2 = false;
if (callStackItem != null) {
env.pushCall(new CallStackItem(callStackItem));
x2 = true;
}
try {
counter += 1;
busy = true;
return iterator.next().getValue();
} catch (NoSuchElementException e) {
valid = false;
callStackItem = null;
} finally {
if (x2)
env.popCall();
busy = false;
checkThrow();
}
return null;
}
use of php.runtime.env.CallStackItem in project jphp by jphp-compiler.
the class BaseBaseException method getProperties.
@Override
public ArrayMemory getProperties() {
if (!init) {
init = true;
if (trace != null) {
Memory m;
m = clazz.refOfProperty(props, "file");
if (m.isNull())
m.assign(trace.getFileName());
m = clazz.refOfProperty(props, "line");
if (m.isNull())
m.assign(trace.getStartLine() + 1);
m = clazz.refOfProperty(props, "position");
if (m.isNull())
m.assign(trace.getStartPosition() + 1);
ArrayMemory backTrace = new ArrayMemory();
for (CallStackItem el : callStack) backTrace.add(el.toArray());
clazz.refOfProperty(props, "trace").assign(backTrace);
}
}
return props;
}
Aggregations