Subj : Re: E4X; assigning an XMLList to a property of an XML object
To : Martin.Honnen
From : Brendan Eich
Date : Sun Apr 17 2005 11:12 am
Martin Honnen wrote:
> I have the simple test case
>
> var god = Kibo;
> print(god);
>
> god.name = <>JamesKibo>;
> print(god);
>
> which runs fine in Spidermonkey resulting in the output
>
>
> James
> Kibo
>
>
> meaning Spidermonkey replaces the element with the elements in
> the XMLList but Rhino throws an error complaining
>
> uncaught JavaScript runtime exception: TypeError : Can't
> move/copy/insert a whole document.
[snip]
> Should I file a bug on Rhino?
Yes, if one isn't already on file. For your example assignment
god.name = <>JamesKibo>;
ECMA-357 9.1.1.2 XML [[Put]] Step 12 deletes all but the first
elements being replaced by this [[Put]], and then (step 15(a)) calls
Replace on the XML object being updated with arguments (index of first
) and (deep copy of list on right-hand side of assignemnt).
9.1.1.12 XML [[Replace]] Step 6 does the rest.
/be
.