Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Array / prototype / with / this-value-nullish.js
blob64f029d55e4ffb0b851e37ef9e44473277190e97
1 // Copyright (C) 2021 Igalia, S.L. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: sec-array.prototype.with
6 description: >
7   Array.prototype.with throws if the receiver is null or undefined
8 info: |
9   Array.prototype.with ( index, value )
11   1. Let O be ? ToObject(this value).
12   ...
13 features: [change-array-by-copy]
14 ---*/
16 assert.throws(TypeError, () => {
17   Array.prototype.with.call(null, 0, 0);
18 });
20 assert.throws(TypeError, () => {
21   Array.prototype.with.call(undefined, 0, 0);
22 });
24 reportCompare(0, 0);