On 6/2/06, Eric H. Jung <[EMAIL PROTECTED]> wrote:
Hi,

Can variables defined in files in the components/ directory of a XPI conflict with 
variables defined by FF/Moz/NS/Flock and/or other extension? For example, the 
gQueryInterface function below as well as the CI, CC, and CR variables. My feeling it 
"no", it can't, but I want to make sure.

components/MyXPCOMObject.js:

const CI = Components.interfaces, CC = Components.classes, CR = 
Components.results;
<snip>

Components run in their own JS scope; there is no | window | object.
And since XUL windows actually store global variables as properties of
the | window | object, you can't conflict :)

In fact, each .js file gets its own scope; that makes JS components
nice in the sense that you no longer have to worry about conflicting
with other extensions (which is a rather annoying problem when your JS
runs in the window).

--
Mook
[EMAIL PROTECTED]
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to