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

members question

Expand Messages
  • Arthur Blake
    With the following code: /*jslint browser: true, onevar: true, maxerr: 50 */ /*global jsonrpc:false*/ function loadPopup(parm) {
    Message 1 of 3 , Aug 14, 2009
    • 0 Attachment
      With the following code:

      /*jslint browser: true, onevar: true, maxerr: 50 */
      /*global jsonrpc:false*/

      function loadPopup(parm)
      {
      jsonrpc.test.func(function(r,e)
      {
      var win,uri = '/test',opts= 'width=100,height=100';

      if (parm)
      {
      uri += '?parm=' + parm;
      }
      if (r)
      {
      uri += '&r' + r;
      }
      win = open(uri,undefined, opts);
      if (win)
      {
      win.focus();
      }
      });
      }

      jslint reports at the end:

      /*members *focus*, *func*, *test*
      */


      Is this normal behavior? What is the motivation behind this report? When I
      think of "members" I think symbols that are internal to my code, but all the
      "members" reported are external symbols... Also, whenever I see pink, I
      assume that it's an error (because errors are reported in the same color...)
      but in this case I don't think it's an error...

      Thanks.


      [Non-text portions of this message have been removed]
    • Cheney, Edward A SSG RES USAR USARC
      Members Since JavaScript is a loosely-typed, dynamic-object language, it is not possible to determine at compile time if property names are spelled correctly.
      Message 2 of 3 , Aug 15, 2009
      • 0 Attachment
        Members

        Since JavaScript is a loosely-typed, dynamic-object language, it is not possible to determine at compile time if property names are spelled correctly. JSLint provides some assistance with this.

        At the bottom of its report, JSLint displays a /*members*/ comment. It contains all of the names and string literals that were used with dot notation, subscript notation, and object literals to name the members of objects. You can look through the list for misspellings. Member names that were only used once are shown in italics. This is to make misspellings easier to spot.

        You can copy the /*members*/ comment into your script file. JSLint will check the spelling of all property names against the list. That way, you can have JSLint look for misspellings for you.

        http://www.jslint.com/lint.html

        ----- Original Message -----
        From: Arthur Blake <arthur.blake@...>
        Date: Friday, August 14, 2009 20:23
        Subject: [jslint] members question
        To: jslint_com@yahoogroups.com


        > With the following code:
        >
        > /*jslint browser: true, onevar: true, maxerr: 50 */
        > /*global jsonrpc:false*/
        >
        > function loadPopup(parm)
        > {
        > jsonrpc.test.func(function(r,e)
        > {
        > var win,uri = '/test',opts= 'width=100,height=100';
        >
        > if (parm)
        > {
        > uri += '?parm=' + parm;
        > }
        > if (r)
        > {
        > uri += '&r' + r;
        > }
        > win = open(uri,undefined, opts);
        > if (win)
        > {
        > win.focus();
        > }
        > });
        > }
        >
        > jslint reports at the end:
        >
        > /*members *focus*, *func*, *test*
        > */
        >
        >
        > Is this normal behavior? What is the motivation behind this
        > report? When I
        > think of "members" I think symbols that are internal to my code,
        > but all the
        > "members" reported are external symbols... Also, whenever I see
        > pink, I
        > assume that it's an error (because errors are reported in the same
        > color...)but in this case I don't think it's an error...
        >
        > Thanks.
        >
        >
        > [Non-text portions of this message have been removed]
        >
      • Arthur Blake
        Thanks and my apologies for not seeing that in the manual.One basic problem with this is that it can t discern between members and members of members (and
        Message 3 of 3 , Aug 17, 2009
        • 0 Attachment
          Thanks and my apologies for not seeing that in the manual.One basic problem
          with this is that it can't discern between members and members of members
          (and members of members of members, etc.)

          e.g.

          /*global b*/ function a() { b.cat(); b.cat.dog.cat.dog(); }

          doesn't help me know if cat's dog's cat is spelled right, versus b's cat.


          On Sat, Aug 15, 2009 at 5:16 AM, Cheney, Edward A SSG RES USAR USARC <
          austin.cheney@...> wrote:

          >
          >
          > Members
          >
          > Since JavaScript is a loosely-typed, dynamic-object language, it is not
          > possible to determine at compile time if property names are spelled
          > correctly. JSLint provides some assistance with this.
          >
          > At the bottom of its report, JSLint displays a /*members*/ comment. It
          > contains all of the names and string literals that were used with dot
          > notation, subscript notation, and object literals to name the members of
          > objects. You can look through the list for misspellings. Member names that
          > were only used once are shown in italics. This is to make misspellings
          > easier to spot.
          >
          > You can copy the /*members*/ comment into your script file. JSLint will
          > check the spelling of all property names against the list. That way, you can
          > have JSLint look for misspellings for you.
          >
          > http://www.jslint.com/lint.html
          >
          >
          > ----- Original Message -----
          > From: Arthur Blake <arthur.blake@... <arthur.blake%40gmail.com>>
          > Date: Friday, August 14, 2009 20:23
          > Subject: [jslint] members question
          > To: jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>
          >
          > > With the following code:
          > >
          > > /*jslint browser: true, onevar: true, maxerr: 50 */
          > > /*global jsonrpc:false*/
          > >
          > > function loadPopup(parm)
          > > {
          > > jsonrpc.test.func(function(r,e)
          > > {
          > > var win,uri = '/test',opts= 'width=100,height=100';
          > >
          > > if (parm)
          > > {
          > > uri += '?parm=' + parm;
          > > }
          > > if (r)
          > > {
          > > uri += '&r' + r;
          > > }
          > > win = open(uri,undefined, opts);
          > > if (win)
          > > {
          > > win.focus();
          > > }
          > > });
          > > }
          > >
          > > jslint reports at the end:
          > >
          > > /*members *focus*, *func*, *test*
          > > */
          > >
          > >
          > > Is this normal behavior? What is the motivation behind this
          > > report? When I
          > > think of "members" I think symbols that are internal to my code,
          > > but all the
          > > "members" reported are external symbols... Also, whenever I see
          > > pink, I
          > > assume that it's an error (because errors are reported in the same
          > > color...)but in this case I don't think it's an error...
          > >
          > > Thanks.
          > >
          > >
          > > [Non-text portions of this message have been removed]
          > >
          >
          >
          >


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.