If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

E4X: extra " / > \n in Function.toSource

RESOLVED WONTFIX

Status

()

Core
JavaScript Engine
RESOLVED WONTFIX
12 years ago
5 years ago

People

(Reporter: Biju, Unassigned)

Tracking

({testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
E4X: extra " / > \n in Function.toSource

function a(){
  a=<?xml version="1.0"?>
  a1=<{a} a="a"/>;
  a2=<{a} a="a"></a>;
  a3=<{a} a="a">1</a>;
  x=<a> a new line 
  then a backslash \ then a slash <b a="aa 
 \  "/></a>
}

a



give ==>


function a() {
    a = <?xml "version=\"1.0\""?>;
    a1 = <{a} a="a"/>/>;
    a2 = <{a} a="a">></a>;
    a3 = <{a} a="a">>1</a>;
    x = <a> a new line \n  then a backslash \\ then a slash <b a="aa \n \\  "/></a>;
}



3 issues:-

1. extra " in processing instruction
2. extra  /> and >
3. new line and backslash not unescaped and shown as \n  \\

I dont know if they are separate bugs or the same


step:-


1. navigate attachment "extra_stuff_in_toSource.html"

2. click Input Case "0" link

3. Click "test" button

4. repeat for links 1, 2, 3, 4 ....
(Reporter)

Comment 1

12 years ago
Created attachment 218130 [details]
extra_stuff_in_toSource.html test case
(Reporter)

Comment 2

12 years ago
==1===

x=<y><{'x'} a="n" /></y>;

x


gives ==>

<y>
  <x a="n"/>
  /&gt;
</y>


==2===


x=<{'x'} a="n"></x>;

x.toXMLString()

gives ==>

<x a="n">&gt;</x>



===3=====

x=<{'x'} a="n" />

x.toXMLString()


gives ==> 

syntax error
(Reporter)

Comment 3

11 years ago
1. extra " in processing instruction
3. new line and backslash not unescaped and shown as \n  \\
resolved....

now only issue 2 remains. ie, 
2. extra  /> and >


Also seeing 
function (){

  x12=<?xml versio n= "1.0" ?>
  x18 = <?xml version="1.0" {'encoding'}={"iso-8859-1"}"?>;
}

as valid, ie
for x12, a space between "versio" and "n" is ok
for x18, an extra " at the end is OK
(Reporter)

Updated

10 years ago
Blocks: 246441
Should be fixed by saved source.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.