| // Copyright 2018 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| invalid_co.forEach(function(co) { |
| let col = new Intl.Collator(["en-u-co-" + co]); |
| assertEquals("en", col.resolvedOptions().locale); |
| valid_locales.forEach(function(l) { |
| let col = new Intl.Collator([l + "-fo-obar"]); |
| assertEquals(l, col.resolvedOptions().locale); |
| valid_co.forEach(function([locale, collation]) { |
| let col = new Intl.Collator([locale + "-u-co-" + collation]); |
| assertEquals(collation, col.resolvedOptions().collation); |
| let col2 = new Intl.Collator([locale], {collation}); |
| assertEquals(collation, col2.resolvedOptions().collation); |