Add annotations for document.js
Add annotations for errors.js
Describe the whole chain
Remove unused variable