mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
added coverage for built-in Map spec to ensure that a TypeError is thrown when Symbol.iterator is undefined (#1444)
This commit is contained in:
parent
2fb8eca677
commit
66eaf57f88
19
test/built-ins/Map/iterator-is-undefined-throws.js
Normal file
19
test/built-ins/Map/iterator-is-undefined-throws.js
Normal file
@ -0,0 +1,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);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user