Constellation/escodegen — pull request #56 by michaelficarra (2012-09-14 18:55:41+00:00)
Title: `addIndent('')` is just `base`

It's not like we refuse to reference `base`. On a related note, it would be nice if you could stop referencing and mutating `base` all over the place, and instead have something like a `withIndent` block that resets `base` when you're done.

```js
previousBase = base;
base += indent;
result = [newline, addIndent(generateStatement(stmt, { semicolonOptional: semicolonOptional }))];
base = previousBase;
```

to something like

```js
result = withIndent(function(indent){
return [newline + indent, generateStatement(stmt, { semicolonOptional: semicolonOptional })];
});
```