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

jslint missed a global variable

Expand Messages
  • samckayak
    I m working on a bookmarklet for ie6 which I hope explains the lack of comments, short variables, and single-lined nature of the function. jslint seems to miss
    Message 1 of 3 , Nov 12, 2009
    • 0 Attachment
      I'm working on a bookmarklet for ie6 which I hope explains the lack of comments, short variables, and single-lined nature of the function.

      jslint seems to miss the global variable "of" in this function. The semicolon preceeding "of" should be replaced with a comma. The variable "of" is not reported as local or global. Is "of" a keyword conflict?

      function(){var o=document.body.style,oz=(o.zoom===''?'1':o.zoom);of=parseFloat(oz,10);o.zoom=(of>3)?'1.':of*1.33;}
    • Douglas Crockford
      ... Turn on the Disallow undefined variables option.
      Message 2 of 3 , Nov 12, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "samckayak" <samc@...> wrote:
        >
        > I'm working on a bookmarklet for ie6 which I hope explains the lack of comments, short variables, and single-lined nature of the function.
        >
        > jslint seems to miss the global variable "of" in this function. The semicolon preceeding "of" should be replaced with a comma. The variable "of" is not reported as local or global. Is "of" a keyword conflict?
        >
        > function(){var o=document.body.style,oz=(o.zoom===''?'1':o.zoom);of=parseFloat(oz,10);o.zoom=(of>3)?'1.':of*1.33;}


        Turn on the "Disallow undefined variables" option.
      • samckayak
        ... I will, and thank you. Isn t it a jslint anomaly that of was not flagged as a global variable by jslint? I found that renaming of to ox resulted in
        Message 3 of 3 , Nov 12, 2009
        • 0 Attachment
          >
          > Turn on the "Disallow undefined variables" option.
          >
          I will, and thank you.

          Isn't it a jslint anomaly that "of" was not flagged as a global variable by jslint? I found that renaming "of" to "ox" resulted in a proper declaration of "ox" as a global.
        Your message has been successfully submitted and would be delivered to recipients shortly.