The distribution files arrow.js and parser.js create a lot of variables on the global namespace, or window when loaded when loaded via web browser.
Replication
- Load a web application with arrows.
- Open browser development console.
- Variables that should be private are in the
window namespace. E.g., _cancelerId, numannotations, etc.
Possible fix
Wrap distribution source in an IIFE, and manually attach public functions/variables to the window namespace.
(function() {
"use strict";
// ... code for arrows goes here ...
window.Arrows = Arrows;
})();
Alternatively, the issue could be resolved by using AMD and CommonJS style definitions.
The distribution files
arrow.jsandparser.jscreate a lot of variables on the global namespace, orwindowwhen loaded when loaded via web browser.Replication
windownamespace. E.g.,_cancelerId,numannotations, etc.Possible fix
Wrap distribution source in an IIFE, and manually attach public functions/variables to the
windownamespace.Alternatively, the issue could be resolved by using AMD and CommonJS style definitions.