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

Multiline strings---in 4 major browsers and ES5 but not JSLint

Expand Messages
  • iain_dalton
    There should be an option to allow var foo = Lorem ipsum dolor ; because IE, Fx, Opera, and Safari support it, and ECMAScript 5 will allow it officially.
    Message 1 of 3 , May 20, 2009
    View Source
    • 0 Attachment
      There should be an option to allow

      var foo = "Lorem \
      ipsum \
      dolor";

      because IE, Fx, Opera, and Safari support it, and ECMAScript 5 will allow it officially.
    • Philip Hutchison
      ... There are many features of JS that are technically valid that JS lint disapproves of. Plus, isn t it invalid in the current spec, even if browsers allow
      Message 2 of 3 , May 21, 2009
      View Source
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "iain_dalton" <iain.dalton@...> wrote:
        >
        > There should be an option to allow
        >
        > var foo = "Lorem \
        > ipsum \
        > dolor";
        >
        > because IE, Fx, Opera, and Safari support it, and ECMAScript 5 will allow it officially.
        >

        There are many features of JS that are technically valid that JS lint disapproves of. Plus, isn't it invalid in the current spec, even if browsers allow it? If so, why endorse something that we know is invalid?

        Personally, I find that syntax more difficult to read and more likely to cause accidents.

        What I like about JSLint (and Crockford's book JavaScript: The Good Parts) is the focus on good form, which I would loosely define as making code as clear, concise, and unambiguous as possible in an effort to improve legibility and reduce the chance of errors.

        Escaping line breaks feels kind of dirty to me. :)

        - philip
      • pauanyu
        ... I agree, but note that iain_dalton asked for an option for it.. not to make it the default behavior.
        Message 3 of 3 , May 21, 2009
        View Source
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Philip Hutchison" <platelunch@...> wrote:
          >
          > There are many features of JS that are technically valid that JS lint disapproves of. Plus, isn't it invalid in the current spec, even if browsers allow it? If so, why endorse something that we know is invalid?
          >
          > Personally, I find that syntax more difficult to read and more likely to cause accidents.
          >
          > What I like about JSLint (and Crockford's book JavaScript: The Good Parts) is the focus on good form, which I would loosely define as making code as clear, concise, and unambiguous as possible in an effort to improve legibility and reduce the chance of errors.
          >
          > Escaping line breaks feels kind of dirty to me. :)
          >
          > - philip
          >

          I agree, but note that iain_dalton asked for an option for it.. not to make it the default behavior.
        Your message has been successfully submitted and would be delivered to recipients shortly.