| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
gTestfile = '13.2.5.js'; |
| 8 |
|
| 9 |
START("13.2.5 - Properties of Namespace Instances"); |
| 10 |
|
| 11 |
n = new Namespace("ns", "http://someuri"); |
| 12 |
TEST(1, true, n.hasOwnProperty("prefix")); |
| 13 |
TEST(2, true, n.hasOwnProperty("uri")); |
| 14 |
TEST(3, true, n.propertyIsEnumerable("prefix")); |
| 15 |
TEST(4, true, n.propertyIsEnumerable("uri")); |
| 16 |
|
| 17 |
var prefixCount = 0; |
| 18 |
var uriCount = 0; |
| 19 |
var p; |
| 20 |
for(p in n) |
| 21 |
{ |
| 22 |
if(p == "prefix") prefixCount++; |
| 23 |
if(p == "uri") uriCount++; |
| 24 |
} |
| 25 |
|
| 26 |
TEST(5, 1, prefixCount); |
| 27 |
TEST(6, 1, uriCount); |
| 28 |
TEST(7, "ns", n.prefix); |
| 29 |
TEST(8, "http://someuri", n.uri); |
| 30 |
|
| 31 |
END(); |