google/closure-library — pull request #315 by pauldraper (2014-07-08 00:15:46+00:00)
Title: Free memory in goog.functions.cacheReturnValue

A closure can retain a large amount of memory. This discards the reference to the wrapped function once it is no longer needed.

`var fn2 = fn;` was the best way I saw of overcoming the type error.

It would be nice if the compiler would remove away the assignment, but currently it does not (sad face).

```javascript
function(c){var a=c,b;return function(){a&&(b=a(),a=void 0);return b}};
```

Removing the the `called` variable was not necessary, but it minimized the number of variables and code.