65cc04fbd7
Bug: v8:8030, v8:8031 Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: Iaac58cc3a692ea9d7c986b24414403b57d00b904 Reviewed-on: https://chromium-review.googlesource.com/1180084 Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#55322}
23 lines
708 B
JavaScript
23 lines
708 B
JavaScript
// 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.
|
|
|
|
// Flags: --harmony-intl-list-format
|
|
|
|
var locales = ["tlh", "id", "en"];
|
|
var input = ["a", "b", "c"];
|
|
var referenceListFormat = new Intl.ListFormat(locales);
|
|
var referenceFormatted = referenceListFormat.format(input);
|
|
|
|
class MyFormat extends Intl.ListFormat {
|
|
constructor(locales, options) {
|
|
super(locales, options);
|
|
// could initialize MyListFormat properties
|
|
}
|
|
// could add methods to MyListFormat.prototype
|
|
}
|
|
|
|
var format = new MyFormat(locales);
|
|
var actual = format.format(input);
|
|
assertEquals(actual, referenceFormatted);
|