Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/@babel/generator/lib/generators/statements.js
rd565449 r0c6b92a 34 34 this.space(); 35 35 this.tokenChar(40); 36 this.print(node.object , node);36 this.print(node.object); 37 37 this.tokenChar(41); 38 38 this.printBlock(node); … … 42 42 this.space(); 43 43 this.tokenChar(40); 44 this.print(node.test , node);44 this.print(node.test); 45 45 this.tokenChar(41); 46 46 this.space(); … … 51 51 this.indent(); 52 52 } 53 this.printAndIndentOnComments(node.consequent , node);53 this.printAndIndentOnComments(node.consequent); 54 54 if (needsBlock) { 55 55 this.dedent(); … … 61 61 this.word("else"); 62 62 this.space(); 63 this.printAndIndentOnComments(node.alternate , node);63 this.printAndIndentOnComments(node.alternate); 64 64 } 65 65 } … … 78 78 this.tokenChar(40); 79 79 { 80 const exit = this.enterForStatementInit( true);80 const exit = this.enterForStatementInit(); 81 81 this.tokenContext |= _index.TokenContext.forHead; 82 this.print(node.init , node);82 this.print(node.init); 83 83 exit(); 84 84 } … … 86 86 if (node.test) { 87 87 this.space(); 88 this.print(node.test , node);89 } 90 this.token Char(59);88 this.print(node.test); 89 } 90 this.token(";", false, 1); 91 91 if (node.update) { 92 92 this.space(); 93 this.print(node.update , node);93 this.print(node.update); 94 94 } 95 95 this.tokenChar(41); … … 100 100 this.space(); 101 101 this.tokenChar(40); 102 this.print(node.test , node);102 this.print(node.test); 103 103 this.tokenChar(41); 104 104 this.printBlock(node); … … 115 115 this.tokenChar(40); 116 116 { 117 const exit = isForOf ? null : this.enterForStatementInit( true);117 const exit = isForOf ? null : this.enterForStatementInit(); 118 118 this.tokenContext |= isForOf ? _index.TokenContext.forOfHead : _index.TokenContext.forInHead; 119 this.print(node.left , node);119 this.print(node.left); 120 120 exit == null || exit(); 121 121 } … … 123 123 this.word(isForOf ? "of" : "in"); 124 124 this.space(); 125 this.print(node.right , node);125 this.print(node.right); 126 126 this.tokenChar(41); 127 127 this.printBlock(node); … … 132 132 this.word("do"); 133 133 this.space(); 134 this.print(node.body , node);134 this.print(node.body); 135 135 this.space(); 136 136 this.word("while"); 137 137 this.space(); 138 138 this.tokenChar(40); 139 this.print(node.test , node);139 this.print(node.test); 140 140 this.tokenChar(41); 141 141 this.semicolon(); 142 142 } 143 function printStatementAfterKeyword(printer, node , parent, isLabel) {143 function printStatementAfterKeyword(printer, node) { 144 144 if (node) { 145 145 printer.space(); 146 printer.printTerminatorless(node , parent, isLabel);146 printer.printTerminatorless(node); 147 147 } 148 148 printer.semicolon(); … … 150 150 function BreakStatement(node) { 151 151 this.word("break"); 152 printStatementAfterKeyword(this, node.label , node, true);152 printStatementAfterKeyword(this, node.label); 153 153 } 154 154 function ContinueStatement(node) { 155 155 this.word("continue"); 156 printStatementAfterKeyword(this, node.label , node, true);156 printStatementAfterKeyword(this, node.label); 157 157 } 158 158 function ReturnStatement(node) { 159 159 this.word("return"); 160 printStatementAfterKeyword(this, node.argument , node, false);160 printStatementAfterKeyword(this, node.argument); 161 161 } 162 162 function ThrowStatement(node) { 163 163 this.word("throw"); 164 printStatementAfterKeyword(this, node.argument , node, false);164 printStatementAfterKeyword(this, node.argument); 165 165 } 166 166 function LabeledStatement(node) { 167 this.print(node.label , node);167 this.print(node.label); 168 168 this.tokenChar(58); 169 169 this.space(); 170 this.print(node.body , node);170 this.print(node.body); 171 171 } 172 172 function TryStatement(node) { 173 173 this.word("try"); 174 174 this.space(); 175 this.print(node.block , node);175 this.print(node.block); 176 176 this.space(); 177 177 if (node.handlers) { 178 this.print(node.handlers[0] , node);178 this.print(node.handlers[0]); 179 179 } else { 180 this.print(node.handler , node);180 this.print(node.handler); 181 181 } 182 182 if (node.finalizer) { … … 184 184 this.word("finally"); 185 185 this.space(); 186 this.print(node.finalizer , node);186 this.print(node.finalizer); 187 187 } 188 188 } … … 192 192 if (node.param) { 193 193 this.tokenChar(40); 194 this.print(node.param , node);195 this.print(node.param.typeAnnotation , node);194 this.print(node.param); 195 this.print(node.param.typeAnnotation); 196 196 this.tokenChar(41); 197 197 this.space(); 198 198 } 199 this.print(node.body , node);199 this.print(node.body); 200 200 } 201 201 function SwitchStatement(node) { … … 203 203 this.space(); 204 204 this.tokenChar(40); 205 this.print(node.discriminant , node);205 this.print(node.discriminant); 206 206 this.tokenChar(41); 207 207 this.space(); 208 208 this.tokenChar(123); 209 this.printSequence(node.cases, node,{209 this.printSequence(node.cases, { 210 210 indent: true, 211 211 addNewlines(leading, cas) { … … 219 219 this.word("case"); 220 220 this.space(); 221 this.print(node.test , node);221 this.print(node.test); 222 222 this.tokenChar(58); 223 223 } else { … … 227 227 if (node.consequent.length) { 228 228 this.newline(); 229 this.printSequence(node.consequent, node,{229 this.printSequence(node.consequent, { 230 230 indent: true 231 231 }); … … 260 260 } 261 261 } 262 this.printList(node.declarations, node,{263 separator: hasInits ? function ( ) {264 this.token Char(44);262 this.printList(node.declarations, { 263 separator: hasInits ? function (occurrenceCount) { 264 this.token(",", false, occurrenceCount); 265 265 this.newline(); 266 266 } : undefined, … … 277 277 } 278 278 function VariableDeclarator(node) { 279 this.print(node.id , node);279 this.print(node.id); 280 280 if (node.definite) this.tokenChar(33); 281 this.print(node.id.typeAnnotation , node);281 this.print(node.id.typeAnnotation); 282 282 if (node.init) { 283 283 this.space(); 284 284 this.tokenChar(61); 285 285 this.space(); 286 this.print(node.init , node);286 this.print(node.init); 287 287 } 288 288 }
Note:
See TracChangeset
for help on using the changeset viewer.