There isn't a way to do this in JavaScript. You could have a global variable like
var isDebugging = false;
Then when writing code, just check if the variable is true. Obviously this will create some unwanted overhead with file size, and a very slight performance loss. But other than specifying your own format, and running the code though a tool to strip debugging code out before you upload.
Something like
var foo = function() {
<!-- document.write( "blah" ); -->
};
For a release build, you would remove everything inside the tags, inclusive. And for a debug build you could just remove the tags, but keep the code. Something like this could be performed with an Ant build script or similar.