Projects and Type Resolution - The Global Scope
JSDT manages type resolution and browser compatibility by allowing users to customize a projects Global Scope.
The Global Scope (as it applies to JavaScript) is the super scope which holds all the objects, types and fields accessible to all methods. Its honestly one of the horrible inefficiencies of JavaScript as just about everything gets pushed into the Global Scope.
JSDT users can customize a projects Global Scope throughout the ‘JavaScript Include Path’ page. Each library is a collection of JavaScript files that prototypes all objects within that library. (Additional information can be attached to objects with JsDoc. ). When a library is added to a project, all of the prototype code in each libraries JavaScript files is modeled and placed in the projects Global Scope. The types, fields and methods are then available for resolution and content completion in every JavaScript file within the project Matter of fact, every JavaScript file sees the Global members of every other JavaScript file within a project (unless you’ve done some careful tweaking in the Include Path page).
A piece of JS code running in a browser has access to many of the objects, fields and methods provided by the browser. The browsers ‘Window’ object is an extension of ‘Global’ which extends ‘Object’. Each browser provides different types, fields and methods to almost all of the common objects (and additionally handles these types, fields and methods differently across browsers). Hence the cross browser compatibility pain points that arise when developing JavaScript.
The JSDT forces browser compatibility by defining and extending ECMA 3 objects through the libraries. By adding and removing libraries you can nail down the types, functions and fields available in code completion and resolution. This will help ensure your project supports the objects in specific browsers.
Libraries aren’t just useful for browsers. They work well for toolkits, or common utility scripts across a site.

