be123e4057
Make locales and options required and no default for type in options. Bug: v8:10623 Change-Id: I5df065a95e82ecb3b8b036d1b4738f296aa7243f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2291617 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/master@{#68854}
26 lines
639 B
JavaScript
26 lines
639 B
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.
|
|
|
|
// Throws only once during construction.
|
|
// Check for all getters to prevent regression.
|
|
// Preserve the order of getter initialization.
|
|
let getCount = 0;
|
|
|
|
new Intl.DisplayNames(['en-US'], {
|
|
get localeMatcher() {
|
|
assertEquals(0, getCount++);
|
|
},
|
|
get style() {
|
|
assertEquals(1, getCount++);
|
|
},
|
|
get type() {
|
|
assertEquals(2, getCount++);
|
|
return 'language';
|
|
},
|
|
get fallback() {
|
|
assertEquals(3, getCount++);
|
|
},
|
|
});
|
|
assertEquals(4, getCount);
|