Preloaded JS function "is not defined"

I have a mobile app that is telling me that is cannot find my JS.


To be clear, it is actually working just fine in the IDE, despite the fact that the linter is giving the same error in the editor:


Here is the definition:

If I prefix window. to the function, it works and the linter is also happy. So in Mobile this seems to be a requirement.