This function is created in an externally loaded file, admin-console/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/tree-item.js .
This problem appears when we click() in tests on some tree node after page load.
It is unlikely that user will be clicking fast enough to trigger this error, moreover IMHO Firefox blocks JS execution until external JS files are all loaded (but not sure), so this is only problem for QA.
Currently we solve this by calling NavTree#waitUntilReady( int intervalMs, int retries ) - e.g. in getNavTreeArrow():