sebmck/6to5 — pull request #54 by thejameskyle (2014-10-12 22:04:04+00:00)
Title: [Proposal] Use parent node's name for computed property reference argument

Currently computed properties generates a self-executing anonymous function with the argument `_ref` (`file.generateUid('ref')`). Instead of this, I think it would be much more readable if you used the parent node's name.

```js
var obj = {
["x" + foo]: "heh"
};
```
Generating:
```js
// currently:
var obj = function (_ref) {
_ref["x" + foo] = "heh";
return _ref;
}({});

// proposed:
var obj = function (obj) {
obj["x" + foo] = "heh";
return obj;
}({});
```

> You can see something similar in [coffeescript](http://coffeescript.org/#try:class%20Foo%0A) and [typescript](http://www.typescriptlang.org/Playground#src=module%20Foo%20%7B%0A%20%20%20%20export%20class%20Bar%20%7B%7D%0A%7D).

I'm not sure if there are any edge cases I haven't thought of, but I'd be interested in hearing them.

If there is something that would prevent this. I think it would still be good to use `file.generateUid(parent.id.name)` so you could use `_obj` instead of `_ref`.

Thoughts?