Commits

Brian McKenna  committed 70fbcc2

Fix leading comments when flattening block statements

  • Participants
  • Parent commits f4388ae
  • Branches constraints

Comments (0)

Files changed (1)

File src/compile.js

     // multiple statements should be flattened with its context.
     function flattenBlocks(node) {
         if(node.type == "BlockStatement") {
+            // TODO: Maybe lift the comments up when empty body
+            if(node.leadingComments && node.body[0]) {
+                node.body[0].leadingComments = node.leadingComments;
+            }
             return node.body;
         }
         return [node];