src/pages/Log/Script/jsmin.js
/* next -- get the next character, excluding comments. peek() is used to see
  if a '/' is followed by a '/' or '*'.
  */
- get the next character, excluding comments.
- get the next character excluding comments .
function next() {
    let c = getc();
    if (c == '/') {
      switch (peek()) {
        case '/':
          for (;;) {
            c = getc();
            if (c <= '\n') {
              return c;
            }
          }
        case '*':
          getc();
          if (peek() == '!') {
            getc();
            let d = '/*!';
            for (;;) {
              c = getcIC(); 
              switch (c) {
                case '*':
                  if (peek() == '/') {
                    getc();
                    return d + '*/';
                  }
                  break;
                case EOF:
                  throw new Error('Error: Unterminated comment.');
                default:
                  d += c;
              }
            }
          } else {
            for (;;) {
              switch (getc()) {
                case '*':
                  if (peek() == '/') {
                    getc();
                    return ' ';
                  }
                  break;
                case EOF:
                  throw 'Error: Unterminated comment.';
              }
            }
          }
        default:
          return c;
      }
    }
    return c;
  }
function next ( ) { let c = getc ( ) ; if ( c == '/' ) { switch ( peek ( ) ) { case '/' : for ( ; ; ) { c = getc ( ) ; if ( c <= '\n' ) { return c ; } } case '*' : getc ( ) ; if ( peek ( ) == '!' ) { getc ( ) ; let d = '/*!' ; for ( ; ; ) { c = getcIC ( ) ; switch ( c ) { case '*' : if ( peek ( ) == '/' ) { getc ( ) ; return d + '*/' ; } break ; case EOF : throw new Error ( 'Error: Unterminated comment.' ) ; default : d += c ; } } } else { for ( ; ; ) { switch ( getc ( ) ) { case '*' : if ( peek ( ) == '/' ) { getc ( ) ; return ' ' ; } break ; case EOF : throw 'Error: Unterminated comment.' ; } } } default : return c ; } } return c ; }
next -- get the next character, excluding comments.
next -- get the next character excluding comments .
// this is a comment. What kind? // kill the extra one // important comment // let it know it's inside an important comment // modern JS engines handle string concats much better than the // array+push+join hack. // unimportant comment