Closed Bug 835581 Opened 7 years ago Closed 7 years ago

ReferenceError: reference to undefined property Cc['@mozilla.org/xpcom/mac-utils;1'] in nsURLFormatter.js

Categories

(Toolkit :: General, defect, trivial)

x86_64
Linux
defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: mats, Assigned: Cykesiopka)

Details

(Keywords: reproducible)

Attachments

(1 file, 1 obsolete file)

STEPS TO REPRODUCE
1. start an Aurora debug build on Linux64 with a fresh profile
2. Tools->Web Developer->Error Console

ACTUAL RESULTS
Warning: ReferenceError: reference to undefined property Cc['@mozilla.org/xpcom/mac-utils;1']
Source File: file:///OBJDIR/dist/bin/components/nsURLFormatter.js
Line: 43
it should either check if "@mozilla.org/xpcom/mac-utils;1" is in Cc, or be ifdef XP_MACOSX
Attached patch Proposed Patch (obsolete) — Splinter Review
Not sure if there's a better way to do this, but at least it works when I build for Linux64...
Attachment #719421 - Flags: review?(mak77)
Comment on attachment 719421 [details] [diff] [review]
Proposed Patch

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

thanks, it's a long time I wanted to fix this but kept forgetting!

::: toolkit/components/urlformatter/nsURLFormatter.js
@@ +37,5 @@
>      let ABI = "default";
>      try {
>        ABI = this.appInfo.XPCOMABI;
>  
> +      if("@mozilla.org/xpcom/mac-utils;1" in Cc) {

please add a whitespace between if and the parenthesis

@@ +41,5 @@
> +      if("@mozilla.org/xpcom/mac-utils;1" in Cc) {
> +        // Mac universal build should report a different ABI than either macppc
> +        // or mactel.
> +        let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
> +                        getService(Ci.nsIMacUtils);

while here please fix indentation, either getService aligned with Cc, or dot aligned with [ (these are the most common styles in the codebase)
Attachment #719421 - Flags: review?(mak77) → review+
Addresses review comments.
Assignee: nobody → cykesiopka
Attachment #719421 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/89202194cc4f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.