lib/stdlib.js: fix toHS for for extended arrays