fbfbc5c28b
LocaleBuilder validates better, it also fixes most cases in transformed-ext-invalid except one. Bug: v8:10447 Change-Id: I6fed6692ca3264198e42ccc3d9ca4bfb54fb0517 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2549688 Commit-Queue: Frank Tang <ftang@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/master@{#71300}
24 lines
837 B
JavaScript
24 lines
837 B
JavaScript
// Copyright 2017 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.
|
|
|
|
// Make sure that invalid locales throw RangeError
|
|
|
|
var invalid_locales = ["arcdefghl-Latn", "fil-Latn-kxx", "fr-Latn-CAK",
|
|
"en-Latin-US", "en-a-foo-9charlong", "en-a-b",
|
|
];
|
|
|
|
for (let locale of invalid_locales) {
|
|
assertThrows("var nf = new Intl.NumberFormat('" + locale + "')", RangeError);
|
|
}
|
|
|
|
var not_so_long_locales = [
|
|
"bs-u-nu-bzcu-cab-cabs-avnlubs-avnihu-zcu-cab-cbs-avnllubs-avnihq-zcu-cab-cbs-ubs-avnihu-cabs-flus-xxd",
|
|
"bs-u-nu-bzcu-cab-cabs-avnlubs-avnihu-zcu",
|
|
];
|
|
|
|
for (let locale of not_so_long_locales) {
|
|
assertEquals((new Intl.NumberFormat(locale)).resolvedOptions().numberingSystem,
|
|
"latn");
|
|
}
|