Is there a way to declare extern's?

Cam Woods
2006-07-14
2013-05-28
  • Cam Woods
    Cam Woods
    2006-07-14

    I have some script in .js files that refers to some external variables declared on the page html, some generated by .Net, some by my C# code.  Right now they're being considered undeclared variables.  I can't use jsl:import because the variables are generated dynamically so there's no design-time file to point to.

    Is there a way to do something like

    // jsl:extern xyz

    to specify that xyz is declared externally and that Lint shouldn't generate the undeclared var warning about it?

    Cam

     
    • Currently you can only do that in the configuration file.

      Do you need a control comment for this? If so, to be consistent, I would suggest /*jsl:define xyz*/.

       
      • Cam Woods
        Cam Woods
        2006-07-16

        Yes, something like jsl:define would be good.  I was thinking jsl:extern because that's the C/C++ equivalent.

        By the way, do I have to use
        /* jsl:define xyz */
        or can I use
        // jsl:define xyz
        ?  I prefer the // notation.

        Cam

         
        • This control comment is not currently supported, but if it would be, yes, it would be in the /*jsl:define abc*/ format.

          It would be possible to support //jsl:cc syntax if there's a compelling reason to do so.