tom: add walkScopeTree function to component