catiline
catiline copied to clipboard
Use `window.addEventListener` instead of `addEventListener`
Having addEventListener
dangle as a global is not ideal.
Please use window.addEventListener
to provide more context to static analysis tooling.
do you have a specific issue that it is causing
My static analysis tooling expects all access to global functions via window. I can fix that but it would be a hack on my side.
Having to inject only window as a global when executing this in a different context than browser makes things a lot cleaner than having to inject all the window globals in the to VM container as well.
Also, when looking at the code and you see just addEventListener
you don't know what object you are registering events on so you have to see if addEventListener
is declared elsewhere in the file before knowing its the window one.
And this one: https://github.com/calvinmetcalf/catiline/blob/e4ca4fb9bece9dae72f1b48659c5f0117799a178/src/nextTick.js#L24