Intentionally unreachable code in Prefetcher.jsm.

RESOLVED FIXED in Firefox 40

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: arai, Assigned: arai)

Tracking

Trunk
Firefox 40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
I'm going to add warning for unreachable code after return statement in bug 1151931,
and it hits following code.

https://dxr.mozilla.org/mozilla-central/source/toolkit/components/addoncompat/Prefetcher.jsm#104
> function log(...args)
> {
>   return;
> 
>   for (let arg of args) {
>     dump(arg);
>     dump(" ");
>   }
>   dump("\n");
> }

https://dxr.mozilla.org/mozilla-central/source/toolkit/components/addoncompat/Prefetcher.jsm#115
> function logPrefetch(kind, value1, component, value2)
> {
>   return;
>   log("prefetching", kind, objAddr(value1) + "." + component, "=", objAddr(value2));
> }

can we comment out those function body, instead of placing `return`?
(it might be better to also comment out rest parameter, to improve performance)
(Assignee)

Comment 1

4 years ago
Created attachment 8594148 [details] [diff] [review]
Comment out intentionally unreachable code and unused parameters in Prefetcher.jsm.

Just commented out body and parameters.
if there is better solution, let me know :)
Assignee: nobody → arai.unmht
Attachment #8594148 - Flags: review?(wmccloskey)
Comment on attachment 8594148 [details] [diff] [review]
Comment out intentionally unreachable code and unused parameters in Prefetcher.jsm.

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

I guess this is okay, although I think the warning is a bad idea.
Attachment #8594148 - Flags: review?(wmccloskey) → review+
(Assignee)

Comment 4

4 years ago
do you think the warning should be behind javascript.options.strict option, or shouldn't be added at all?
https://hg.mozilla.org/mozilla-central/rev/f0a97dd5ee96
Status: NEW → RESOLVED
Last Resolved: 4 years ago
status-firefox40: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
You need to log in before you can comment on or make changes to this bug.