If I create a gadget with var TEST = true; then window.TEST === undefined in production mode, but when I try to debug the gadget by adding debug=1 to the URL, the behavior changes and I get window.TEST === true.
The variable should still be local in debug mode.