Last Comment Bug 752127 - [AccessFu] Abolish anonymous functions
: [AccessFu] Abolish anonymous functions
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: Trunk
: x86_64 Linux
: -- normal (vote)
: mozilla15
Assigned To: Eitan Isaacson [:eeejay]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-04 18:35 PDT by Eitan Isaacson [:eeejay]
Modified: 2012-05-15 06:45 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Provide names to all functions that are not in-line. Remove some dumps, wrap some lines. (23.19 KB, patch)
2012-05-10 14:23 PDT, Eitan Isaacson [:eeejay]
no flags Details | Diff | Splinter Review
Bug 752127 - Provide names to all functions that are not in-line. Remove some dumps, wrap some lines. (31.45 KB, patch)
2012-05-11 12:28 PDT, Eitan Isaacson [:eeejay]
dbolter: review+
Details | Diff | Splinter Review

Description Eitan Isaacson [:eeejay] 2012-05-04 18:35:22 PDT
{
  foo: function(arg) {}
}

should be
{
  foo: function foo(arg) {}
}
Comment 1 Eitan Isaacson [:eeejay] 2012-05-10 14:23:12 PDT
Created attachment 622917 [details] [diff] [review]
Provide names to all functions that are not in-line. Remove some dumps, wrap some lines.

From now on, introducing anonymous functions is a sin!
Comment 2 David Bolter [:davidb] 2012-05-10 18:17:10 PDT
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?
Comment 3 David Bolter [:davidb] 2012-05-11 10:32:35 PDT
What is your rule for naming functions? Is it
objectname_functionname or just functionname? (you have a mix I think)
Comment 4 Eitan Isaacson [:eeejay] 2012-05-11 10:33:39 PDT
(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.
Comment 5 Eitan Isaacson [:eeejay] 2012-05-11 10:34:31 PDT
(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.
Comment 6 Eitan Isaacson [:eeejay] 2012-05-11 12:28:28 PDT
Created attachment 623253 [details] [diff] [review]
Bug 752127 - Provide names to all functions that are not in-line. Remove some dumps, wrap some lines.

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).
Comment 7 Eitan Isaacson [:eeejay] 2012-05-14 14:23:51 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/5a911d6449b1
Comment 8 Ed Morley [:emorley] 2012-05-15 06:45:39 PDT
https://hg.mozilla.org/mozilla-central/rev/5a911d6449b1

Note You need to log in before you can comment on or make changes to this bug.