Closed Bug 345119 Opened 18 years ago Closed 18 years ago

Set up and use architecture for helper functions in components

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jminta, Assigned: jminta)

References

Details

Attachments

(1 file)

dmose says he wants to be able to share helper funciton across components.  This probably needs to use mozIJSSubScriptLoader to load a file with those helper functions.
Summary: Set up and use architeture for helper functions in components → Set up and use architecture for helper functions in components
Patch implements a couple of common component utils and begins using them in our providers.  There's a ton of extra Ci/Cc cleanup, and probably some more functions that can be shared, but this patch was getting pretty big.  The utils also include some debugging functions, in the style of other toolkit apps.  (Yes, they're infecting me.)  Eventually I'd like to see this replace calendarUtils, and we can load that into the global chrome:// scope too, but one step at a time.

Note that this will cause an additional notification bubble about weird component loading, but that's another bug.

Note that I also didn't touch WCAP, because that code is all over the place.

UUID helper function will follow in that bug.
Assignee: nobody → jminta
Status: NEW → ASSIGNED
Attachment #229984 - Flags: first-review?(dmose)
Comment on attachment 229984 [details] [diff] [review]
first cut at common utils: providers

Index: calendar/base/src/componentUtils.js
===================================================================
RCS file: calendar/base/src/componentUtils.js
calUtils.js would be a better name, if we intend for this to be used outside of components too.

+ *
+ * ***** END LICENSE BLOCK ***** */
+
+const Cc = Components.classes;
Add a comment describing what this file is used for and what we think it might be useful for in the future.

+    if (shouldLog) {
+        ASSERT(aArg, "Bad log argument.", false);
+        var string;
How about if(!shouldLog) return;?

Fix the places you replaced with LOG to not end up with 2x \n.
Attachment #229984 - Flags: first-review?(dmose) → first-review+
patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Reviewing your own patches now? That's gonna speed up the process! :)
Depends on: 345593
Depends on: 345444
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: