summaryrefslogtreecommitdiff
path: root/test/built-ins/Map/iterator-is-undefined-throws.js
blob: 0f4ab836472acd3a75c5a87e5192a01bedf836b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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);
});