blob: 65690075df67f80f0c31ed23563bac8ebc1b84dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.toSorted
description: >
Array.prototype.toSorted throws if the receiver is null or undefined
info: |
Array.prototype.toSorted ( compareFn )
1. Let O be ? ToObject(this value).
...
features: [change-array-by-copy]
---*/
assert.throws(TypeError, () => {
Array.prototype.toSorted.call(null);
}, '`Array.prototype.toSorted.call(null)` throws TypeError');
assert.throws(TypeError, () => {
Array.prototype.toSorted.call(undefined);
}, '`Array.prototype.toSorted.call(undefined)` throws TypeError');
reportCompare(0, 0);
|