[core][js] gc engine: fix several issues