showNotification's icon argument should be optional

RESOLVED WONTFIX

Status

Mozilla Labs
Prism
--
minor
RESOLVED WONTFIX
9 years ago
2 years ago

People

(Reporter: FNDo, Unassigned)

Tracking

Details

Attachments

(2 attachments)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091109 Ubuntu/9.10 (karmic) Firefox/3.5.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091109 Prism/1.0b2

showNotification silently fails (also halting further code execution, presumably due to an exception being thrown) when only supplying two arguments:
     window.platform.showNotification("title", "body");
The following works fine though:
     window.platform.showNotification("title", "body", null);

Since JavaScript developers are used to arguments being optional, it would be useful for this API to not require null arguments to be passed.
(It took me quite a while to diagnose this problem, so it is not an insignificant issue.)

Reproducible: Always




Using Prism 1.0b2 on Ubuntu Karmic.
(Reporter)

Comment 1

9 years ago
Created attachment 415128 [details]
test case

should display three alerts and notifications - actually breaks with the second showNotification call
(Reporter)

Comment 2

9 years ago
Created attachment 415129 [details] [diff] [review]
simple attempt at making icon argument optional

untested, as there don't seem to be any unit tests and I currently do not have the capability to build Prism myself

One could argue that the second ("body") argument should be optional as well. This was not addressed here, neither were other API functions where similar issues might occur.

Comment 3

2 years ago
Project is no longer active, so closing. Sorry that you never got a reply. (Found this while searching for showNotification() bugs with respect to https://notifications.spec.whatwg.org/, a different API.)
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.