Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Bunker generating incorrect code #4

Open
itay opened this Issue Nov 28, 2011 · 0 comments

Comments

Projects
None yet
1 participant

itay commented Nov 28, 2011

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment