Closed Bug 486880 Opened 15 years ago Closed 15 years ago

XMLLists can contain non-xml

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: sephr, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.8) Gecko/2009032712 Ubuntu/8.10 (intrepid) Firefox/3.0.8 GTB5
Build Identifier: 

XMLLists can contain non-xml. Take this code for example, where the indice of 0 is changed to a string:

    var x = new XMLList;
    x[0] = "alert(1)"
    uneval(x) == "alert(1)"
    // after bug 334628 is fixed: uneval(x) == "<>alert(1)</>"

Reproducible: Always

Steps to Reproduce:
1. Change an indice of an XMLList to a string.
2. uneval or use the toXMLString method.
Actual Results:  
"alert(1)"
After bug 334628 is fixed, it might be "<>alert(1)</>"

Expected Results:  
A TypeError is thrown.
Seems like a problem with E4X spec, invalid for Mozilla.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.