mirror of https://github.com/tc39/test262.git
24 lines
758 B
JavaScript
24 lines
758 B
JavaScript
|
// Copyright 2018 the V8 project authors. All rights reserved.
|
||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||
|
|
||
|
/*---
|
||
|
esid: sec-segment-iterator-prototype
|
||
|
description: Verifies the behavior for the iterators.
|
||
|
features: [Intl.Segmenter]
|
||
|
---*/
|
||
|
|
||
|
const otherReceivers = [
|
||
|
1, 123.45, undefined, null, "string", true, false,
|
||
|
Intl, Intl.Segmenter, Intl.Segmenter.prototype,
|
||
|
prototype,
|
||
|
new Intl.Segmenter(),
|
||
|
new Intl.Collator(),
|
||
|
new Intl.DateTimeFormat(),
|
||
|
new Intl.NumberFormat(),
|
||
|
];
|
||
|
for (const rec of otherReceivers) {
|
||
|
assert.throws(TypeError, () => prototype.next.call(rec));
|
||
|
assert.throws(TypeError, () => prototype.following.call(rec));
|
||
|
assert.throws(TypeError, () => prototype.preceding.call(rec));
|
||
|
}
|