Skip to content

Commit

Permalink
Corrected precedence of tokens & fixed the output file
Browse files Browse the repository at this point in the history
  • Loading branch information
sidntrivedi012 committed Jan 15, 2020
1 parent 1acd676 commit 38bf8f0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
48 changes: 24 additions & 24 deletions packages/babel-generator/src/node/parentheses.js
@@ -1,31 +1,31 @@
import * as t from "@babel/types";

const PRECEDENCE = {
"||": 0,
"??": 0,
"&&": 1,
"|": 2,
"^": 3,
"&": 4,
"==": 5,
"===": 5,
"!=": 5,
"!==": 5,
"<": 6,
">": 6,
"<=": 6,
">=": 6,
in: 6,
instanceof: 6,
">>": 7,
"<<": 7,
">>>": 7,
"+": 8,
"-": 8,
"*": 9,
"/": 9,
"%": 9,
"**": 10,
"||": 1,
"&&": 2,
"|": 3,
"^": 4,
"&": 5,
"==": 6,
"===": 6,
"!=": 6,
"!==": 6,
"<": 7,
">": 7,
"<=": 7,
">=": 7,
in: 7,
instanceof: 7,
">>": 8,
"<<": 8,
">>>": 8,
"+": 9,
"-": 9,
"*": 10,
"/": 10,
"%": 10,
"**": 11,
};

const isClassExtendsClause = (node: Object, parent: Object): boolean =>
Expand Down
@@ -1,2 +1,2 @@
const foo = 'test';
console.log(foo ?? '' == '');
console.log((foo ?? '') == '');

0 comments on commit 38bf8f0

Please sign in to comment.