Opened 10 years ago

Last modified 10 years ago

#1088 closed defect (Fixed)

Namespacing Globals

Reported by: brettz9 Owned by:
Priority: Low Milestone:
Component: Applications/Torbutton Version: 1.2.2
Severity: Keywords:
Cc: brettz9 Actual Points:
Parent ID: Points:
Reviewer: Sponsor:



Just checking out your extension to see if there were any conflicts with
other extensions. Seems your overlay is well-done, but there are a few
global variables not namespaced with "torbutton" or "tb" in your
torbutton.js file (found with the excellent Netbeans JavaScript IDE
features: Navigator).

1) "tooltip" in torbutton_update_toolbutton() needs "var" decl.
2) "i" in torbutton_browser_proxy_prefs_init() needs "var" decl.
3) "win" in torbutton_is_same_origin() (Is this why there is a to-do there
saying the code doesn't work? "win" has not been defined globally (though
it should not be to avoid conflicts with other extensions). I guess you
wanted a windows enumerator here?

If you really wanted to protect yourself, maybe do a replace of all of the
"tb" with "torb", since I can envision there being others tempted to use
that (e.g., "tab", etc.), but at the very least, the ones above are
definite ones to fix...

(Edit: Added some line breaks. One day we'll have a bugtracker that can
break lines itself.)

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (3)

comment:1 Changed 10 years ago by mikeperry

The other thing we should change for this is to update the component to refer to

That might be best done in 1.3.x, but the above should be done in 1.2.x.

comment:2 Changed 10 years ago by mikeperry

Ok, all this has been fixed in git. Will appear in 1.2.3

comment:3 Changed 10 years ago by mikeperry

flyspray2trac: bug closed.
Will appear in 1.2.3

Note: See TracTickets for help on using tickets.