Closed Bug 313929 Opened 19 years ago Closed 19 years ago

E4X: Sequence ]] should be allowed inside CDATA section

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: Seno.Aiko, Assigned: brendan)

References

()

Details

(Keywords: verified1.8.0.1, verified1.8.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051025 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051025 Firefox/1.6a1

(Followup to bug 312064)

The only thing not allowed inside a CDATA section should be the sequence ]]> but the engine currently generates a syntax error if it encounters the sequence ]] 



Reproducible: Always

Steps to Reproduce:
1. var x = <x><![CDATA[ ]] ]]></x>
Actual Results:  
SyntaxError: invalid XML markup

Expected Results:  
The same result as |var x = <x> ]] </x>|: a valid XML object containing the text " ]] ".
Personally I am not going to expend energy and reputation arguing for this bug to be fixed for 1.8/fx1.5.  Or even for js1.6, but Bob, if you want to pull the fix onto the mini-branch, I'm not opposed.  How would I flag this bug for that outcome (some kind of tracking bug, IIRC).

/be
Assignee: general → brendan
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Target Milestone: --- → mozilla1.9alpha
Attached patch fixSplinter Review
Attachment #200908 - Flags: review?(mrbkap)
Attachment #200908 - Flags: review?(mrbkap) → review+
Fixed.

/be
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Checking in 11.4.1-06.js;
/cvsroot/mozilla/js/tests/e4x/Expressions/11.4.1-06.js,v  <--  11.4.1-06.js
initial revision: 1.1
Flags: testcase+
(In reply to comment #4)

I'm sorry that I have to whine again, but this syntax error is (was?) generated during the parsing stage, you cannot catch it. Use the XML constructor instead:

actual = XML("<x><![CDATA[ ]] ]]></x>").toString();
It doesn't affect the failure in unpatched builds or the success in patched builds, but I made the change:

Checking in 11.4.1-06.js;
/cvsroot/mozilla/js/tests/e4x/Expressions/11.4.1-06.js,v  <--  11.4.1-06.js
new revision: 1.2; previous revision: 1.1
done
Comment on attachment 200908 [details] [diff] [review]
fix

Baked since 10/26/05, a safe fix for an E4X bug that does not have a workaround.

/be
Attachment #200908 - Flags: approval1.8.1?
Attachment #200908 - Flags: approval1.8.0.1?
Comment on attachment 200908 [details] [diff] [review]
fix

a=dveditz
Attachment #200908 - Flags: approval1.8.1?
Attachment #200908 - Flags: approval1.8.1+
Attachment #200908 - Flags: approval1.8.0.1?
Attachment #200908 - Flags: approval1.8.0.1+
fixed on both branches according to bonsai:

2006-01-10 21:02	brendan%mozilla.org 	mozilla/ js/ src/ jsscan.c 	3.81.2.10 	MOZILLA_1_8_BRANCH  	4/1  	Fix for 313929, a=dveditz.

2006-01-10 21:02	brendan%mozilla.org 	mozilla/ js/ src/ jsscan.c 	3.81.2.7.2.3 	MOZILLA_1_8_0_BRANCH  	4/1  	Fix for 313929, a=dveditz.
v 2006-01-11 1.8.0.1, 1.8.1, trunk windows/linux/mac
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: