nunalit2-js: Fixed infinite recursion on tree view for document obtained
from document source.

Issue #252