fix parse and output of yield (#2690)

fixes #2689
This commit is contained in:
Alex Lam S.L
2017-12-30 03:27:26 +08:00
committed by GitHub
parent 53600e9869
commit 725aac8b46
4 changed files with 111 additions and 88 deletions

View File

@@ -799,6 +799,10 @@ function OutputStream(options) {
// a = yield 3
if (p instanceof AST_Binary && p.operator !== "=")
return true;
// (yield 1)()
// new (yield 1)()
if (p instanceof AST_Call && p.expression === this)
return true;
// (yield 1) ? yield 2 : yield 3
if (p instanceof AST_Conditional && p.condition === this)
return true;