window.common = (function(global) { const { loopProtect, common = { init: [] } } = global; loopProtect.hit = function hit(line) { var err = `Error: Exiting potential infinite loop at line ${line}.`; console.error(err); }; common.addLoopProtect = function addLoopProtect(code = '') { return loopProtect(code); }; return common; })(window);