We indeed cannot be that smart for the compiler.

Try the following 

```
// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// @output_file_name default.js
// ==/ClosureCompiler==

// ADD YOUR CODE HERE

(function() {
var module = {
  name: 'foo'
};

goog.provide(module.name);
})();
```

in http://closure-compiler.appspot.com/home