Closed Bug 379525 Opened 17 years ago Closed 11 years ago

uneval gives bogus result for E4X (properties?)

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jruderman, Unassigned)

References

Details

(Keywords: testcase)

js> uneval({j: XML.prototype.toString})
({j:})

This string can't be recompiled.  For contrast, uneval does fine with Object.toString:

js> uneval({j: Object.toString})
({j:function toString() {[native code]}})
Oh, that's not even a real toString function.  Here's a less misleading testcase:

js> uneval({a:<x/>.foo})
({a:})
Summary: uneval gives bogus result for XML.prototype.toString → uneval gives bogus result for E4X (properties?)
Related to bug 334628?
(In reply to comment #0)
> js> uneval({j: XML.prototype.toString})
> ({j:})

it should be
js> uneval({j: XML.prototype.function::toString})

(In reply to comment #2)
> Related to bug 334628?

As the current bug tittle, Yes.
root cause is same, error in [XML/XMLList].toSource().

example 
(<><a/><a/></>).toSource() gives "<a/><a/>"


Jesse, there is a temp fix using JS
see attachment 283138 [details],283135
Blocks: e4x
E4X will be removed again from Spidermonkey (bug 788293)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.