summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Map/iterator-is-undefined-throws.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Map/iterator-is-undefined-throws.js')
-rw-r--r--js/src/tests/test262/built-ins/Map/iterator-is-undefined-throws.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Map/iterator-is-undefined-throws.js b/js/src/tests/test262/built-ins/Map/iterator-is-undefined-throws.js
new file mode 100644
index 0000000000..f6a3c01bea
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Map/iterator-is-undefined-throws.js
@@ -0,0 +1,21 @@
+// Copyright (C) 2018 Amal Hussein. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-map-objects
+description: >
+ Throws a TypeError if the iterator of the iterable is undefined.
+info: |
+ Map ( [ iterable ] )
+ ...
+ 9. Let iteratorRecord be ? GetIterator(iterable).
+features: [Symbol.iterator]
+---*/
+
+var iterable = { [Symbol.iterator]: undefined };
+
+assert.throws(TypeError,
+ function () {
+ new Map(iterable);
+});
+
+reportCompare(0, 0);