Bug of varaible call - name

RESOLVED INCOMPLETE

Status

()

Firefox
Untriaged
RESOLVED INCOMPLETE
2 years ago
2 years ago

People

(Reporter: the.white.soul92, Unassigned, NeedInfo)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [specification][type:bug])

Attachments

(2 attachments)

(Reporter)

Description

2 years ago
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
Flags: needinfo?(the.white.soul92)
Product: Mozilla Developer Network → Firefox
(Reporter)

Comment 2

2 years ago
Created attachment 8822075 [details]
2016-12-27_22-49-53_Chrome.png
(Reporter)

Comment 3

2 years ago
Created attachment 8822077 [details]
2016-12-27_22-50-49_FireFox.png
(Reporter)

Comment 4

2 years ago
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
(Reporter)

Updated

2 years ago
Flags: needinfo?(the.white.soul92)

Comment 5

2 years ago
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.

Updated

2 years ago
Flags: needinfo?(the.white.soul92)

Comment 6

2 years ago
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.