Closed
Bug 485407
Opened 16 years ago
Closed 16 years ago
Assignment to undeclared variable dragAfter
Categories
(Toolkit :: Toolbars and Toolbar Customization, defect)
Toolkit
Toolbars and Toolbar Customization
Tracking
()
RESOLVED
FIXED
People
(Reporter: philor, Assigned: ehsan.akhgari)
References
()
Details
Attachments
(2 files, 2 obsolete files)
843 bytes,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
1.28 KB,
patch
|
philip.chee
:
review+
philip.chee
:
superreview+
|
Details | Diff | Splinter Review |
When bug 251627 added tracking whether the window is ltr or rtl to decide which side to drop on, it failed to declare var dragAfter, making it an unintentional global.
Reporter | ||
Comment 1•16 years ago
|
||
And despite the microscopic scrutiny it went through, that seems to have made it into the SeaMonkey fork, too.
![]() |
||
Comment 2•16 years ago
|
||
It's a temporary fork Phil, so we forked their bugs as well. :P
Assignee | ||
Comment 3•16 years ago
|
||
Assignee: nobody → ehsan.akhgari
Status: NEW → ASSIGNED
Attachment #369655 -
Flags: review?(gavin.sharp)
![]() |
||
Comment 4•16 years ago
|
||
In other parts of customizeToolbar.js we use this style:
var value = direction == "ltr"? "left" : "right";
This version uses the more compact coding style:
var dragAfter = direction == "ltr" ? aEvent.clientX > dropTargetCenter : aEvent.clientX < dropTargetCenter;
Attachment #369668 -
Flags: review?(gavin.sharp)
![]() |
||
Updated•16 years ago
|
Attachment #369668 -
Flags: review?(ehsan.akhgari)
![]() |
||
Comment 5•16 years ago
|
||
Comment on attachment 369668 [details] [diff] [review]
Patch v1.0: consistent code style.
What do you think Ehsan?
Comment 6•16 years ago
|
||
Comment on attachment 369668 [details] [diff] [review]
Patch v1.0: consistent code style.
I think this is harder to read and too long of a line :)
Attachment #369668 -
Flags: review?(gavin.sharp) → review-
Updated•16 years ago
|
Attachment #369655 -
Flags: review?(gavin.sharp) → review+
![]() |
||
Comment 7•16 years ago
|
||
Attachment #369670 -
Flags: superreview?(neil)
Attachment #369670 -
Flags: review?(neil)
![]() |
||
Comment 8•16 years ago
|
||
> I think this is harder to read and too long of a line :)
So wrap on multiple lines?
var dragAfter = direction == "ltr" ?
aEvent.clientX > dropTargetCenter :
aEvent.clientX < dropTargetCenter;
![]() |
||
Updated•16 years ago
|
Attachment #369670 -
Flags: superreview?(neil)
Attachment #369670 -
Flags: review?(neil)
Comment 9•16 years ago
|
||
Comment on attachment 369670 [details] [diff] [review]
Patch v1.0-comm comm-central version.
var dragAfter = direction == "ltr" ? aEvent.clientX > dropTargetCenter :
aEvent.clientX < dropTargetCenter;
Attachment #369670 -
Flags: superreview+
Attachment #369670 -
Flags: review+
Reporter | ||
Comment 10•16 years ago
|
||
Is that your entry in the "Make A Simple JavaScript Assignment Easy To Misunderstand" contest? If so, you should probably sneak in use of the comma operator, that always helps obfuscate.
![]() |
||
Comment 11•16 years ago
|
||
Carrying forward r+/sr+ for suite/comm-central
> (From update of attachment 369670 [details] [diff] [review])
> var dragAfter = direction == "ltr" ? aEvent.clientX > dropTargetCenter :
> aEvent.clientX < dropTargetCenter;
Nit Fixed.
Attachment #369668 -
Attachment is obsolete: true
Attachment #369670 -
Attachment is obsolete: true
Attachment #369700 -
Flags: superreview+
Attachment #369700 -
Flags: review+
Attachment #369668 -
Flags: review?(ehsan.akhgari)
Assignee | ||
Comment 12•16 years ago
|
||
(In reply to comment #5)
> (From update of attachment 369668 [details] [diff] [review])
> What do you think Ehsan?
FWIW, I find the use of the conditional test in non-trivial assignments confusing. Indentation can be used to compensate for the problem partly, but I don't get why one would do that in the first place. :-) (And as far as the coding conventions in the file are concerned, I'd file a bug to fix any other such assignments instead of adding more of them...)
Assignee | ||
Comment 13•16 years ago
|
||
Landed on mozilla-central: <http://hg.mozilla.org/mozilla-central/rev/68b8e8a9c0c7>. Keeping open until it's landed on comm-central as well.
Whiteboard: [landed on m-c]
![]() |
||
Comment 14•16 years ago
|
||
Comment on attachment 369700 [details] [diff] [review]
[comm-central checkin-needed] Patch v1.1-comm comm-central version.
> Keeping open until it's landed on comm-central as well.
I don't have checkin privileges. Setting keywords.
Attachment #369700 -
Attachment description: Patch v1.1-comm comm-central version. → [comm-central checkin-needed] Patch v1.1-comm comm-central version.
![]() |
||
Updated•16 years ago
|
Keywords: checkin-needed
Whiteboard: [landed on m-c] → [landed on m-c][for c-c checkin]
Comment 15•16 years ago
|
||
Pushed to comm-central, changeset 266595448dd8.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [landed on m-c][for c-c checkin]
You need to log in
before you can comment on or make changes to this bug.
Description
•