Invalid ECMA constant prevents window.open()

RESOLVED WORKSFORME

Status

()

Core
DOM: Core & HTML
--
major
RESOLVED WORKSFORME
13 years ago
12 years ago

People

(Reporter: Daniel O'Connor, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

A popup window is opened with an invalid name (08) and it triggers the below
warning:

vxpopup:
Warning: 08 is not a legal ECMA-262 octal constant
Source File: http://127.0.0.1/valfirm/details.php?tab=contacts&valfirm_id=2
Line: 1, Column: 50
Source Code:
vxpopup( 'valfirm-contact-new.php?valfirm_id=2' , 0832746001126663981,450, 500);
return false;


Once this has been triggered once, component failures take place:
Error: uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]"  nsresult: "0x80004005
(NS_ERROR_FAILURE)"  location: "JS frame ::
http://127.0.0.1/presentation/js/core.js :: vxpopup :: line 28"  data: no]

Refreshing/reloading the page, etc has no effect, infact the entire browser must
be closed and restarted to get everything working again.

Reproducible: Always

Steps to Reproduce:
1. Open an invalidly named window with window.open
2. Refresh page.
3. Try to open a validly named window.

Actual Results:  
Error: uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]"  nsresult: "0x80004005
(NS_ERROR_FAILURE)"  location: "JS frame ::
http://127.0.0.1/presentation/js/core.js :: vxpopup :: line 28"  data: no]

Expected Results:  
Window opens successfully
(Reporter)

Comment 1

13 years ago
vxpopup is merely an alias for window.open().

// creates a popup window
function vxpopup( url, name, width, height, rVal ) {
	// left = (half screen width) - (half width)
	// top = (half screen height) - (half height)
	
	var ran_unrounded=Math.random()*5;
	var ran_number=Math.round(ran_unrounded)*5;

	var left;
	var top;

	left = (window.outerWidth / 2 ) - (width / 2) + ran_number;
	top  = (window.outerHeight / 2 ) - (height / 2) + ran_number;


	x = window.open( url, "win" + name,
"'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=" +
width + ",height=" + height + ",top=" + top + ",left=" +  left + "'" );
	
	if(x.focus) { x.focus(); }
	//This should work, but doesn't, to refresh parent onclose/whatever.

	//x.onsubmit=opener.location.reload;
	//x.onunload=opener.location.reload;
	//Return false to stop page load continuing, even though it's success.
	if (rVal) {
		return rVal;
	}
}

Comment 2

13 years ago
Please attach a complete testcase (including the code to call to vxpopup).
That's just a warning, it probably has no effect other than what you see in the
JS console.  What happens if you fix that constant?

/be
Assignee: general → general
Component: JavaScript Engine → DOM: Level 0
QA Contact: general → ian

Comment 4

12 years ago
Reporter:
If you don't reply to the comments here, I will close this report as WFM.

Comment 5

12 years ago
Created attachment 203012 [details]
reporter's testcase

This is the testcase from comment #0

Comment 6

12 years ago
no answer from reporter in two months and testcase WFM -> resolving as WORKSFORME
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.