File tree Expand file tree Collapse file tree 3 files changed +80
-3
lines changed Expand file tree Collapse file tree 3 files changed +80
-3
lines changed Original file line number Diff line number Diff line change 953
953
} ;
954
954
955
955
CodeGenerator . prototype . generateIterationForStatement = function ( operator , stmt , flags ) {
956
- var result = [ 'for' + space + ( stmt . await ? 'await' + space : '' ) + '(' ] , that = this ;
956
+ var result = [ 'for' + ( stmt . await ? noEmptySpace ( ) + 'await' : '' ) + space + '(' ] , that = this ;
957
957
withIndent ( function ( ) {
958
958
if ( stmt . left . type === Syntax . VariableDeclaration ) {
959
959
withIndent ( function ( ) {
Original file line number Diff line number Diff line change 14
14
" escodegen.js" ,
15
15
" package.json"
16
16
],
17
- "version" : " 1.12.0 " ,
17
+ "version" : " 1.12.1 " ,
18
18
"engines" : {
19
19
"node" : " >=4.0"
20
20
},
32
32
"dependencies" : {
33
33
"estraverse" : " ^4.2.0" ,
34
34
"esutils" : " ^2.0.2" ,
35
- "esprima" : " ^3.1.3 " ,
35
+ "esprima" : " ^4.0.1 " ,
36
36
"optionator" : " ^0.8.1"
37
37
},
38
38
"optionalDependencies" : {
Original file line number Diff line number Diff line change @@ -6322,6 +6322,83 @@ data = {
6322
6322
6323
6323
} ,
6324
6324
6325
+ 'ES2018 for-await-of with `compact: true`' : {
6326
+ 'async function f(){for await(const x of ait){console.log(x);}}' : {
6327
+ options : {
6328
+ format : {
6329
+ compact : true
6330
+ }
6331
+ } ,
6332
+ generateFrom : {
6333
+ "type" : "FunctionDeclaration" ,
6334
+ "id" : {
6335
+ "type" : "Identifier" ,
6336
+ "name" : "f"
6337
+ } ,
6338
+ "params" : [ ] ,
6339
+ "body" : {
6340
+ "type" : "BlockStatement" ,
6341
+ "body" : [
6342
+ {
6343
+ "type" : "ForOfStatement" ,
6344
+ "left" : {
6345
+ "type" : "VariableDeclaration" ,
6346
+ "declarations" : [
6347
+ {
6348
+ "type" : "VariableDeclarator" ,
6349
+ "id" : {
6350
+ "type" : "Identifier" ,
6351
+ "name" : "x"
6352
+ } ,
6353
+ "init" : null
6354
+ }
6355
+ ] ,
6356
+ "kind" : "const"
6357
+ } ,
6358
+ "right" : {
6359
+ "type" : "Identifier" ,
6360
+ "name" : "ait"
6361
+ } ,
6362
+ "body" : {
6363
+ "type" : "BlockStatement" ,
6364
+ "body" : [
6365
+ {
6366
+ "type" : "ExpressionStatement" ,
6367
+ "expression" : {
6368
+ "type" : "CallExpression" ,
6369
+ "callee" : {
6370
+ "type" : "MemberExpression" ,
6371
+ "object" : {
6372
+ "type" : "Identifier" ,
6373
+ "name" : "console"
6374
+ } ,
6375
+ "property" : {
6376
+ "type" : "Identifier" ,
6377
+ "name" : "log"
6378
+ } ,
6379
+ "computed" : false
6380
+ } ,
6381
+ "arguments" : [
6382
+ {
6383
+ "type" : "Identifier" ,
6384
+ "name" : "x"
6385
+ }
6386
+ ]
6387
+ }
6388
+ }
6389
+ ]
6390
+ } ,
6391
+ "await" : true
6392
+ }
6393
+ ]
6394
+ } ,
6395
+ "generator" : false ,
6396
+ "async" : true
6397
+ }
6398
+ }
6399
+
6400
+ } ,
6401
+
6325
6402
'ES2018 async generator method' : {
6326
6403
'class C {\n async *readLines(file) {\n while (!file.EOF) {\n yield await file.readLine();\n }\n }\n}' : {
6327
6404
generateFrom : {
You can’t perform that action at this time.
0 commit comments