After confirm() Javascript function call, current script stops executing with no reported errors

RESOLVED WORKSFORME

Status

()

Core
DOM: Core & HTML
--
major
RESOLVED WORKSFORME
10 years ago
10 years ago

People

(Reporter: Mark Williams, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4) Gecko/2008030714 Firefox/3.0b4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4) Gecko/2008030714 Firefox/3.0b4

The confirm() call appears to work fine, but after it completes (OK or Cancel is clicked), any Javascript following the confirm() call does not execute.  No errors are reported in the Error Console.

Reproducible: Always

Steps to Reproduce:
1. Load HTML page (below, following these steps)
2. Click the link on the page
3. Choose either OK or Cancel from the confirm() dialog
4. Calls to alert() that follow do not execute

Page is:

<html>
	<head>
		<script type="text/javascript">
			function testClick() {
				if ( confirm("Please click OK") ) {
					alert("OK was clicked");  // This code is never reached in Firefox 3 beta 3!!!
				} else {
					alert("OK was not clicked");  // This code is never reached in Firefox 3 beta 3!!!
				}
				alert("End of test");  // This code is never reached in Firefox 3 beta 3!!!
			}
		</script>
	</head>
	<body>
		<a href="#" onclick="testClick()">Click here</a>
	</body>
</html>


Actual Results:  
Calls to alert() do not execute

Expected Results:  
Two alert() dialogs should appear; the first should depend on which confirm dialog button is clicked by the user.
(Reporter)

Comment 1

10 years ago
I first noticed the problem in Firefox 3 beta 3, but it is still present in Firefox 3 beta 4.
(Reporter)

Updated

10 years ago
Component: General → JavaScript Engine
Product: Firefox → Core
Assignee: nobody → general
QA Contact: general → general
Blocking here, probably wants beta exposure.  I don't think it's likely to be an engine bug, since those are all host objects, so over to DOM.

This doesn't reproduce the bug:

javascript:confirm("confirm"); alert("made it");

and neither does the test case, which I'll attach as usable HTML in a second.  WFM.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → WORKSFORME
Created attachment 309972 [details]
test case

The above test case for ease of testing.
(Reporter)

Comment 4

10 years ago
The test case is no longer working for me either, but it definitely was before.  There must be some other factor involved... maybe the number of windows/tabs open, or memory usage?  I will continue to run the test case periodically to see if I can reproduce the problem again.

Updated

10 years ago
Component: JavaScript Engine → DOM: Level 0
Assignee: general → nobody
QA Contact: general → general
You need to log in before you can comment on or make changes to this bug.