Closed
Bug 445753
Opened 16 years ago
Closed 16 years ago
"Rewrite" <nsSidebar.js> |function srGetStrBundle()|
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
RESOLVED
FIXED
mozilla1.9.1b1
People
(Reporter: sgautherie, Assigned: sgautherie)
References
()
Details
Attachments
(2 files, 4 obsolete files)
2.36 KB,
patch
|
neil
:
review+
neil
:
superreview+
|
Details | Diff | Splinter Review |
5.29 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
This case can not be replaced by a |<stringbundle/>|, nor even use </toolkit/obsolete/content/strres.js>; but it can still be improved a little. {{ /browser/components/sidebar/src/nsSidebar.js /suite/common/sidebar/nsSidebar.js }}
Assignee | ||
Comment 1•16 years ago
|
||
Assignee: jag → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #330034 -
Flags: superreview?(jag)
Attachment #330034 -
Flags: review?(jag)
Assignee | ||
Comment 2•16 years ago
|
||
Av1-SM still had an occurrence of the old global variable name.
Attachment #330034 -
Attachment is obsolete: true
Attachment #330037 -
Flags: superreview?(jag)
Attachment #330037 -
Flags: review?(jag)
Attachment #330034 -
Flags: superreview?(jag)
Attachment #330034 -
Flags: review?(jag)
Assignee | ||
Updated•16 years ago
|
Attachment #330037 -
Flags: superreview?(neil)
Attachment #330037 -
Flags: superreview?(jag)
Attachment #330037 -
Flags: review?(neil)
Attachment #330037 -
Flags: review?(jag)
Comment 3•16 years ago
|
||
Comment on attachment 330037 [details] [diff] [review] (Av1a-SM) <nsSidebar.js> >+ const strBundle = gStrBundleService.createBundle(path); var please.
Attachment #330037 -
Flags: superreview?(neil)
Attachment #330037 -
Flags: superreview+
Attachment #330037 -
Flags: review?(neil)
Attachment #330037 -
Flags: review+
Assignee | ||
Comment 4•16 years ago
|
||
Av1a-SM, with comment 3 suggestion(s).
Attachment #330037 -
Attachment is obsolete: true
Assignee | ||
Updated•16 years ago
|
Flags: in-testsuite-
Keywords: checkin-needed
Whiteboard: [c-n: Av1b-SM // Leave opened]
Target Milestone: mozilla1.9.1a1 → mozilla1.9.1a2
Assignee | ||
Comment 5•16 years ago
|
||
Sync SM -> FF: *Copy/Port patch Av1b-SM. *"Rewrite" |nsSidebar.prototype.QueryInterface()|. *Do the white-space cleanups.
Attachment #334908 -
Flags: review?(gavin.sharp)
Comment 6•16 years ago
|
||
Comment on attachment 334908 [details] [diff] [review] (Bv1-FF) <nsSidebar.js> >diff --git a/browser/components/sidebar/src/nsSidebar.js b/browser/components/sidebar/src/nsSidebar.js >+ var strBundle = gStrBundleService.createBundle(path); >+ if (!strBundle) createBundle will either return a bundle, or throw as far as I can tell, so this check is useless.
Attachment #334908 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 7•16 years ago
|
||
(In reply to comment #6) > createBundle will either return a bundle, or throw as far as I can tell, so > this check is useless. Right: createBundle() -> getStringBundle() -> |if (!bundle) return NS_ERROR_OUT_OF_MEMORY;| Then, should I simply remove the test and let the exception spring, as it actually does, or add another try+catch and return null here too, as it seems it was initially wanted ? Currently, I seems odd to have the two behaviors in the same function :-<
Assignee | ||
Updated•16 years ago
|
Keywords: checkin-needed
Comment 8•16 years ago
|
||
OOM is exceptional, just let it throw in that case.
Comment 9•16 years ago
|
||
I would remove the other try/catch as well, that getService failing should also be pretty exceptional and it looks like no one null checks the return value of this function anyways.
Assignee | ||
Comment 10•16 years ago
|
||
(In reply to comment #8) > OOM is exceptional, just let it throw in that case. (In reply to comment #9) > I would remove the other try/catch as well, that getService failing should also > be pretty exceptional and it looks like no one null checks the return value of > this function anyways. Fully agreed :-)
Severity: trivial → minor
Summary: (minor) "Rewrite" <nsSidebar.js> |function srGetStrBundle()| → "Rewrite" <nsSidebar.js> |function srGetStrBundle()|
Whiteboard: [c-n: Av1b-SM // Leave opened]
Assignee | ||
Comment 11•16 years ago
|
||
Av1a-SM, with comment 9 suggestion(s).
Attachment #334904 -
Attachment is obsolete: true
Attachment #334984 -
Flags: superreview?(neil)
Attachment #334984 -
Flags: review?(neil)
Assignee | ||
Comment 12•16 years ago
|
||
Bv1-FF, with comment 9 suggestion(s).
Attachment #334908 -
Attachment is obsolete: true
Attachment #334988 -
Flags: review?(gavin.sharp)
Comment 13•16 years ago
|
||
Comment on attachment 334984 [details] [diff] [review] (Av2-SM) <nsSidebar.js> [Checkin: Comment 18] >Bug 445753 � "Rewrite" <nsSidebar.js> |function srGetStrBundle()| Does TortoiseHg not handle Unicode correctly? ;-)
Attachment #334984 -
Flags: superreview?(neil)
Attachment #334984 -
Flags: superreview+
Attachment #334984 -
Flags: review?(neil)
Attachment #334984 -
Flags: review+
Assignee | ||
Comment 14•16 years ago
|
||
(In reply to comment #13) > Does TortoiseHg not handle Unicode correctly? ;-) Ah ! It must be caused by Windows (2000) Notepad, which I use to input the commit comment. This character (in the patch file) is actually 0x96 (in Windows-1252). I don't know why SeaMonkey tries to display it as UTF-8 :-/ It displays fine as ISO-8859-1... Is this causing other issues ?
Keywords: checkin-needed
Whiteboard: [c-n: Av2-SM // Leave opened]
Comment 15•16 years ago
|
||
iirc hg is supposed to use UTF-8
Comment 16•16 years ago
|
||
Comment on attachment 334988 [details] [diff] [review] (Bv2-FF) <nsSidebar.js> [Checkin: Comment 20] at this point it seems silly to have a helper at all, but... let's not get carried away.
Attachment #334988 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Updated•16 years ago
|
Whiteboard: [c-n: Av2-SM // Leave opened] → [c-n: Av2-SM, Bv2-FF]
Comment 17•16 years ago
|
||
(In reply to comment #14) > (In reply to comment #13) > > Does TortoiseHg not handle Unicode correctly? ;-) > > Ah ! It must be caused by Windows (2000) Notepad, which I use to input the > commit comment. > This character (in the patch file) is actually 0x96 (in Windows-1252). > > I don't know why SeaMonkey tries to display it as UTF-8 :-/ > It displays fine as ISO-8859-1... > > Is this causing other issues ? > Windows-1252 0x96 corresponds IIUC to Unicode U+2013 i.e. – in Latin1 (ISO-8859-1) 0x96 it is actually a control character, "START OF GUARDED AREA". On some systems (esp. some Windows systems) it will be displayed as if it were Windows-1252, on others you'll get the "unknown character" glyph. Bugzilla pages are in UTF-8 nowadays; not sure about Mercurial but I'd bet on UTF-8 for anything recent which was originally developed on Unix.
Comment 18•16 years ago
|
||
Comment on attachment 334984 [details] [diff] [review] (Av2-SM) <nsSidebar.js> [Checkin: Comment 18] Checked in, changeset 076411b96f5c
Assignee | ||
Updated•16 years ago
|
Attachment #334984 -
Attachment description: (Av2-SM) <nsSidebar.js> → (Av2-SM) <nsSidebar.js>
[Checkin: Comment 18]
Assignee | ||
Updated•16 years ago
|
Whiteboard: [c-n: Av2-SM, Bv2-FF] → [c-n: Bv2-FF]
Comment 19•16 years ago
|
||
+ if (!gStrBundleService) + gStrBundleService = + Components.classes["@mozilla.org/intl/stringbundle;1"] + .getService(Components.interfaces.nsIStringBundleService); + + return gStrBundleService.createBundle(path); Hmm. FYI. Firefox is moving towards using smart GETTERs instead.
Assignee | ||
Comment 20•16 years ago
|
||
Comment on attachment 334988 [details] [diff] [review] (Bv2-FF) <nsSidebar.js> [Checkin: Comment 20] http://hg.mozilla.org/mozilla-central/rev/e3649faaaf18
Attachment #334988 -
Attachment description: (Bv2-FF) <nsSidebar.js> → (Bv2-FF) <nsSidebar.js>
[Checkin: Comment 19]
Assignee | ||
Updated•16 years ago
|
Attachment #334988 -
Attachment description: (Bv2-FF) <nsSidebar.js>
[Checkin: Comment 19] → (Bv2-FF) <nsSidebar.js>
[Checkin: Comment 20]
Assignee | ||
Updated•16 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite- → in-testsuite?
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [c-n: Bv2-FF]
Target Milestone: mozilla1.9.1a2 → mozilla1.9.1b1
Assignee | ||
Comment 21•16 years ago
|
||
(In reply to comment #16) > at this point it seems silly to have a helper at all, but... let's not get > carried away. (In reply to comment #19) > Hmm. FYI. Firefox is moving towards using smart GETTERs instead. I filed bug 453980 as a followup.
You need to log in
before you can comment on or make changes to this bug.
Description
•