code: function skipComment() {
          var ch, blockComment, lineComment;
  
          blockComment = false;
          lineComment = false;
  
          while (index < length) {
              ch = source[index];
  
              if (lineComment) {
                  ch = nextChar();
                  if (isLineTerminator(ch)) {
                      lineComment = false;
                      if (ch === '\r' && source[index] === '\n') {
                          ++index;
                      }
                      ++lineNumber;
                      lineStart = index;
                  }
              } else if (blockComment) {
                  if (isLineTerminator(ch)) {
                      if (ch === '\r' && source[index + 1] === '\n') {
                          ++index;
                      }
                      ++lineNumber;
                      ++index;
                      lineStart = index;
                      if (index >= length) {
                          throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                      }
                  } else {
                      ch = nextChar();
                      if (index >= length) {
                          throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                      }
                      if (ch === '*') {
                          ch = source[index];
                          if (ch === '/') {
                              ++index;
                              blockComment = false;
                          }
                      }
                  }
              } else if (ch === '/') {
                  ch = source[index + 1];
                  if (ch === '/') {
                      index += 2;
                      lineComment = true;
                  } else if (ch === '*') {
                      index += 2;
                      blockComment = true;
                      if (index >= length) {
                          throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                      }
                  } else {
                      break;
                  }
              } else if (isWhiteSpace(ch)) {
                  ++index;
              } else if (isLineTerminator(ch)) {
                  ++index;
                  if (ch ===  '\r' && source[index] === '\n') {
                      ++index;
                  }
                  ++lineNumber;
                  lineStart = index;
              } else {
                  break;
              }
          }
      }
docs: 7.4 Comments