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

Custom globals and rhino

Expand Messages
  • Toby Maxwell-Lyte
    Hi, We have some custom objects that are injected into the DOM from a lower layer. In order to access these we have to do so using global references. E.g.
    Message 1 of 2 , Oct 9, 2009
    View Source
    • 0 Attachment
      Hi,

      We have some custom objects that are injected into the DOM from a
      lower layer. In order to access these we have to do so using global
      references.
      E.g. MyGlobalDomObj.customMethod();

      In order to prevent jslint alerting about this I can add
      /*global MyGlobalDomObj */
      to all the files that call it. I would like to avoid this if possible.

      Is there a way of passing this into http://www.jslint.com/rhino/rhino.js ?

      Currently we modify fulljslint.js and add it in the same way that the
      browser option is handled.

      Regards,
      Toby
    • Douglas Crockford
      ... JSLINT(input, {predef: [ MyGlobalDomObj ]})
      Message 2 of 2 , Oct 9, 2009
      View Source
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, Toby Maxwell-Lyte <toby.maxwelllyte@...> wrote:
        >
        > Hi,
        >
        > We have some custom objects that are injected into the DOM from a
        > lower layer. In order to access these we have to do so using global
        > references.
        > E.g. MyGlobalDomObj.customMethod();
        >
        > In order to prevent jslint alerting about this I can add
        > /*global MyGlobalDomObj */
        > to all the files that call it. I would like to avoid this if possible.
        >
        > Is there a way of passing this into http://www.jslint.com/rhino/rhino.js ?
        >
        > Currently we modify fulljslint.js and add it in the same way that the
        > browser option is handled.


        JSLINT(input, {predef: ['MyGlobalDomObj']})
      Your message has been successfully submitted and would be delivered to recipients shortly.