Commit 26ac0729 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[array] Add regression test that causes left trimming while sorting

This CL adds a regression test that will check that the elements
pointer is properly reloaded after the JavaScript comparison
function is called during Array.p.sort.

R=jgruber@chromium.org

Bug: chromium:859809
Change-Id: I15f55fcc1906bd8d0751596e5457367a643b92da
Reviewed-on: https://chromium-review.googlesource.com/1124475
Commit-Queue: Simon Zünd <szuend@google.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54174}
parent 1e2617dc
// Copyright 2018 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: --expose-gc
let xs = [];
const kSize = 200;
for (let i = 0; i < kSize; ++i) {
xs.push(i);
}
let counter = 0;
xs.sort((a, b) => {
if (counter++ % 10 == 0) {
xs.shift();
gc();
}
return a - b;
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment