File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -613,26 +613,31 @@ module TypeScript.Scanner {
613613 return createTrivia ( SyntaxKind . MultiLineCommentTrivia , absoluteStartIndex ) ;
614614 }
615615
616- function skipMultiLineCommentTrivia ( ) : number {
616+ function skipMultiLineCommentTrivia ( ) : void {
617617 // The '2' is for the "/*" we consumed.
618+ var _index = index + 2 ;
619+ var _end = end ;
620+
618621 index += 2 ;
619622
620623 while ( true ) {
621- if ( index === end ) {
624+ if ( _index === _end ) {
622625 reportDiagnostic ( end , 0 , DiagnosticCode . _0_expected , [ "*/" ] ) ;
623- return ;
626+ break ;
624627 }
625628
626- if ( ( index + 1 ) < end &&
627- str . charCodeAt ( index ) === CharacterCodes . asterisk &&
628- str . charCodeAt ( index + 1 ) === CharacterCodes . slash ) {
629+ if ( ( _index + 1 ) < _end &&
630+ str . charCodeAt ( _index ) === CharacterCodes . asterisk &&
631+ str . charCodeAt ( _index + 1 ) === CharacterCodes . slash ) {
629632
630- index += 2 ;
631- return ;
633+ _index += 2 ;
634+ break ;
632635 }
633636
634- index ++ ;
637+ _index ++ ;
635638 }
639+
640+ index = _index ;
636641 }
637642
638643 function scanLineTerminatorSequenceTrivia ( ch : number ) : ISyntaxTrivia {
You can’t perform that action at this time.
0 commit comments