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

Can't use /*properties */

Expand Messages
  • Jérôme DESPATIS
    Hello Again on my dojo script, I d like to prefill the /*properties */ in order to avoid type confusion error on some dojo functions For example in a script
    Message 1 of 2 , Jul 13, 2011
      Hello

      Again on my dojo script, I'd like to prefill the /*properties */ in
      order to avoid type confusion error on some dojo functions

      For example in a script .js, JSLint returns me the error:

      Problem at line 73 character 35: Type confusion: function and .style:
      object.
      dojo.query('#djGeoStatus').style({'display': ''});


      I have indeed in the source the line:
      div = dojo.create("div", {style: { clear: 'both'}},
      dojo.byId("djGeoSummary"));

      So I guess the type confusion comes from those 2 lines

      => So I add /*properties style: * */ in my script

      But then, I get a bunch of errors like:

      Problem at line 13 character 6: Unexpected /*property*/ 'require'.
      dojo.require("dojo.html");

      Problem at line 27 character 14: Unexpected /*property*/ 'q'.
      if (data.q === 'PUBLISH' && (data.topic === '/djgeo/download/begin' || da...

      etc...

      I don't understand where is my mistake ?
      I just need to say that the 'style' property can be an object or a function

      Thanks for your help

      --
      Jérôme Despatis
      jerome@...
    • Douglas Crockford
      ... The /*properties */ directive tells JSLint that you want checking on all property names. This allows JSLint to detect misspelled names. You might want to
      Message 2 of 2 , Jul 13, 2011
        --- In jslint_com@yahoogroups.com, Jérôme DESPATIS <jerome@...> wrote:
        > Again on my dojo script, I'd like to prefill the /*properties */ in
        > order to avoid type confusion error on some dojo functions
        >
        > For example in a script .js, JSLint returns me the error:
        >
        > Problem at line 73 character 35: Type confusion: function and .style:
        > object.
        > dojo.query('#djGeoStatus').style({'display': ''});
        >
        >
        > I have indeed in the source the line:
        > div = dojo.create("div", {style: { clear: 'both'}},
        > dojo.byId("djGeoSummary"));
        >
        > So I guess the type confusion comes from those 2 lines
        >
        > => So I add /*properties style: * */ in my script
        >
        > But then, I get a bunch of errors like:
        >
        > Problem at line 13 character 6: Unexpected /*property*/ 'require'.
        > dojo.require("dojo.html");
        >
        > Problem at line 27 character 14: Unexpected /*property*/ 'q'.
        > if (data.q === 'PUBLISH' && (data.topic === '/djgeo/download/begin' || da...
        >
        > etc...
        >
        > I don't understand where is my mistake ?
        > I just need to say that the 'style' property can be an object or a function


        The /*properties */ directive tells JSLint that you want checking on all property names. This allows JSLint to detect misspelled names.

        You might want to read the instructions: http://www.jslint.com/lint.html#properties
      Your message has been successfully submitted and would be delivered to recipients shortly.