@@ -531,9 +531,14 @@ private Token readToken_question() { // '?'
531531 int next2 = charAt (this .pos + 2 );
532532 if (this .options .esnext ()) {
533533 if (next == '.' && !('0' <= next2 && next2 <= '9' )) // '?.', but not '?.X' where X is a digit
534- return this .finishOp (TokenType .questiondot , 2 );
535- if (next == '?' ) // '??'
536- return this .finishOp (TokenType .questionquestion , 2 );
534+ return this .finishOp (TokenType .questiondot , 2 );
535+ if (next == '?' ) { // '??'
536+ if (next2 == '=' ) { // ??=
537+ return this .finishOp (TokenType .assign , 3 );
538+ }
539+ return this .finishOp (TokenType .questionquestion , 2 );
540+ }
541+
537542 }
538543 return this .finishOp (TokenType .question , 1 );
539544 }
@@ -566,8 +571,11 @@ private Token readToken_mult_modulo_exp(int code) { // '%*'
566571
567572 private Token readToken_pipe_amp (int code ) { // '|&'
568573 int next = charAt (this .pos + 1 );
569- if (next == code )
574+ int next2 = charAt (this .pos + 2 );
575+ if (next == code ) { // && ||
576+ if (next2 == 61 ) return this .finishOp (TokenType .assign , 3 ); // &&= ||=
570577 return this .finishOp (code == 124 ? TokenType .logicalOR : TokenType .logicalAND , 2 );
578+ }
571579 if (next == 61 ) return this .finishOp (TokenType .assign , 2 );
572580 return this .finishOp (code == 124 ? TokenType .bitwiseOR : TokenType .bitwiseAND , 1 );
573581 }
@@ -709,8 +717,8 @@ protected Token getTokenFromCode(int code) {
709717 case 42 : // '%*'
710718 return this .readToken_mult_modulo_exp (code );
711719
712- case 124 :
713- case 38 : // '| &'
720+ case 124 : // '|'
721+ case 38 : // '&'
714722 return this .readToken_pipe_amp (code );
715723
716724 case 94 : // '^'
0 commit comments