[js] scan memory free missing on while condition error