961e99d320
Remove harmony-intl-{other-calendars,add-calendar-numbering-system} https://www.chromestatus.com/features/5440249461211136 Bug: v8:9154 Change-Id: I8331d3cbd55e19ab1b1f983fef2e772fa7dc856c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2163816 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#67377}
67 lines
2.0 KiB
JavaScript
67 lines
2.0 KiB
JavaScript
// Copyright 2019 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.
|
|
|
|
let intlClasses = [
|
|
Intl.RelativeTimeFormat,
|
|
Intl.NumberFormat,
|
|
Intl.DateTimeFormat
|
|
];
|
|
|
|
// Check "nu" on Intl.RelativeTimeFormat, Intl.NumberFormat and
|
|
// Intl.DateTimeFormat
|
|
intlClasses.forEach(function(cls) {
|
|
let o1 = (new cls("en")).resolvedOptions();
|
|
assertEquals('latn', o1.numberingSystem);
|
|
|
|
let o2 = (new cls("en-u-nu-arab")).resolvedOptions();
|
|
assertEquals("arab", o2.numberingSystem);
|
|
assertEquals("en-u-nu-arab", o2.locale);
|
|
|
|
let o3 = (new cls(
|
|
"en-u-nu-arab", {numberingSystem: 'thai'})).resolvedOptions();
|
|
assertEquals("thai", o3.numberingSystem);
|
|
assertEquals("en", o3.locale);
|
|
|
|
let o4 = (new cls(
|
|
"en", {numberingSystem: 'bali'})).resolvedOptions();
|
|
assertEquals("bali", o4.numberingSystem);
|
|
assertEquals("en", o4.locale);
|
|
|
|
let o5 = (new cls("ar-SA")).resolvedOptions();
|
|
assertEquals('arab', o5.numberingSystem);
|
|
|
|
|
|
let o6 = (new cls(
|
|
"ar-SA-u-nu-arab", {numberingSystem: 'thai'})).resolvedOptions();
|
|
assertEquals("thai", o6.numberingSystem);
|
|
assertEquals("ar-SA", o6.locale);
|
|
|
|
let o7 = (new cls(
|
|
"ar-SA-u-nu-arab", {numberingSystem: 'arab'})).resolvedOptions();
|
|
assertEquals("arab", o7.numberingSystem);
|
|
assertEquals("ar-SA-u-nu-arab", o7.locale);
|
|
});
|
|
|
|
// Check "ca" on Intl.DateTimeFormat
|
|
cls = Intl.DateTimeFormat;
|
|
let o1 = (new cls("en")).resolvedOptions();
|
|
assertEquals('gregory', o1.calendar);
|
|
|
|
let o2 = (new cls("en-u-ca-roc")).resolvedOptions();
|
|
assertEquals("roc", o2.calendar);
|
|
assertEquals("en-u-ca-roc", o2.locale);
|
|
|
|
let o3 = (new cls(
|
|
"en-u-ca-roc", {calendar: 'chinese'})).resolvedOptions();
|
|
assertEquals("chinese", o3.calendar);
|
|
assertEquals("en", o3.locale);
|
|
|
|
let o4 = (new cls(
|
|
"en", {calendar: 'japanese'})).resolvedOptions();
|
|
assertEquals("japanese", o4.calendar);
|
|
assertEquals("en", o4.locale);
|
|
|
|
let o5 = (new cls("fa")).resolvedOptions();
|
|
assertEquals('persian', o5.calendar);
|