aboutsummaryrefslogtreecommitdiff
path: root/stdlib.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2023-05-18 09:19:43 +1000
committerSteve Bennett <steveb@workware.net.au>2023-06-21 09:17:47 +1000
commitf07c53e38d55f0c7c648b7818798138d91053527 (patch)
treeb80d7f1b40bd61bdaa385e6f1817ea6cfbb511d0 /stdlib.tcl
parent9e78cc8a97b7ecf6afbbe9a35305daf3459cead6 (diff)
downloadjimtcl-f07c53e38d55f0c7c648b7818798138d91053527.zip
jimtcl-f07c53e38d55f0c7c648b7818798138d91053527.tar.gz
jimtcl-f07c53e38d55f0c7c648b7818798138d91053527.tar.bz2
core: improve eval frame handling
Now callers to JimInvokeCommand() are expected to push and eval frame. Then we no longer need to carry currentScriptObj, argc, argv in the interp since these are in the current eval frame. Note that this change simply renames some unused fields in Jim_Interp for ABI compatibility, but these will be removed in due course. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'stdlib.tcl')
-rw-r--r--stdlib.tcl4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdlib.tcl b/stdlib.tcl
index 804a499..5945185 100644
--- a/stdlib.tcl
+++ b/stdlib.tcl
@@ -38,9 +38,9 @@ proc function {value} {
# (deepest level first)
proc stacktrace {{skip 0}} {
set frames {}
- loop level 2 [info frame]+1 {
+ loop level $skip+1 [info frame] {
set frame [info frame -$level]
- if {$frame(level) > $skip && [dict exists $frame proc]} {
+ if {[dict exists $frame proc]} {
lappend frames $frame(proc) $frame(file) $frame(line)
}
}