Skip to content

Commit

Permalink
added missing desugaring case in var declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Herman committed Jul 22, 2011
1 parent f05ac13 commit ae5f907
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/jsdesugar.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,15 @@ Narcissus.desugaring = (function() {
var vars = [];
var assignments = [];
decl.children.forEach(function(init) {
if (!init.initializer || typeof init.name === "string") {
if (!init.initializer) {
vars.push(init);
return;
}
if (typeof init.name === "string") {
vars.push(init);
init.initializer = desugarExpression(init.initializer);
return;
}
extractBindings(vars, init.name);
assignments.push(desugarAssignment(varInitializerToAssignment(init)));
});
Expand Down

0 comments on commit ae5f907

Please sign in to comment.