// 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: --allow-natives-syntaxassertDoesNotThrow(()=>(newIntl.ListFormat()).format());// Intl.getCanonicalLocales() will create a HOLEY_ELEMENTS arrayassertDoesNotThrow(()=>(newIntl.ListFormat()).format(Intl.getCanonicalLocales()));assertDoesNotThrow(()=>(newIntl.ListFormat()).format(Intl.getCanonicalLocales(["en","fr"])));letarr=["a","b","c"];// Test under no HasHoleyElements();assertFalse(%HasHoleyElements(arr));assertDoesNotThrow(()=>(newIntl.ListFormat()).format(arr));
arr.push("xx");}assertFalse(%HasHoleyElements(arr));assertDoesNotThrow(()=>(newIntl.ListFormat()).format(arr));// Test under HasHoleyElements();arr[arr.length+10]="x";assertTrue(%HasHoleyElements(arr));assertFalse(%HasDictionaryElements(arr));assertThrows(()=>(newIntl.ListFormat()).format(arr),TypeError);// Test it work under HasDictionaryElements();arr=["a","b","c"];arr[arr.length+100000]="x";assertTrue(%HasDictionaryElements(arr));assertThrows(()=>(newIntl.ListFormat()).format(arr),TypeError);