fixed undefined node in selection/transition.js and minus enhance while loop

sumh <42424861@qq.com>