Closed Bug 1175877 Opened 6 years ago Closed 6 years ago

JavaScript error: chrome://browser/content/downloads/downloads.js, line 67: TypeError: "Cu" is read-only

Categories

(Firefox :: Downloads Panel, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 44
Tracking Status
firefox44 --- fixed

People

(Reporter: Gijs, Assigned: nanonikhil, Mentored)

References

Details

(Whiteboard: [good first bug][lang=js])

Attachments

(1 file, 1 obsolete file)

Still haven't worked out when exactly this happens, but I've been seeing it a lot and it's been annoying me. Presumably it might also actually be breaking something.
Version: 38 Branch → Trunk
we are likely trying to overwrite global consts, should be harmless, apart from the error.

I actually thought this was due to the confusing situation of these consts in browser (bug 406371), but then I've checked placesOverlay.xul and looks like it doesn't use anymore consts from some time, exactly to avoid these errors.
Thus looks like something else might be defining those const at a global level, but I couldn't find who... is this without add-ons?
STR: Right-click any page and select "View Page Info"
we should probably just change that const to a let.
Duplicate of this bug: 1200900
Mentor: mak77
Whiteboard: [good first bug][lang=js]
Attachment #8658161 - Flags: review?(paolo.mozmail)
Comment on attachment 8658161 [details] [diff] [review]
Changed Cu from const to let in pageInfo.js

Looks simple enough. Thanks for the fix!

I assume you tested manually that this fixes the error message.
Attachment #8658161 - Flags: review?(paolo.mozmail) → review+
Sorry but I wasn't able to reproduce it in the first place. I'm not getting the error message.
Assignee: nobody → nanonikhil
Status: NEW → ASSIGNED
well, the change is very simple and we can tell it is the right change for the issue, based on the error. My only doubt is whether we should use var here, since it's in the global scope per bug 1202902.

Just in case, if you could do that, I'd say we should just checkin-needed the updated patch (I don't think it's worth to waste Try server resources on this simple change)
Nikhil Gupta, would you mind making a small change to your patch?
Since the only reason to define Cu here is for a couple of Cu.import, would you mind changing those to Components.utils.import and completely remove the Cu definition from the file?
I think in the end it'd be better.
Flags: needinfo?(nanonikhil)
Attachment #8658161 - Attachment is obsolete: true
Flags: needinfo?(nanonikhil)
Attachment #8670970 - Flags: review?(mak77)
Keywords: checkin-needed
Hello, in the future, please remember to add the bug number to the commit and if possible put r=reviewname.
Attachment #8670970 - Flags: review?(mak77) → review+
https://hg.mozilla.org/mozilla-central/rev/913176388155
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
You need to log in before you can comment on or make changes to this bug.