[core][js] gc engine: bug fix > last index array