Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Array / prototype / with / immutable.js
blob04c1621dff4e2ab5197a3642783bb0bc6b6b5031
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 does not mutate its this value
8 features: [change-array-by-copy]
9 includes: [compareArray.js]
10 ---*/
12 var arr = [0, 1, 2];
13 arr.with(1, 3);
15 assert.compareArray(arr, [0, 1, 2]);
16 assert.notSameValue(arr.with(1, 3), arr);
17 assert.notSameValue(arr.with(1, 1), arr);
19 reportCompare(0, 0);