Closed
Bug 287909
Opened 20 years ago
Closed 7 years ago
Rhino parser does not accept E4X comment literals
Categories
(Rhino Graveyard :: E4X, defect)
Tracking
(Not tracked)
RESOLVED
INACTIVE
People
(Reporter: martin.honnen, Unassigned)
References
Details
Attachments
(1 file)
|
273 bytes,
text/plain
|
Details |
The section 11.1.4 XML Initialiser in the E4X specification says:
"An XML initialiser is an expression describing the initialization of an XML
object, written in a form of a literal. It may specify an XML element, an XML
comment, an XML PI, or a CDATA section using ordinary XML syntax."
That suggests to me that it should possible to write an XML initializer
representing a single comment for instance. And indeed the test case
XML.ignoreComments = false;
print("XML.ignoreComments: " + XML.ignoreComments);
var comment = <!-- Kibology for all. -->;
if (comment) {
print('comment.nodeKind(): ' + comment.nodeKind());
}
else {
print('comment === undefined: ' + (comment === undefined));
}
when run in Spidermonkey is parsed and executed without problems:
js> load('mozillaBugs/e4x/singleComment1.js');
XML.ignoreComments: false
comment.nodeKind(): comment
With Rhino however parsing the test case yields syntax error messages, no
execution happens:
Rhino 1.6 release 1 2004 11 30
js> load('mozillaBugs/e4x/singleComment1.js');
js: "C:\Dokumente und Einstellungen\All
Users\Dokumente\javascript\mozillaBugs\e4x\singleComment1.js", line 4: syntax error
js: if (comment) {
js: ..^
js: "C:\Dokumente und Einstellungen\All
Users\Dokumente\javascript\mozillaBugs\e4x\singleComment1.js", line 6: syntax error
js: }
js: ^
js: "C:\Dokumente und Einstellungen\All
Users\Dokumente\javascript\mozillaBugs\e4x\singleComment1.js", line 1:
Compilation produced 2 syntax errors.
If the Spidermonkey behaviour is correct then this is a bug in Rhino.
| Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•19 years ago
|
||
Reassigning to please_see_bug_288433@eml.cc pending resolution of bug 288433
Assignee: igor.bukanov → please_see_bug_288433
Updated•19 years ago
|
Assignee: please_see_bug_288433 → nobody
Updated•18 years ago
|
Summary: XML initializer with single comment is not recognized → Rhino parser does not accept E4X comment literals
Comment 3•7 years ago
|
||
Closing. Bug management is now done here:
https://github.com/mozilla/rhino
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
You need to log in
before you can comment on or make changes to this bug.
Description
•