| 1 |
// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. |
| 2 |
// Copyright 2012 Mozilla Corporation. All rights reserved. |
| 3 |
// This code is governed by the BSD license found in the LICENSE file. |
| 4 |
|
| 5 |
/*--- |
| 6 |
es5id: 9.2.5_11_g_ii_2 |
| 7 |
description: > |
| 8 |
Tests that missing Unicode extension values default to true for |
| 9 |
boolean keys. |
| 10 |
author: Norbert Lindenberg |
| 11 |
---*/ |
| 12 |
|
| 13 |
var extensions = ["-u-co-phonebk-kn", "-u-kn-co-phonebk"]; |
| 14 |
extensions.forEach(function (extension) { |
| 15 |
var defaultLocale = new Intl.Collator().resolvedOptions().locale; |
| 16 |
var collator = new Intl.Collator([defaultLocale + extension], {usage: "sort"}); |
| 17 |
var locale = collator.resolvedOptions().locale; |
| 18 |
var numeric = collator.resolvedOptions().numeric; |
| 19 |
if (numeric !== undefined) { |
| 20 |
assert.sameValue(numeric, true, "Default value for \"kn\" should be true, but is " + numeric + "."); |
| 21 |
assert.sameValue(locale.indexOf("-kn"), -1, "\"kn\" is returned in locale, but shouldn't be."); |
| 22 |
} |
| 23 |
}); |