[js] eliminate a useless reflow when using setBox method