Bug fix: compat.js should use window['foo'] to avoid unexpected optimization