substack/node-bunker — Issue #4: Bunker generating incorrect code
Author: itay
Created: 2011-11-28 02:14:05+00:00
State: open

I was playing around with some things, and noticed that for the following code, bunker was causing incorrect code to be generated:

```
var bunker = require('bunker');

var code = "var a = {};\n a.b || (a.b = 2);"
var bunkered = bunker(code);
console.log(bunkered.compile());
```

If you run the code in `code`, it works fine, but once going through bunker, it goes berserk:

```
node foo.js
{
TBPCdS(0);
var a = {};
}

{
TBPCdS(1);
uJrw$J(2)(a.b || a.b = 2); <-- Note the lack of parens around a.b = 2
}
```

Any ideas?