Closed
Bug 663500
Opened 13 years ago
Closed 13 years ago
Consider using ECMAScript 5 strict mode
Categories
(Tree Management Graveyard :: TBPL, defect)
Tree Management Graveyard
TBPL
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(3 files)
(deleted),
patch
|
Swatinem
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Swatinem
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Swatinem
:
review+
|
Details | Diff | Splinter Review |
This might catch some bugs faster (e.g. bug 663498).
Comment 1•13 years ago
|
||
Are there any arguments against using it?
Assignee | ||
Comment 2•13 years ago
|
||
We set storage without declaring it with "var". I'm not sure what's better, adding var or using window.storage to make it clear that we're adding a global variable... what do you think?
Attachment #538579 -
Flags: review?(arpad.borsos)
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #538580 -
Flags: review?(arpad.borsos)
Comment 4•13 years ago
|
||
Are there any arguments against using it?
Assignee | ||
Comment 5•13 years ago
|
||
Other than the fact that this might break something because I haven't tested all code paths, there are not many arguments against doing it :)
Attachment #538581 -
Flags: review?(arpad.borsos)
Comment 6•13 years ago
|
||
Comment on attachment 538579 [details] [diff] [review]
storage -> window.storage
Review of attachment 538579 [details] [diff] [review]:
-----------------------------------------------------------------
Using var makes it only valid in the containing .js file, right? I think window is the way forward. As it is a workaround for window.localStorage.
Attachment #538579 -
Flags: review?(arpad.borsos) → review+
Assignee | ||
Comment 7•13 years ago
|
||
Comment on attachment 538581 [details] [diff] [review]
add "use strict"; everywhere and move inTag function to top level
I just realized that I didn't separate the inTag change. Strict mode only allows function definitions at the top (function) level, not nested in a loop.
Attachment #538581 -
Attachment description: add "use strict"; everywhere → add "use strict"; everywhere and move inTag function to top level
Comment 8•13 years ago
|
||
Comment on attachment 538580 [details] [diff] [review]
delete window.tinderbox_data
Review of attachment 538580 [details] [diff] [review]:
-----------------------------------------------------------------
Damn midair collisions :-D
Attachment #538580 -
Flags: review?(arpad.borsos) → review+
Comment 9•13 years ago
|
||
Comment on attachment 538581 [details] [diff] [review]
add "use strict"; everywhere and move inTag function to top level
Review of attachment 538581 [details] [diff] [review]:
-----------------------------------------------------------------
Attachment #538581 -
Flags: review?(arpad.borsos) → review+
Assignee | ||
Comment 10•13 years ago
|
||
(In reply to comment #6)
> Using var makes it only valid in the containing .js file, right?
No, it's actually the same as setting the property on the global object (window), as far as I know. I don't have a JS spec link ready to prove it, though...
Assignee | ||
Comment 11•13 years ago
|
||
http://hg.mozilla.org/users/mstange_themasta.com/tbpl-pending-infrasec-review/rev/22775f15cd6c
http://hg.mozilla.org/users/mstange_themasta.com/tbpl-pending-infrasec-review/rev/2f87b04629ae
http://hg.mozilla.org/users/mstange_themasta.com/tbpl-pending-infrasec-review/rev/f91669f4b809
http://hg.mozilla.org/users/mstange_themasta.com/tbpl-pending-infrasec-review/rev/f6acf8739140
Updated•13 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Product: Webtools → Tree Management
Updated•10 years ago
|
Product: Tree Management → Tree Management Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•