Closed Bug 1254866 Opened 8 years ago Closed 8 years ago

ReferenceError: Cu is not defined in ext-i18n.js

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(firefox48 fixed)

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: kuoe0.tw, Assigned: kuoe0.tw)

Details

Attachments

(1 file, 1 obsolete file)

In this line:
https://dxr.mozilla.org/mozilla-central/source/toolkit/components/extensions/ext-i18n.js#3

Cu is not declared and the ReferenceError happened.
Attached patch Bug-1254866-hg.patch (obsolete) — Splinter Review
Hi kmag, could you review the patch? Without this patch, b2g cannot boot up.
Assignee: nobody → kuoe0
Attachment #8728266 - Flags: review?(kmaglione+bmo)
Comment on attachment 8728266 [details] [diff] [review]
Bug-1254866-hg.patch

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

Hm. It should inherit that variable from the Extension.jsm scope. I guess this has something to do with a quirk of the b2g module loader?

::: toolkit/components/extensions/ext-i18n.js
@@ +1,3 @@
>  "use strict";
>  
> +const Cu = Components.utils;

Can you change this to match the other modules?

var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Attachment #8728266 - Flags: review?(kmaglione+bmo)
Hi, kmag! I updated the patch with your suggestion.

But I think we use Cu only. Should we declare other variables like Cc and Ci?
Attachment #8728266 - Attachment is obsolete: true
Flags: needinfo?(kmaglione+bmo)
Attachment #8728766 - Flags: review?(kmaglione+bmo)
Attachment #8728766 - Flags: review?(kmaglione+bmo) → review+
(In reply to Tommy Kuo [:KuoE0] from comment #3)
> But I think we use Cu only. Should we declare other variables like Cc and Ci?

Yes. If we don't, someone will wind up adding code that uses them in the future, and b2g will break again.
Flags: needinfo?(kmaglione+bmo)
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
The bug will be closed automatically when this merges to mozilla-central.

I'm not sure why this was landed to both inbound and fx-team...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
https://hg.mozilla.org/mozilla-central/rev/7e4686be6b1f
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: