[ES6] output parens for yield when parented by AST_Dot or AST_Sub (#1419)
This commit is contained in:
@@ -686,6 +686,12 @@ function OutputStream(options) {
|
||||
// -(yield 4)
|
||||
if (p instanceof AST_Unary)
|
||||
return true;
|
||||
// (yield x).foo
|
||||
if (p instanceof AST_Dot && p.expression === this)
|
||||
return true;
|
||||
// (yield x)['foo']
|
||||
if (p instanceof AST_Sub && p.expression === this)
|
||||
return true;
|
||||
});
|
||||
|
||||
PARENS(AST_PropAccess, function(output){
|
||||
|
||||
Reference in New Issue
Block a user