Closed Bug 986349 Opened 10 years ago Closed 10 years ago

WifiWorker.js "this is undefined" exception due to patch of Bug 979841

Categories

(Firefox OS Graveyard :: Wifi, defect)

x86_64
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3T+, firefox29 wontfix, firefox30 fixed, firefox31 fixed, b2g-v1.3T fixed, b2g-v1.4 fixed, b2g-v2.0 fixed)

RESOLVED FIXED
1.4 S5 (11apr)
blocking-b2g 1.3T+
Tracking Status
firefox29 --- wontfix
firefox30 --- fixed
firefox31 --- fixed
b2g-v1.3T --- fixed
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: hchang, Assigned: hchang)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

http://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiWorker.js#2427

|this| is undefined in the callback of |forEach|:

...
this._domRequest.forEach(function(req) {
  this._sendMessage(req.name + ":Return", false, "Wifi is disabled", req.msg);
});
...
Attached patch Bug986349.patch (obsolete) — Splinter Review
Proposed patch
Attachment #8394638 - Flags: review?(chulee)
Comment on attachment 8394638 [details] [diff] [review]
Bug986349.patch

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

Nick catch! Thank you.

::: dom/wifi/WifiWorker.js
@@ +2427,2 @@
>        this._sendMessage(req.name + ":Return", false, "Wifi is disabled", req.msg);
> +    }).bind(this));

We don't need add parenthesis around the function definition. just
|function(req) {...}.bind(this)| will do the work.
Attachment #8394638 - Flags: review?(chulee) → review+
Thanks for the review!

(In reply to Chuck Lee [:chucklee] from comment #2)
> Comment on attachment 8394638 [details] [diff] [review]
> Bug986349.patch
> 
> Review of attachment 8394638 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Nick catch! Thank you.
> 
> ::: dom/wifi/WifiWorker.js
> @@ +2427,2 @@
> >        this._sendMessage(req.name + ":Return", false, "Wifi is disabled", req.msg);
> > +    }).bind(this));
> 
> We don't need add parenthesis around the function definition. just
> |function(req) {...}.bind(this)| will do the work.

It does work but is less expressive to me. The opening parenthesis 
lets the reader know that something unusual is happening. 

A similar case is discussed here: 

http://peter.michaux.ca/articles/an-important-pair-of-parens

Thanks!
Blocks a blocker.

Leaving qawanted here to find out if this happens on 1.3T, as I think it will happen there.
blocking-b2g: --- → 1.4+
Keywords: qawanted, regression
This should be nominate to 1.3T as well.
Keywords: checkin-needed
No longer blocks: 984945
Bumping to 1.3T since the regressing patch landed on 1.3T as well, so it should be affected here.
blocking-b2g: 1.4+ → 1.3T?
Keywords: qawanted
(In reply to Jason Smith [:jsmith] from comment #8)
> Bumping to 1.3T since the regressing patch landed on 1.3T as well, so it
> should be affected here.

Although we technically need a way to flag that this should block 1.3T & 1.4 & be able to land on those branches.
Attachment #8394638 - Attachment is obsolete: true
triage: 1.3T+ for regression
blocking-b2g: 1.3T? → 1.3T+
Note - we're also going to need this on 1.4. When this lands on trunk, please ask for Aurora approval, as this would have blocked 1.4 as well.
Whiteboard: [1.4-approval-needed]
Blocks: 979841
https://hg.mozilla.org/mozilla-central/rev/b59cd47f65b3
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4 S4 (28mar)
henry,

can you please request approval-mozilla-aurora: ? on this patch attachment and fill the approval request comment details so we can consider this to be backported on gecko 30 and fix this for 1.4.
Flags: needinfo?(hchang)
Comment on attachment 8396170 [details] [diff] [review]
Bug986349.patch (r+'d and add r=chulee for checkin)

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 986349
User impact if declined: Quickly switch on/off wifi would fail
Testing completed (on m-c, etc.): on m-c
Risk to taking this patch (and alternatives if risky): No
String or IDL/UUID changes made by this patch: No
Attachment #8396170 - Flags: approval-mozilla-aurora?
Flags: needinfo?(hchang)
Attachment #8396170 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Need to land this in 1.4. Thanks!
Keywords: checkin-needed
https://hg.mozilla.org/releases/mozilla-aurora/rev/d40fdf71320e
Keywords: checkin-needed
Whiteboard: [1.4-approval-needed]
Target Milestone: 1.4 S4 (28mar) → 1.4 S5 (11apr)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: