Skip to content

Commit

Permalink
rebase babel branch on master
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromew committed Jun 13, 2020
1 parent 11965fc commit cb8b447
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 276 deletions.
19 changes: 6 additions & 13 deletions packages/pug-code-gen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1219,21 +1219,14 @@ Compiler.prototype = {
},

visitEachOf: function(each) {
this.buf.push(
'' +
'// iterate ' +
each.obj +
'\n' +
'for (const ' +
each.val +
' of ' +
each.obj +
') {\n'
);

this.visit(each.block, each);
const forOfBlock = this.visit(each.block, each);
const forOf = t.forOfStatement(
t.variableDeclaration('var', [
t.variableDeclarator(t.identifier(each.val))
]), t.identifier(each.obj), t.blockStatement(forOfBlock));
return [ forOf ]

this.buf.push('}\n');
},

/**
Expand Down
Loading

0 comments on commit cb8b447

Please sign in to comment.