v8/test/mjsunit/harmony/array-to-reversed-big.js
Shu-yu Guo 6cd16f02cb [change-array-by-copy] Split out slow toReversed test
Bug: v8:13328, v8:12764
Change-Id: Idd079b6eaa7e47b0cbe57840e9cd185c2abfe7dd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913771
Reviewed-by: Adam Klein <adamk@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83440}
2022-09-26 18:28:38 +00:00

15 lines
407 B
JavaScript

// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-change-array-by-copy
(function TestBigPacked() {
let a = [];
for (let i = 0; i < 50000; i++) a.push(i);
let r = a.toReversed();
for (let i = 0; i < 50000; i++) {
assertEquals(r[i], a.at(-(i+1)));
}
})();