public/js/vendor/jshint/jshint.js
function commentToken(label, body, opt) {
      var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"];
      var isSpecial = false;
      var value = label + body;
      var commentType = "plain";
      opt = opt || {};

      if (opt.isMultiline) {
        value += "*/";
      }

      special.forEach(function (str) {
        if (isSpecial) {
          return;
        }

        // Don't recognize any special comments other than jshint for single-line
        // comments. This introduced many problems with legit comments.
        if (label === "//" && str !== "jshint") {
          return;
        }

        if (body.substr(0, str.length) === str) {
          isSpecial = true;
          label = label + str;
          body = body.substr(str.length);
        }

        if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) {
          isSpecial = true;
          label = label + " " + str;
          body = body.substr(str.length + 1);
        }

        if (!isSpecial) {
          return;
        }

        switch (str) {
        case "member":
          commentType = "members";
          break;
        case "global":
          commentType = "globals";
          break;
        default:
          commentType = str;
        }
      });

      return {
        type: Token.Comment,
        commentType: commentType,
        value: value,
        body: body,
        isSpecial: isSpecial,
        isMultiline: opt.isMultiline || false,
        isMalformed: opt.isMalformed || false
      };
    }
function commentToken(label, body, opt) {
      var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"];
      var isSpecial = false;
      var value = label + body;
      var commentType = "plain";
      opt = opt || {};

      if (opt.isMultiline) {
        value += "*/";
      }

      special.forEach(function (str) {
        if (isSpecial) {
          return;
        }

        // Don't recognize any special comments other than jshint for single-line
        // comments. This introduced many problems with legit comments.
        if (label === "//" && str !== "jshint") {
          return;
        }

        if (body.substr(0, str.length) === str) {
          isSpecial = true;
          label = label + str;
          body = body.substr(str.length);
        }

        if (!isSpecial && body.charAt(0) === " " && body.substr(1, str.length) === str) {
          isSpecial = true;
          label = label + " " + str;
          body = body.substr(str.length + 1);
        }

        if (!isSpecial) {
          return;
        }

        switch (str) {
        case "member":
          commentType = "members";
          break;
        case "global":
          commentType = "globals";
          break;
        default:
          commentType = str;
        }
      });

      return {
        type: Token.Comment,
        commentType: commentType,
        value: value,
        body: body,
        isSpecial: isSpecial,
        isMultiline: opt.isMultiline || false,
        isMalformed: opt.isMalformed || false
      };
    }
function commentToken ( label , body , opt ) { var special = [ "jshint" , "jslint" , "members" , "member" , "globals" , "global" , "exported" ] ; var isSpecial = false ; var value = label + body ; var commentType = "plain" ; opt = opt || { } ; if ( opt . isMultiline ) { value += "*/" ; } special . forEach ( function ( str ) { if ( isSpecial ) { return ; } // Don't recognize any special comments other than jshint for single-line // comments. This introduced many problems with legit comments. if ( label === "//" && str !== "jshint" ) { return ; } if ( body . substr ( 0 , str . length ) === str ) { isSpecial = true ; label = label + str ; body = body . substr ( str . length ) ; } if ( ! isSpecial && body . charAt ( 0 ) === " " && body . substr ( 1 , str . length ) === str ) { isSpecial = true ; label = label + " " + str ; body = body . substr ( str . length + 1 ) ; } if ( ! isSpecial ) { return ; } switch ( str ) { case "member" : commentType = "members" ; break ; case "global" : commentType = "globals" ; break ; default : commentType = str ; } } ) ; return { type : Token . Comment , commentType : commentType , value : value , body : body , isSpecial : isSpecial , isMultiline : opt . isMultiline || false , isMalformed : opt . isMalformed || false } ; }
Create a comment token object and make sure it has all the data JSHint needs to work with special comments.
Create a comment token object and make sure it has all the data JSHint needs to work with special comments .