blob: 57ad6431c9eda83853d9e42014a8ae49ae0c61a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// |reftest| shell-option(--enable-iterator-helpers) skip-if(!this.hasOwnProperty('Iterator')||!xulRuntime.shell) -- iterator-helpers is not enabled unconditionally, requires shell-options
// Copyright (C) 2023 Michael Ficarra. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-iteratorprototype.drop
description: >
Iterator.prototype.drop throws TypeError when its this value is an object with a non-callable next
info: |
%Iterator.prototype%.drop ( limit )
1. Let iterated be ? GetIteratorDirect(this value).
features: [iterator-helpers]
flags: []
---*/
let iter = Iterator.prototype.drop.call({ next: 0 }, 1);
assert.throws(TypeError, function () {
iter.next();
});
reportCompare(0, 0);
|