Index: library/serialize/serializer.tcl =================================================================== diff -u -r24c01cb4dd0c1d32c693f6314b45ea979eeedf06 -r0f21940570f915a602d376d0faaab3081f057538 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 24c01cb4dd0c1d32c693f6314b45ea979eeedf06) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 0f21940570f915a602d376d0faaab3081f057538) @@ -653,6 +653,7 @@ } :method collect-var-traces {o s} { + set traces {} foreach v [$o info vars] { # Use directdispatch to query existing traces without the need # of an extra method. @@ -662,13 +663,16 @@ foreach ops $t { lassign $ops op cmd # save traces in post_cmds - $s addPostCmd [list $o trace add variable $v $op $cmd] + set traceCmd [list ::nsf::directdispatch $o -frame object ::trace add variable $v $op $cmd] + $s addPostCmd $traceCmd + append traces $traceCmd \n # remove trace from object ::nsf::directdispatch $o -frame object ::trace remove variable $v $op $cmd } } } + return $traces } ############################### @@ -800,7 +804,7 @@ return "" } - :collect-var-traces $o $s + set traces [:collect-var-traces $o $s] set evalList [:collectVars $o $s] @@ -832,6 +836,8 @@ [:frameWorkCmd ::nsf::object::property $o keepcallerself -unless 0] \ [:frameWorkCmd ::nsf::object::property $o perobjectdispatch -unless 0] + eval $traces + $s addPostCmd [:frameWorkCmd ::nsf::relation $o object-filter] return $cmd } @@ -948,7 +954,7 @@ ############################### :object method Object-serialize {o s} { - :collect-var-traces $o $s + set traces [:collect-var-traces $o $s] append cmd [list ::nsf::object::alloc [$o info class] ${:targetName} [join [:collectVars $o $s] "\n "]]\n foreach i [$o ::nsf::methods::object::info::methods -type scripted -callprotection all] { append cmd [:method-serialize $o $i ""] "\n" @@ -964,6 +970,8 @@ [:frameWorkCmd ::nsf::method::assertion $o object-invar] $s addPostCmd [:frameWorkCmd ::nsf::relation $o object-filter] + + eval $traces return $cmd }