@@ -449,18 +449,7 @@ function M.unload(self,mA)
449
449
local fullName = mname :fullName ()
450
450
local sn = mname :sn ()
451
451
local fn = mname :fn ()
452
- if (tracing == " yes" ) then
453
- local stackDepth = frameStk :stackDepth ()
454
- local indent = (" " ):rep (stackDepth + 1 )
455
- local b = {}
456
- b [# b + 1 ] = indent
457
- b [# b + 1 ] = " Unloading: "
458
- b [# b + 1 ] = userName
459
- b [# b + 1 ] = " (fn: "
460
- b [# b + 1 ] = fn or " nil"
461
- b [# b + 1 ] = " )\n "
462
- shell :echo (concatTbl (b ," " ))
463
- end
452
+ local state = " "
464
453
465
454
dbg .print {" Trying to unload: " , userName , " sn: " , sn ," \n " }
466
455
@@ -469,6 +458,7 @@ function M.unload(self,mA)
469
458
mt :remove (sn )
470
459
registerUnloaded (mt :fullName (sn ), mt :fn (sn ))
471
460
a [# a + 1 ] = true
461
+ state = " inactive"
472
462
elseif (mt :have (sn ," active" )) then
473
463
474
464
dbg .print {" Master:unload: \" " ,userName ," \" from file: \" " ,fn ," \"\n " }
@@ -488,8 +478,24 @@ function M.unload(self,mA)
488
478
hook .apply (" unload" ,{fn = mname :fn (), modFullName = mname :fullName ()})
489
479
frameStk :pop ()
490
480
a [# a + 1 ] = true
481
+ state = " active"
491
482
else
492
483
a [# a + 1 ] = false
484
+ state = " non-existant"
485
+ end
486
+ if (tracing == " yes" ) then
487
+ local stackDepth = frameStk :stackDepth ()
488
+ local indent = (" " ):rep (stackDepth + 1 )
489
+ local b = {}
490
+ b [# b + 1 ] = indent
491
+ b [# b + 1 ] = " Unloading: "
492
+ b [# b + 1 ] = userName
493
+ b [# b + 1 ] = " (state: "
494
+ b [# b + 1 ] = state
495
+ b [# b + 1 ] = " ) (fn: "
496
+ b [# b + 1 ] = fn or " nil"
497
+ b [# b + 1 ] = " )\n "
498
+ shell :echo (concatTbl (b ," " ))
493
499
end
494
500
end
495
501
0 commit comments