Skip to content

Commit

Permalink
fix: lower yield operator precedence
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbonnet committed Feb 3, 2021
1 parent 4eff1e9 commit d3af2fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/astring.js
Expand Up @@ -80,11 +80,11 @@ export const EXPRESSIONS_PRECEDENCE = {
UpdateExpression: 16,
UnaryExpression: 15,
AwaitExpression: 15,
YieldExpression: 15,
BinaryExpression: 14,
LogicalExpression: 13,
ConditionalExpression: 4,
AssignmentExpression: 3,
YieldExpression: 2,
RestElement: 1,
}

Expand Down
2 changes: 2 additions & 0 deletions src/tests/fixtures/syntax/precedence.js
Expand Up @@ -46,5 +46,7 @@ g = b + -+-a++;
await f().a;
yield 1;
yield 1 + 2;
(yield 1) + (yield 2);
yield a = b;
const c = yield 3;
});

0 comments on commit d3af2fc

Please sign in to comment.