Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 383387

Summary: js format error!
Product: [WebTools] JSDT Reporter: adil yasin <uyghurjava>
Component: WebAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: major    
Priority: P3 CC: harawata, satyam.kandula, thatnitind
Version: unspecified   
Target Milestone: 3.4.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description adil yasin CLA 2012-06-25 00:24:31 EDT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<input onchange="change();">
	<button onclick="dochange();">click</button>
	<div></div>
	<script type="text/javascript">
		function dochange() {
			var input = document.getElementsByTagName("input")[0];
			var div = document.getElementsByTagName("div")[0];

			var str = "";
			input.setAttribute("value", "bbb");
			for ( var i in window) {
				str += i + "=" + window[i] + "<BR>";
			}
			div.innerHTML = str;
		}

		function change() {
			alert(this);
		}
	</script>

</body>
</html>

after format:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<input onchange="change();">
	<button onclick="dochange();">click</button>
	<div></div>
	<script type="text/javascript">
		function dochange() {
			var input = document.getElementsByTagName("input")[0];
			var div = document.getElementsByTagName("div")[0];

			var str = "";
			input.setAttribute("value", "bbb");
			for ( var i in window) {
				str += i + "=" + window[i] + "_$ta";
			}
			div.innerHTML = str;
		}

		function change() {
			alert(this);
		}
	</script>

</body>
</html>
Comment 1 Nitin Dahyabhai CLA 2012-06-25 09:02:36 EDT
Adil, we really need a more accurate version number, specifically of the org.eclipse.wst.jsdt.web.core plug-in.
Comment 2 adil yasin CLA 2012-06-25 23:30:07 EDT
Eclipse Java EE IDE for Web Developers.

Version: Juno Release
Build id: 20120606-2254

(c) Copyright Eclipse contributors and others 2005, 2012.  All rights reserved.
Visit http://www.eclipse.org/webtools

/************************/

org.eclipse.wtp.javascript.capabilities ver:1.0.100.v201005102000
Comment 3 Iwao AVE! CLA 2012-07-03 05:07:30 EDT
I think this is the same issue as #382474.
Comment 4 Nitin Dahyabhai CLA 2012-08-13 16:20:48 EDT
Fixed with changes in bug 382474; data-loss test added to org.eclipse.jst.jsp.ui.tests.format.TestContentFormatter.