Need to wrap in (function() { var Ext = window.Ext4 || window.Ext; ... })();