Loading ...
Sorry, an error occurred while loading the content.

Inline Option Causing Error

Expand Messages
  • benxwhite
    var getGroupId = function (group) { /*jslint regexp:true*/ return group.name.replace(/ | W/g, ).toLowerCase(); /*jslint regexp:false*/ }; This throws an
    Message 1 of 2 , Aug 16, 2011
    • 0 Attachment
      var getGroupId = function (group) {
      /*jslint regexp:true*/
      return group.name.replace(/<.+?>|\W/g, '').toLowerCase();
      /*jslint regexp:false*/
      };

      This throws an error even though there is no code after the return statement.
    • Douglas Crockford
      ... /*jslint*/ directives are treated as statements because they respect block scope. Because they respect block scope, your second directive is useless and
      Message 2 of 2 , Aug 16, 2011
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "benxwhite" <ben.a.white@...> wrote:
        >
        > var getGroupId = function (group) {
        > /*jslint regexp:true*/
        > return group.name.replace(/<.+?>|\W/g, '').toLowerCase();
        > /*jslint regexp:false*/
        > };
        >
        > This throws an error even though there is no code after the return statement.

        /*jslint*/ directives are treated as statements because they respect block scope. Because they respect block scope, your second directive is useless and should be removed.
      Your message has been successfully submitted and would be delivered to recipients shortly.