Wrap with (function() { var Ext = window.Ext4 || window.Ext; ... })();