Closed
Bug 271545
Opened 21 years ago
Closed 21 years ago
XML() does not create empty text nodes
Categories
(Rhino Graveyard :: E4X, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
1.6R1
People
(Reporter: igor, Assigned: igor)
Details
Attachments
(1 file)
|
859 bytes,
patch
|
Details | Diff | Splinter Review |
Werner Sharp wrote:
>
> In the appendChild behavior below, it looks like Rhino is treating "new
> XML()" different than "new XML("")". The same issue appears when doing...
>
> x = new XML();
> x.a = "foo";
> print (x.toXMLString());
> x = new XML("");
> x.a = "foo";
> print (x.toXMLString());
>
> The first case creates "<a>foo</a>" while the second case does not.
| Assignee | ||
Comment 1•21 years ago
|
||
Here is a relevant section of ECMA 357:
13.4.2 The XML Constructor
Syntax
new XML ( [ value ] )
...
Semantics
When the XML constructor is called with no arguments or a single argument value,
the following steps are taken:
1. If value is null, undefined or not supplied, let value be the empty string
...
| Assignee | ||
Comment 2•21 years ago
|
||
Changing the title: the actual bug is that while XML() creates true leaf empty
text object which should ignore attempts to add xml child to it, the resulting
XML("") does allow child insertion.
Note that XML(nonEmptyStringWithoutXMLMarkup) behaves properly and creates text
node which ignore any attempt to add a child to it.
Summary: XML() does not behave as XML("") → XML("") does not create empty text nodes
| Assignee | ||
Comment 3•21 years ago
|
||
Changing title one more time:
The bug is that while XML("") does create empty text node, XML() creates
non-leaf object.
Summary: XML("") does not create empty text nodes → XML() does not create empty text nodes
| Assignee | ||
Comment 4•21 years ago
|
||
I added e4x/Regress/regress-271545.js to the test suite which currently generates:
Bug Number 271545
STATUS: XML("") should create empty text node
Failure messages were:
FAILED!: Section 1 of test -
FAILED!: Expected value:
FAILED!:
FAILED!: Actual value:
FAILED!: <a>foo</a>
FAILED!:
| Assignee | ||
Comment 5•21 years ago
|
||
| Assignee | ||
Comment 6•21 years ago
|
||
I committed the fix
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.6R1
You need to log in
before you can comment on or make changes to this bug.
Description
•