v8/test/mjsunit/regress/regress-3859.js
bmeurer f6e02e195c Compute the same hash for all NaN values.
Both SameValue and SameValueZero consider different NaNs equal, so we
better assign the same hash value to all NaNs.

BUG=v8:3859
LOG=y
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/897593002

Cr-Commit-Position: refs/heads/master@{#26391}
2015-02-03 06:29:18 +00:00

7 lines
265 B
JavaScript

// Copyright 2015 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.
assertEquals(1, new Set([NaN, NaN, NaN]).size);
assertEquals(42, new Map([[NaN, 42]]).get(NaN));