Closed
Bug 1005093
Opened 10 years ago
Closed 10 years ago
Notification System message not sent as expected
Categories
(Firefox OS Graveyard :: Runtime, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.0 S1 (9may)
People
(Reporter: gerard-majax, Assigned: gerard-majax)
References
Details
(Keywords: regression, Whiteboard: [systemsfe])
Attachments
(1 file, 1 obsolete file)
968 bytes,
patch
|
fabrice
:
review+
|
Details | Diff | Splinter Review |
While rebasing bug 967475 after bug 963234 landed, I noticed that the function getNotificationURLFor() in b2g/components/AlertsHelper.jsm sometimes returns undefined value. The code is the following: > let getNotificationURLFor = function(messages) { > if (!messages) { > return null; > } > > for (let i = 0; i < messages.length; i++) { > let message = messages[i]; > if (message === kNotificationSystemMessageName) { > return helper.fullLaunchPath(); > } else if (typeof message === "object" && > kNotificationSystemMessageName in message) { > return > helper.resolveFromOrigin(message[kNotificationSystemMessageName]); > } > } > > // No message found... > return null; > } However, adding an intermediate variable when doing the helper.resolveFromOrigin() call makes the problem go totally away: > let getNotificationURLFor = function(messages) { > if (!messages) { > return null; > } > > for (let i = 0; i < messages.length; i++) { > let message = messages[i]; > if (message === kNotificationSystemMessageName) { > return helper.fullLaunchPath(); > } else if (typeof message === "object" && > kNotificationSystemMessageName in message) { > let retval = helper.resolveFromOrigin(message[kNotificationSystemMessageName]); > return retval; > } > } > > // No message found... > return null; > }
Assignee | ||
Comment 1•10 years ago
|
||
Jason, Nicolas checked this and it seems to be a legitimate JS bug: we lack the setrval/retrval when looking at the disassembly of the first code.
Flags: needinfo?(jorendorff)
Comment 2•10 years ago
|
||
Comment 3•10 years ago
|
||
No bug, I'm afraid. It's automatic semicolon insertion. An semicolon is being automatically inserted at the end of the line that says > return According to the standard, you can't have a line break between the 'return' keyword and the value in a return statement. See <http://people.mozilla.org/~jorendorff/es6-draft.html#sec-rules-of-automatic-semicolon-insertion> for all the gruesome details...
Assignee | ||
Comment 4•10 years ago
|
||
(In reply to Jason Orendorff [:jorendorff] from comment #3) > No bug, I'm afraid. It's automatic semicolon insertion. An semicolon is > being automatically inserted at the end of the line that says > > return > > According to the standard, you can't have a line break between the 'return' > keyword and the value in a return statement. See > <http://people.mozilla.org/~jorendorff/es6-draft.html#sec-rules-of-automatic- > semicolon-insertion> for all the gruesome details... Ooops, sorry :). Well, there's still a bug I should fix.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → lissyx+mozillians
Assignee | ||
Updated•10 years ago
|
Component: JavaScript Engine: JIT → General
Product: Core → Firefox OS
Version: Trunk → unspecified
Assignee | ||
Comment 5•10 years ago
|
||
As far as I could check the code, I have not been able to find a proper way to test this on Gecko side.
Flags: needinfo?(jorendorff) → needinfo?(mhenretty)
Assignee | ||
Comment 6•10 years ago
|
||
However, one of the integration tests added as part of bug 967475 exposes the issue.
Assignee | ||
Comment 7•10 years ago
|
||
Fabrice, sorry for missing this one in the previous patch.
Attachment #8416544 -
Attachment is obsolete: true
Attachment #8416646 -
Flags: review?(fabrice)
Updated•10 years ago
|
Component: General → Runtime
Updated•10 years ago
|
Whiteboard: [systemsfe]
Target Milestone: --- → 2.0 S1 (9may)
Comment 8•10 years ago
|
||
Comment on attachment 8416646 [details] [diff] [review] 0001-Bug-1005093-Fix-return-code-path-of-getNotificationU.patch Review of attachment 8416646 [details] [diff] [review]: ----------------------------------------------------------------- oh my. stoopid js.
Attachment #8416646 -
Flags: review?(fabrice) → review+
Comment 9•10 years ago
|
||
(In reply to Alexandre LISSY :gerard-majax from comment #5) > As far as I could check the code, I have not been able to find a proper way > to test this on Gecko side. Honestly, since this is b2g specific code I think Gaia integration tests are what we ultimately want for this. I'd say we add the Gi test from bug 967475 that exposes this issue to this bug. These tests now run on all main branches in TBPL, so this should prevent the regressions we are looking to expose.
Flags: needinfo?(mhenretty)
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 10•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/056cbea8ea3a
Keywords: checkin-needed
Comment 11•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/056cbea8ea3a
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•