visitDOM assumes that handlers are static functions and won't references a 'this' because of handler.apply(null, args). However, this is not always true. Specifically, consider the commonly used visitDOM(... storeDataAttribs). and storeDataAttribs in turn calls 'storeInPageBundle'. This doesn't break right now because many of those use the "DU." pattern with a reference to a global object. However, when I refactored DOMUtils and moved it to ContentUtils, I changed "DU." references to "this" where appropriate, and now jenkins complains about it in https://integration.wikimedia.org/ci/job/parsoidsvc-npm-run-roundtrip-node-6-docker/2021/console
Ideally, visitDOM wouldn't assume that the handler's object is null.