summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/ListFormat/prototype/format/iterable-getiterator-throw.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/ListFormat/prototype/format/iterable-getiterator-throw.js')
-rw-r--r--js/src/tests/test262/intl402/ListFormat/prototype/format/iterable-getiterator-throw.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/ListFormat/prototype/format/iterable-getiterator-throw.js b/js/src/tests/test262/intl402/ListFormat/prototype/format/iterable-getiterator-throw.js
new file mode 100644
index 0000000000..88d701a832
--- /dev/null
+++ b/js/src/tests/test262/intl402/ListFormat/prototype/format/iterable-getiterator-throw.js
@@ -0,0 +1,29 @@
+// 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.format() 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.format(get_iterator_throw_error)});
+
+reportCompare(0, 0);