Closed Bug 334628 Opened 19 years ago Closed 12 years ago

E4X: eval(uneval([XMLList])) gives error

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: BijuMailList, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(3 files)

E4X: eval(uneval([XMLList])) gives error Thanks for Bug# 327534 fix now uneval([<><a/><a/></>]) is fine. But following are still a problem. eval(uneval([<><a/><a/></>])); eval(uneval([<><a b="c"/><a b="d"/></>])); eval(uneval([<><a>1</a><a>2</a></>])); eval(([<><a>1</a><a>2</a></>]).toSource()); eval(uneval({x:<><a/><a/></>})); eval(uneval({x:<><a b="c"/><a b="d"/></>})); eval(uneval({x:<><a>1</a><a>2</a></>})); eval(({x:<><a>1</a><a>2</a></>}).toSource()); all gives SyntaxError reason uneval(<><a/><a/></>) gives ==> <a/> <a/> which is not a XMLList steps 1. open e4x_uneval_eval.html 2. click Input Case : 0 link 3. click test button 4. repeat for all
Attached file e4x_uneval_eval.html (deleted) —
test case
This bug confuses jsfunfuzz (and me) frequently. It would be nice if it were fixed.
Attached file XML_toSource_fix.js (deleted) —
here is a temp fix with JavaScript. if(!XML.prototype.function::_toXMLString){ XML.prototype.function::_toXMLString = XML.prototype.function::toXMLString; XML.prototype.function::toXMLString = function toXMLString(){ var i=0, x, ret=this._toXMLString(); if(!ret) return '<></>'; if(this === this[0]) return ret; for(x in this) if(++i>1) return '<>\n' + ret + '\n</>'; return '<>' + ret + '</>'; } } if(!XML.prototype.function::_toSource){ XML.prototype.function::_toSource = XML.prototype.function::toSource; XML.prototype.function::toSource = function toSource(){ return '(' + this.toXMLString() + ')'; } }
Attached file modified_e4x_uneval_eval.html (deleted) —
test case with XML_toSource_fix.js
above test case also show Bug 379525 issue
Blocks: e4x
E4X will be removed again from Spidermonkey (bug 788293)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: