Closed Bug 752127 Opened 12 years ago Closed 12 years ago

[AccessFu] Abolish anonymous functions

Categories

(Core :: Disability Access APIs, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: eeejay, Assigned: eeejay)

Details

Attachments

(1 file, 1 obsolete file)

{
  foo: function(arg) {}
}

should be
{
  foo: function foo(arg) {}
}
From now on, introducing anonymous functions is a sin!
Attachment #622917 - Flags: review?(dbolter)
Assignee: nobody → eitan
Status: NEW → ASSIGNED
Comment on attachment 622917 [details] [diff] [review]
Provide names to all functions that are not in-line. Remove some dumps, wrap some lines.

Review of attachment 622917 [details] [diff] [review]:
-----------------------------------------------------------------

I wonder if you want to do your mock private-ness via underscore prefixes while you are here? What is the b2g/ff style guide say about that?
What is your rule for naming functions? Is it
objectname_functionname or just functionname? (you have a mix I think)
(In reply to David Bolter [:davidb] from comment #2)
> Comment on attachment 622917 [details] [diff] [review]
> Provide names to all functions that are not in-line. Remove some dumps, wrap
> some lines.
> 
> Review of attachment 622917 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I wonder if you want to do your mock private-ness via underscore prefixes
> while you are here? What is the b2g/ff style guide say about that?

We should do that for consistency. I'll upload another patch.
(In reply to David Bolter [:davidb] from comment #3)
> What is your rule for naming functions? Is it
> objectname_functionname or just functionname? (you have a mix I think)

If it is a subclass or an implementation of an interface, I prefix the function name with the object name.
I "privatized" the methods that are internal utility functions. The ones that I didn't touch are ones that I think will be useful API in a future addon, or ones that are required for interfaces (observe, handleEvent).
Attachment #622917 - Attachment is obsolete: true
Attachment #622917 - Flags: review?(dbolter)
Attachment #623253 - Flags: review?(dbolter)
Attachment #623253 - Flags: review?(dbolter) → review+
https://hg.mozilla.org/mozilla-central/rev/5a911d6449b1
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: