[ES6] output parens for yield when parented by AST_Dot or AST_Sub (#1419)

This commit is contained in:
kzc
2017-01-10 14:19:32 -05:00
committed by Richard van Velzen
parent b11c5151bc
commit abbeb266b5
2 changed files with 33 additions and 1 deletions

View File

@@ -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){