Fix #2140: bad crash in documentarray.js