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

Re: [jslint] Re: several JSLint errors I can't understand

Expand Messages
  • Tom Byers
    Not helpful to the group at all. Also not helping as the issue seems to be if there should be an option for working with Mozilla JS, an important question
    Message 1 of 16 , Jan 7, 2010
    • 0 Attachment
      Not helpful to the group at all.

      Also not helping as the issue seems to be if there should be an option for
      working with Mozilla JS, an important question (especially bearing in mind
      the group has previously seen fit to at least think about including console
      as being valid).

      Äkräm has been keeping within the constraints of the language he is coding
      for (which is a type of JS).

      There's already quite a few 'assume' options (console, yahoo widget, rhino)
      so any *real* opinions on whether this should be put in or not?

      Tom

      On Thu, Jan 7, 2010 at 11:24 AM, Simon Kenyon Shepard <
      simon.shepard@...> wrote:

      > Hi Äkräm,
      >
      > I cannot help you with your JSLint problem, but may I suggest the following
      > book:
      >
      > http://www.amazon.com/How-Win-Friends-Influence-People/dp/1439167346/
      >
      > <http://www.amazon.com/How-Win-Friends-Influence-People/dp/1439167346/
      > >will
      > help you with the larger issue at hand.
      >
      >
      >
      > On Thu, Jan 7, 2010 at 10:34 AM, Ekrem Tomur <ekrem.tomur@...>
      > wrote:
      >
      > >
      > >
      > > Hi,
      > >
      > > Can somebody propose me a small patch or hint, I would like to implement
      > a
      > > workaround as treat all 'let' and 'const' like 'var'. So in this way I
      > can
      > > suppress those errors which I won't fix. I am working on jslint.js
      > 4.1.2009
      > > version. The code is not well tabbed and difficult to understand.
      > Somebody
      > > please help.
      > >
      > > Thanks in advance.
      > > Äkräm
      > >
      > >
      > > On Tue, Jan 5, 2010 at 3:14 PM, Ekrem Tomur <ekrem.tomur@...
      > <ekrem.tomur%40gmail.com>>
      > > wrote:
      > >
      > > > sorry, I forgot to tell, I am using JSLint to test Mozilla Javascript.
      > Is
      > > > that sound very stupid? If so I will stop doing that.
      > > > If not can you tell me how to adjust the options to meet the
      > > requirements?
      > > >
      > > > const is allowed in Mozilla Javascript and let is new feature in
      > mozilla
      > > > JavaScript version 1.7
      > > >
      > > > Thanks.
      > > >
      > > >
      > > > On Tue, Jan 5, 2010 at 3:06 PM, Douglas Crockford <
      > douglas@...<douglas%40crockford.com>
      > > >wrote:
      > > >
      > > >>
      > > >>
      > > >> --- In jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com
      > ><jslint_com%
      > > 40yahoogroups.com>, Ekrem
      > > >> Tomur <ekrem.tomur@...> wrote:
      > > >>
      > > >> > Can somebody tell me why JSLint give me these errors? I think let,
      > > const
      > > >> are
      > > >> > JavaScript language feature.
      > > >>
      > > >> They are not. let and const are not in any edition of the ECMAScript
      > > >> standard. Stick with the standard language. Use var instead.
      > > >>
      > > >>
      > > >>
      > > >
      > > >
      > >
      > > [Non-text portions of this message have been removed]
      > >
      > >
      > >
      >
      >
      >
      > --
      > "We are the music makers, And we are the dreamers of dreams"
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Simon Kenyon Shepard
      Sincere apologies if any offence was caused/time wasted, I agree with your position that it was not relevant to the topic at all. ... -- We are the music
      Message 2 of 16 , Jan 7, 2010
      • 0 Attachment
        Sincere apologies if any offence was caused/time wasted, I agree with your
        position that it was not relevant to the topic at all.

        On Thu, Jan 7, 2010 at 12:31 PM, Tom Byers <tombaromba@...> wrote:

        >
        >
        > Not helpful to the group at all.
        >
        > Also not helping as the issue seems to be if there should be an option for
        > working with Mozilla JS, an important question (especially bearing in mind
        > the group has previously seen fit to at least think about including console
        > as being valid).
        >
        > �kr�m has been keeping within the constraints of the language he is coding
        > for (which is a type of JS).
        >
        > There's already quite a few 'assume' options (console, yahoo widget, rhino)
        > so any *real* opinions on whether this should be put in or not?
        >
        > Tom
        >
        > On Thu, Jan 7, 2010 at 11:24 AM, Simon Kenyon Shepard <
        >
        > simon.shepard@... <simon.shepard%40googlemail.com>> wrote:
        >
        > > Hi �kr�m,
        > >
        > > I cannot help you with your JSLint problem, but may I suggest the
        > following
        > > book:
        > >
        > > http://www.amazon.com/How-Win-Friends-Influence-People/dp/1439167346/
        > >
        > > <http://www.amazon.com/How-Win-Friends-Influence-People/dp/1439167346/
        > > >will
        > > help you with the larger issue at hand.
        > >
        > >
        > >
        > > On Thu, Jan 7, 2010 at 10:34 AM, Ekrem Tomur <ekrem.tomur@...<ekrem.tomur%40gmail.com>
        > >
        > > wrote:
        > >
        > > >
        > > >
        > > > Hi,
        > > >
        > > > Can somebody propose me a small patch or hint, I would like to
        > implement
        > > a
        > > > workaround as treat all 'let' and 'const' like 'var'. So in this way I
        > > can
        > > > suppress those errors which I won't fix. I am working on jslint.js
        > > 4.1.2009
        > > > version. The code is not well tabbed and difficult to understand.
        > > Somebody
        > > > please help.
        > > >
        > > > Thanks in advance.
        > > > �kr�m
        > > >
        > > >
        > > > On Tue, Jan 5, 2010 at 3:14 PM, Ekrem Tomur <ekrem.tomur@...<ekrem.tomur%40gmail.com>
        > > <ekrem.tomur%40gmail.com>>
        >
        > > > wrote:
        > > >
        > > > > sorry, I forgot to tell, I am using JSLint to test Mozilla
        > Javascript.
        > > Is
        > > > > that sound very stupid? If so I will stop doing that.
        > > > > If not can you tell me how to adjust the options to meet the
        > > > requirements?
        > > > >
        > > > > const is allowed in Mozilla Javascript and let is new feature in
        > > mozilla
        > > > > JavaScript version 1.7
        > > > >
        > > > > Thanks.
        > > > >
        > > > >
        > > > > On Tue, Jan 5, 2010 at 3:06 PM, Douglas Crockford <
        > > douglas@... <douglas%40crockford.com><douglas%40crockford.com>
        >
        > > > >wrote:
        > > > >
        > > > >>
        > > > >>
        > > > >> --- In jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com><jslint_com%
        > 40yahoogroups.com
        > > ><jslint_com%
        > > > 40yahoogroups.com>, Ekrem
        > > > >> Tomur <ekrem.tomur@...> wrote:
        > > > >>
        > > > >> > Can somebody tell me why JSLint give me these errors? I think let,
        > > > const
        > > > >> are
        > > > >> > JavaScript language feature.
        > > > >>
        > > > >> They are not. let and const are not in any edition of the ECMAScript
        > > > >> standard. Stick with the standard language. Use var instead.
        > > > >>
        > > > >>
        > > > >>
        > > > >
        > > > >
        > > >
        > > > [Non-text portions of this message have been removed]
        > > >
        > > >
        > > >
        > >
        > >
        > >
        > > --
        >
        > > "We are the music makers, And we are the dreamers of dreams"
        > >
        > >
        > > [Non-text portions of this message have been removed]
        > >
        > >
        > >
        > > ------------------------------------
        > >
        > > Yahoo! Groups Links
        >
        > >
        > >
        > >
        > >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >



        --
        "We are the music makers, And we are the dreamers of dreams"


        [Non-text portions of this message have been removed]
      • Harry Whitfield
        Äkräm, Instead of trying to modify JSLint to accept non-standard JavaScript, you could consider altering the JavaScript code to make it conform to the
        Message 3 of 16 , Jan 7, 2010
        • 0 Attachment
          Äkräm,

          Instead of trying to modify JSLint to accept non-standard JavaScript, you could consider altering the JavaScript code to make it conform to the standard.
          That would be my preferred solution.

          Another possibility would be to pre-process the code to replace "let" and "const" by "var". It would also be fairly easy to modify JSLint or its file input code to do that.
          However, if I remember correctly, the semantics of "let" is not quite the same as that of "var".

          Harry.
        • Ekrem Tomur
          Hi Harry, Thank you for your helpful thoughts. But since I am a tester on a mozilla extension project and those js code I am testing meant to run on mozilla
          Message 4 of 16 , Jan 7, 2010
          • 0 Attachment
            Hi Harry,

            Thank you for your helpful thoughts. But since I am a tester on a mozilla
            extension project and those js code I am testing meant to run on mozilla
            javascript engine, I can not ask developers to use standard javascript
            instead of mozilla one. I must test their code, I hope JSLint can help me a
            little bit.

            You are right, now I also think treating let and const as var is a bad idea,
            since they are not quiet similar and also should be tested as a way they
            should be tested. So I like Tom's idea, add an Mozilla option since this is
            also quiet popular version of JS. If that could be done I will happy to
            contribute.

            Br,
            Äkräm

            On Thu, Jan 7, 2010 at 2:45 PM, Harry Whitfield <g7awz@...>wrote:

            >
            >
            > Äkräm,
            >
            > Instead of trying to modify JSLint to accept non-standard JavaScript, you
            > could consider altering the JavaScript code to make it conform to the
            > standard.
            > That would be my preferred solution.
            >
            > Another possibility would be to pre-process the code to replace "let" and
            > "const" by "var". It would also be fairly easy to modify JSLint or its file
            > input code to do that.
            > However, if I remember correctly, the semantics of "let" is not quite the
            > same as that of "var".
            >
            > Harry.
            >
            >
            >


            [Non-text portions of this message have been removed]
          • Tom Byers
            Interesting and kind of a catch 22. If Äkräm substitutes let and const then he is using the syntax of the language he is working in against the spec, the
            Message 5 of 16 , Jan 7, 2010
            • 0 Attachment
              Interesting and kind of a catch 22. If �kr�m substitutes let and const then
              he is using the syntax of the language he is working in against the spec,
              the very thing JSLint is meant to prevent.

              From what I read let is an additional way to define block scope so you could
              do some pre-processing that wrapped it in a function and split the variable
              assignments in the brackets out into separate variable assignments. This
              should let you test the scope correctly:

              var x = 5;
              var y = 0;

              let (x = x+10, y = 12) {
              print(x+y + "\n");
              }

              print((x + y) + "\n");

              as

              var x = 5;
              var y = 0;

              var let1 = function() {
              var x = x+10, y = 12;
              print(x+y + "\n");
              }

              print((x + y) + "\n");

              Print should also be commented.

              As for const, this provides something that standard Javascript doesn't
              currently support - proper constants. You can declare them as vars for the
              purposes of Linting but this JSLint will not actually check that your
              developers are staying true to the syntax.

              https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/const

              Tom

              p.s. don't worry to Simon, just trying to get this interesting discussion
              back on track :)

              On Thu, Jan 7, 2010 at 1:18 PM, Ekrem Tomur <ekrem.tomur@...> wrote:

              >
              >
              > Hi Harry,
              >
              > Thank you for your helpful thoughts. But since I am a tester on a mozilla
              > extension project and those js code I am testing meant to run on mozilla
              > javascript engine, I can not ask developers to use standard javascript
              > instead of mozilla one. I must test their code, I hope JSLint can help me a
              > little bit.
              >
              > You are right, now I also think treating let and const as var is a bad
              > idea,
              > since they are not quiet similar and also should be tested as a way they
              > should be tested. So I like Tom's idea, add an Mozilla option since this is
              > also quiet popular version of JS. If that could be done I will happy to
              > contribute.
              >
              > Br,
              > �kr�m
              >
              > On Thu, Jan 7, 2010 at 2:45 PM, Harry Whitfield <g7awz@...<g7awz%40btinternet.com>
              > >wrote:
              >
              >
              > >
              > >
              > > �kr�m,
              > >
              > > Instead of trying to modify JSLint to accept non-standard JavaScript, you
              > > could consider altering the JavaScript code to make it conform to the
              > > standard.
              > > That would be my preferred solution.
              > >
              > > Another possibility would be to pre-process the code to replace "let" and
              > > "const" by "var". It would also be fairly easy to modify JSLint or its
              > file
              > > input code to do that.
              > > However, if I remember correctly, the semantics of "let" is not quite the
              > > same as that of "var".
              > >
              > > Harry.
              > >
              > >
              > >
              >
              > [Non-text portions of this message have been removed]
              >
              >
              >


              [Non-text portions of this message have been removed]
            • Morgaut Alexandre Louis Marc
              I saw in previous posts kind of same assume request for some ssjs environment. I think it might be harder to assume mozilla or commonjs Than browser
              Message 6 of 16 , Jan 7, 2010
              • 0 Attachment
                I saw in previous posts kind of same "assume" request for some ssjs
                environment.

                I think it might be harder to assume "mozilla" or "commonjs" Than
                "browser" and "rhino" Because Mozilla JavaScript has more commands,
                and CommonJS has more types whereas the lastest only have builtin
                objects and methods which CAN be declared to JSLint as globals.

                Mozilla JavaScript is a différent language version, as are
                ActionScript and JScript. All of them should support ecmascript
                specification which is what JSlint is testing

                Asking to JSlint to support the specificities of main JavaScript
                implentation could be a powerfull option, it just be a little more
                complicated.

                It looks like one of the goals of JSLint was to help writing safe and
                portable codes, which explain the limitation to ECMAScript.

                So what about choosing the version number of the implementation we
                want to assume (Well I could like it)

                But sure, I'd love assume "server" instead of "rhino"

                Alexandre

                From iPhone

                Le 7 janv. 2010 à 14:18, Ekrem Tomur <ekrem.tomur@...> a écrit :

                > Hi Harry,
                >
                > Thank you for your helpful thoughts. But since I am a tester on a
                > mozilla
                > extension project and those js code I am testing meant to run on
                > mozilla
                > javascript engine, I can not ask developers to use standard javascript
                > instead of mozilla one. I must test their code, I hope JSLint can
                > help me a
                > little bit.
                >
                > You are right, now I also think treating let and const as var is a
                > bad idea,
                > since they are not quiet similar and also should be tested as a way
                > they
                > should be tested. So I like Tom's idea, add an Mozilla option since
                > this is
                > also quiet popular version of JS. If that could be done I will happy
                > to
                > contribute.
                >
                > Br,
                > Äkräm
                >
                > On Thu, Jan 7, 2010 at 2:45 PM, Harry Whitfield
                > <g7awz@...>wrote:
                >
                > >
                > >
                > > Äkräm,
                > >
                > > Instead of trying to modify JSLint to accept non-standard
                > JavaScript, you
                > > could consider altering the JavaScript code to make it conform to
                > the
                > > standard.
                > > That would be my preferred solution.
                > >
                > > Another possibility would be to pre-process the code to replace
                > "let" and
                > > "const" by "var". It would also be fairly easy to modify JSLint or
                > its file
                > > input code to do that.
                > > However, if I remember correctly, the semantics of "let" is not
                > quite the
                > > same as that of "var".
                > >
                > > Harry.
                > >
                > >
                > >
                >
                > [Non-text portions of this message have been removed]
                >
                >


                [Non-text portions of this message have been removed]
              • Ekrem Tomur
                Can somebody send me well formatted version of jslint.js? I really do not want to waste my time on preprocessing since it is wrong and limited. I want to try
                Message 7 of 16 , Jan 8, 2010
                • 0 Attachment
                  Can somebody send me well formatted version of jslint.js? I really do not
                  want to waste my time on preprocessing since it is wrong and limited. I want
                  to try to implement Mozilla option myself, at least the part I needed. But
                  that jslint.js version annoying me since it is hard to read and change.

                  On Thu, Jan 7, 2010 at 7:17 PM, Morgaut Alexandre Louis Marc <
                  morgaut@...> wrote:

                  >
                  >
                  > I saw in previous posts kind of same "assume" request for some ssjs
                  > environment.
                  >
                  > I think it might be harder to assume "mozilla" or "commonjs" Than
                  > "browser" and "rhino" Because Mozilla JavaScript has more commands,
                  > and CommonJS has more types whereas the lastest only have builtin
                  > objects and methods which CAN be declared to JSLint as globals.
                  >
                  > Mozilla JavaScript is a différent language version, as are
                  > ActionScript and JScript. All of them should support ecmascript
                  > specification which is what JSlint is testing
                  >
                  > Asking to JSlint to support the specificities of main JavaScript
                  > implentation could be a powerfull option, it just be a little more
                  > complicated.
                  >
                  > It looks like one of the goals of JSLint was to help writing safe and
                  > portable codes, which explain the limitation to ECMAScript.
                  >
                  > So what about choosing the version number of the implementation we
                  > want to assume (Well I could like it)
                  >
                  > But sure, I'd love assume "server" instead of "rhino"
                  >
                  > Alexandre
                  >
                  > From iPhone
                  >
                  > Le 7 janv. 2010 à 14:18, Ekrem Tomur <ekrem.tomur@...<ekrem.tomur%40gmail.com>>
                  > a écrit :
                  >
                  >
                  > > Hi Harry,
                  > >
                  > > Thank you for your helpful thoughts. But since I am a tester on a
                  > > mozilla
                  > > extension project and those js code I am testing meant to run on
                  > > mozilla
                  > > javascript engine, I can not ask developers to use standard javascript
                  > > instead of mozilla one. I must test their code, I hope JSLint can
                  > > help me a
                  > > little bit.
                  > >
                  > > You are right, now I also think treating let and const as var is a
                  > > bad idea,
                  > > since they are not quiet similar and also should be tested as a way
                  > > they
                  > > should be tested. So I like Tom's idea, add an Mozilla option since
                  > > this is
                  > > also quiet popular version of JS. If that could be done I will happy
                  > > to
                  > > contribute.
                  > >
                  > > Br,
                  > > Äkräm
                  > >
                  > > On Thu, Jan 7, 2010 at 2:45 PM, Harry Whitfield
                  > > <g7awz@... <g7awz%40btinternet.com>>wrote:
                  > >
                  > > >
                  > > >
                  > > > Äkräm,
                  > > >
                  > > > Instead of trying to modify JSLint to accept non-standard
                  > > JavaScript, you
                  > > > could consider altering the JavaScript code to make it conform to
                  > > the
                  > > > standard.
                  > > > That would be my preferred solution.
                  > > >
                  > > > Another possibility would be to pre-process the code to replace
                  > > "let" and
                  > > > "const" by "var". It would also be fairly easy to modify JSLint or
                  > > its file
                  > > > input code to do that.
                  > > > However, if I remember correctly, the semantics of "let" is not
                  > > quite the
                  > > > same as that of "var".
                  > > >
                  > > > Harry.
                  > > >
                  > > >
                  > > >
                  > >
                  > > [Non-text portions of this message have been removed]
                  > >
                  > >
                  >
                  > [Non-text portions of this message have been removed]
                  >
                  >
                  >


                  [Non-text portions of this message have been removed]
                • Douglas Crockford
                  ... Read the instructions. http://www.jslint.com/lint.html
                  Message 8 of 16 , Jan 8, 2010
                  • 0 Attachment
                    --- In jslint_com@yahoogroups.com, Ekrem Tomur <ekrem.tomur@...> wrote:
                    >
                    > Can somebody send me well formatted version of jslint.js? I really do not
                    > want to waste my time on preprocessing since it is wrong and limited. I want
                    > to try to implement Mozilla option myself, at least the part I needed. But
                    > that jslint.js version annoying me since it is hard to read and change.


                    Read the instructions. http://www.jslint.com/lint.html
                  • Klemen Slavič
                    Or try a code beautifier: http://jsbeautifier.org/ 2010/1/8 Douglas Crockford ... [Non-text portions of this message have been removed]
                    Message 9 of 16 , Jan 8, 2010
                    • 0 Attachment
                      Or try a code beautifier:

                      http://jsbeautifier.org/

                      2010/1/8 Douglas Crockford <douglas@...>

                      >
                      >
                      > --- In jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>, Ekrem
                      > Tomur <ekrem.tomur@...> wrote:
                      > >
                      > > Can somebody send me well formatted version of jslint.js? I really do not
                      > > want to waste my time on preprocessing since it is wrong and limited. I
                      > want
                      > > to try to implement Mozilla option myself, at least the part I needed.
                      > But
                      > > that jslint.js version annoying me since it is hard to read and change.
                      >
                      > Read the instructions. http://www.jslint.com/lint.html
                      >
                      >
                      >


                      [Non-text portions of this message have been removed]
                    • Noah Sussman
                      ... How about http://www.jslint.com/fulljslint.js
                      Message 10 of 16 , Jan 8, 2010
                      • 0 Attachment
                        On Fri, Jan 8, 2010 at 9:18 AM, Ekrem Tomur <ekrem.tomur@...> wrote:
                        >
                        >
                        >
                        > Can somebody send me well formatted version of jslint.js?

                        How about

                        http://www.jslint.com/fulljslint.js
                      Your message has been successfully submitted and would be delivered to recipients shortly.