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

Function and property

Expand Messages
  • IceBox
    Y.DataType.Date.format(ld, {format: %a, %b %d, %H:%M }); The following message is displayed: Problem at line 1 character 37: Type confusion: function and %a,
    Message 1 of 5 , Jun 25, 2011
    • 0 Attachment
      Y.DataType.Date.format(ld, {format: "%a, %b %d, %H:%M"});

      The following message is displayed:
      Problem at line 1 character 37: Type confusion: function and '%a, %b %d, %H:%M': string.

      If I change the name of the property the error is gone.
      Of course I cannot change that name.

      Any idea?

      Regards,
      Alberto
    • Douglas Crockford
      ... You are using .format as a function and as a string. You should select the Tolerate type confusion option.
      Message 2 of 5 , Jun 25, 2011
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "IceBox" <albertosantini@...> wrote:

        > Y.DataType.Date.format(ld, {format: "%a, %b %d, %H:%M"});
        >
        > The following message is displayed:
        > Problem at line 1 character 37: Type confusion: function and '%a, %b %d, %H:%M': string.
        >
        > If I change the name of the property the error is gone.
        > Of course I cannot change that name.


        You are using .format as a function and as a string.

        You should select the Tolerate type confusion option.
      • IceBox
        ... I resolved using the following approach: var YDateFormat = Y.DataType.Date.format; ... YDateFormat(ld, { format : %a, %b %d, %H:%M }); Regards, Alberto
        Message 3 of 5 , Jun 26, 2011
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
          >
          > You are using .format as a function and as a string.
          >
          > You should select the Tolerate type confusion option.
          >

          I resolved using the following approach:

          var YDateFormat = Y.DataType.Date.format;
          ...
          YDateFormat(ld, {'format': "%a, %b %d, %H:%M"});

          Regards,
          Alberto
        • Luke Page
          Your resolution makes the code confusing does it not? If I saw it I would be wondering why you created the alias and whether it wa a throw back to something
          Message 4 of 5 , Jun 26, 2011
          • 0 Attachment
            Your resolution makes the code confusing does it not?

            If I saw it I would be wondering why you created the alias and whether it wa
            a throw back to something else that had later been removed?

            Would it not be better in these situations to leave confusion off, sort out
            anything that makes sense and then turn confusion on?
            On 26 Jun 2011 12:16, "IceBox" <albertosantini@...> wrote:
            >
            >
            > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...>
            wrote:
            >>
            >> You are using .format as a function and as a string.
            >>
            >> You should select the Tolerate type confusion option.
            >>
            >
            > I resolved using the following approach:
            >
            > var YDateFormat = Y.DataType.Date.format;
            > ...
            > YDateFormat(ld, {'format': "%a, %b %d, %H:%M"});
            >
            > Regards,
            > Alberto
            >
            >
            >
            >
            >


            [Non-text portions of this message have been removed]
          • Jakob Kruse
            Yet anoher example of the confusion option leading to just that (confusion). /Jakob ... [Non-text portions of this message have been removed]
            Message 5 of 5 , Jun 26, 2011
            • 0 Attachment
              Yet anoher example of the confusion option leading to just that (confusion).

              /Jakob

              On 26/06/2011, at 13.16, "IceBox" <albertosantini@...> wrote:

              >
              >
              > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...> wrote:
              > >
              > > You are using .format as a function and as a string.
              > >
              > > You should select the Tolerate type confusion option.
              > >
              >
              > I resolved using the following approach:
              >
              > var YDateFormat = Y.DataType.Date.format;
              > ...
              > YDateFormat(ld, {'format': "%a, %b %d, %H:%M"});
              >
              > Regards,
              > Alberto
              >
              >


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