Commit 837ce0f9 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[test] Adjust empty PropertyArray regression test

Make sure we have at least two elements in the Map, otherwise we don't
perform a proper dictionary lookup.

Bug: chromium:781218
Change-Id: I471e3822b95c15e3a5b2ac54c8ad1f030bd54d40
Reviewed-on: https://chromium-review.googlesource.com/768708Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49345}
parent b6a6f675
...@@ -24,7 +24,10 @@ f(new C()); ...@@ -24,7 +24,10 @@ f(new C());
var o = new C(); var o = new C();
%HeapObjectVerify(o); %HeapObjectVerify(o);
m.set(o, 1); // This creates hash code on o. // We need at least 2 elements in the Map.
m.set({}, 3);
// This creates hash code on o.
m.set(o, 1);
// Add an out-of-object property. // Add an out-of-object property.
o.x = true; o.x = true;
...@@ -41,3 +44,10 @@ f(o); ...@@ -41,3 +44,10 @@ f(o);
%HeapObjectVerify(o); %HeapObjectVerify(o);
assertEquals(1, m.get(o)); assertEquals(1, m.get(o));
// Grow the Map and ensure the object is still found.
for (let i = 0; i < 1000; i++) {
let object = {};
m.set(object, object);
assertEquals(1, m.get(o));
}
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