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

old formatting bug returns

Expand Messages
  • abyssoft@ymail.com
    View as fixed width Given /*jslint strict: true, white: true, browser: true, devel: true, windows: true, sub: true, undef: true */ /*jslint nomen: true,
    Message 1 of 3 , Feb 10, 2011
    • 0 Attachment
      View as fixed width

      Given

      /*jslint strict: true, white: true, browser: true, devel: true, windows: true, sub: true, undef: true */
      /*jslint nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, immed: true */
      /*jslint maxerr: 50, maxlen: 168, indent: 4 */

      var g = 1;
      var h = function () {
      "use strict";
      return 123;
      };
      var r = (
      g === 1 ?
      h(
      "yes"
      ) :
      "no"
      );

      Errors shown
      Error:
      Problem at line 13 character 13: Expected 'yes' at column 9, not column 13.

      "yes"

      Problem at line 14 character 9: Expected ')' at column 5, not column 9.

      ) :

      what it looks like if I go by these

      var g = 1;
      var h = function () {
      "use strict";
      return 123;
      };
      var r = (
      g === 1 ?
      h(
      "yes"
      ) :
      "no"
      );

      Definitely less readable. Seems to be having a problem handling function calls as the result of an inline boolean switch.
    • Douglas Crockford
      ... It is not a bug. You have two options: 1) You can adopt a less blatently flamboyant coding style. 2) You can turn option.white off. Your choice.
      Message 2 of 3 , Feb 11, 2011
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "abyssoft@..." <abyssoft@...> wrote:
        >
        > View as fixed width
        >
        > Given
        >
        > /*jslint strict: true, white: true, browser: true, devel: true, windows: true, sub: true, undef: true */
        > /*jslint nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, immed: true */
        > /*jslint maxerr: 50, maxlen: 168, indent: 4 */
        >
        > var g = 1;
        > var h = function () {
        > "use strict";
        > return 123;
        > };
        > var r = (
        > g === 1 ?
        > h(
        > "yes"
        > ) :
        > "no"
        > );
        >
        > Errors shown
        > Error:
        > Problem at line 13 character 13: Expected 'yes' at column 9, not column 13.
        >
        > "yes"
        >
        > Problem at line 14 character 9: Expected ')' at column 5, not column 9.
        >
        > ) :
        >
        > what it looks like if I go by these
        >
        > var g = 1;
        > var h = function () {
        > "use strict";
        > return 123;
        > };
        > var r = (
        > g === 1 ?
        > h(
        > "yes"
        > ) :
        > "no"
        > );
        >
        > Definitely less readable. Seems to be having a problem handling function calls as the result of an inline boolean switch.

        It is not a bug. You have two options:

        1) You can adopt a less blatently flamboyant coding style.

        2) You can turn option.white off.

        Your choice.
      • abyssoft@ymail.com
        I ll go with option 1, most of the flamboyance was intended for clarity. I will reduce complexity where possible to achieve the goals of option 1.
        Message 3 of 3 , Feb 11, 2011
        • 0 Attachment
          I'll go with option 1, most of the "flamboyance" was intended for clarity. I will reduce complexity where possible to achieve the goals of option 1.
        Your message has been successfully submitted and would be delivered to recipients shortly.