After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647060 - Don't use global variables
Don't use global variables
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal minor
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-07 16:14 UTC by Giovanni Campagna
Modified: 2011-05-09 18:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't declare global variables (1.28 KB, patch)
2011-04-07 16:14 UTC, Giovanni Campagna
reviewed Details | Review
Don't declare global variables (2.25 KB, patch)
2011-04-10 17:22 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2011-04-07 16:14:21 UTC
See patch
Comment 1 Giovanni Campagna 2011-04-07 16:14:44 UTC
Created attachment 185438 [details] [review]
Don't declare global variables

Scope all the variables to the block or the function, including
those introduced by for..in.
Comment 2 Colin Walters 2011-04-07 16:57:32 UTC
Review of attachment 185438 [details] [review]:

How did you notice this by the way?  Did you see a "name" variable in the global object or something?

::: modules/tweener/tweener.js
@@ +250,1 @@
 

There's other places in the code where we don't declare "var name", like removeTweensByTime and _splitTweens.  Want to fix those in this patch too?
Comment 3 Giovanni Campagna 2011-04-10 17:22:49 UTC
Created attachment 185652 [details] [review]
Don't declare global variables

Scope all the variables to the block or the function, including
those introduced by for..in.
Comment 4 Colin Walters 2011-05-04 18:42:41 UTC
Review of attachment 185652 [details] [review]:

Looks good, thanks
Comment 5 Giovanni Campagna 2011-05-09 18:54:55 UTC
Attachment 185652 [details] pushed as 3d6b668 - Don't declare global variables