/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
gTestfile = '13.5.2.js';
START("13.5.2 - XMLList Constructor");
x = new XMLList();
TEST(1, "xml", typeof(x));
TEST(2, true, x instanceof XMLList);
// Load from another XMLList
// Make sure it is copied if it's an XMLList
x =
<>
one
two
>;
y = new XMLList(x);
x += three;
TEST(3, "one\ntwo", y.toString());
// Load from one XML type
x = new XMLList(one);
TEST_XML(4, "one", x);
// Load from Anonymous
x = new XMLList(<>onetwo>);
TEST(5, "one\ntwo", x.toString());
// Load from Anonymous as string
x = new XMLList(<>onetwo>);
TEST(6, "one\ntwo", x.toString());
// Load from single textnode
x = new XMLList("foobar");
TEST_XML(7, "foobar", x);
x = XMLList(7);
TEST_XML(8, 7, x);
// Undefined and null should behave like ""
x = new XMLList(null);
TEST_XML(9, "", x);
x = new XMLList(undefined);
TEST_XML(10, "", x);
END();