e80082bf54
ReduceArrayIndexOfIncludes didn't account for kUnreliableReceiverMaps. Will think about a more robust mechanism for this. Bug: chromium:944062 Change-Id: Ib2bdaf4399225de4413e12c5684f58dfe524a2cd Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1532331 Commit-Queue: Jaroslav Sevcik <jarin@chromium.org> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org> Cr-Commit-Position: refs/heads/master@{#60400}
18 lines
508 B
JavaScript
18 lines
508 B
JavaScript
// Copyright 2019 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: --allow-natives-syntax
|
|
|
|
function includes(key, array) {
|
|
// Transition to dictionary mode in the final invocation.
|
|
array.__defineSetter__(key, () => {});
|
|
// Will then read OOB.
|
|
return array.includes(1234);
|
|
}
|
|
includes("", []);
|
|
includes("", []);
|
|
%OptimizeFunctionOnNextCall(includes);
|
|
includes("", []);
|
|
includes("1235", []);
|