getStack method
Implementation
List<SourceLoc?> getStack() {
final result = <SourceLoc?>[];
// Return the newest call context first, and the oldest (global) context last
// by iterating through the stack in reverse
for (var i = stack.length - 1; i >= 0; i--) {
final ctx = stack[i];
result.add(ctx.getSourceLoc());
}
return result;
}