What did you do? ================ 1. var name = prompt('asdasd', ''); console.log(typeof name); 2. press ESC (cancel prompt, press cancel) 3. typeof name - string What happened? ============== typeof name is STRING What should have happened? ========================== typeof name must be NULL (object) Is there anything else we should know? ====================================== Any else varible (exaple Name) return Null if i cancled prompt.
That is my reading of the spec as well: http://w3c.github.io/html/webappapis.html#simple-dialogs "If the user aborts, then return null; otherwise, return the string that the user responded with." What version of Firefox are you using?
Component: BrowserCompat → Untriaged
Product: Mozilla Developer Network → Firefox
This is not bug for browser - it's bag ECMA script. Screenshot in two browsers Chrome and FireFox I press ESC on prompt. As you can see - NULL - string and it name == 'null' => TRUE. But any other varaible example Name return Null and typeof Name == object is true. My version of FireFox - 50.1.0
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0 I have tested the reported issue on latest FF release and latest Nightly and could reproduce it. However I get the same results in Chrome and Edge, only in Internet Explorer I get the expected result (Object). I don't think this is Firefox Specific issue.
Marking this as Resolved: Incomplete due to the lack of response from the reporter. If anyone can still reproduce it on latest versions, feel free to reopen the issue and provide more information.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.