blob: c75c61a8b348c8fa875d9385d797648e7b62dc27 [file] [log] [blame]
// Copyright 2019 Google Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-Intl.ListFormat.prototype.format
description: >
Checks the behavior of Abstract Operation StringListFromIterable
called by Intl.ListFormat.prototype.formatToParts() while the GetIterator
throws error.
info: |
StringListFromIterable
1. If iterable is undefined, then
a. Return a new empty List.
2. Let iteratorRecord be ? GetIterator(iterable).
features: [Intl.ListFormat]
---*/
function CustomError() {}
let lf = new Intl.ListFormat();
// Test the failure case.
let get_iterator_throw_error = {
[Symbol.iterator]() {
throw new CustomError();
}
};
assert.throws(CustomError,
()=> {lf.formatToParts(get_iterator_throw_error)});