views:

55

answers:

0

I have a collection of Javascript files that together constitute a system. Different parts of the system are in different (global) namespaces (e.g., NSA, NSB, etc.) and those namespaces may be objects, e.g.

 NSA = { 
    ... lots of stuff ...
 }

Now, in my various modules, I may have code such as:

NSA.method();

My code JSLints clean because I declare these namespaced objects in a comment at the top of the file:

/*global dNSA NSB NSC */

When I run YUI Compressor (v 2.4.2) on these files with the -v (verbose) switch, it emits warnings about the referenced namespaced objects, such as:

Found an undeclared symbol: $

and that's for using $ for jQuery!

What can I do to define these variables so that YUI Compressor doesn't emit the warning, yet whatever I add can't cause a change to the object.