Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: test/mjsunit/es6/map-minus-zero.js

Issue 947443005: Fix issue with -0 in Maps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove extra file Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/es6/set-minus-zero.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 var map = new Map();
8
9 var objectKey = {};
10 var stringKey = 'keykeykey';
11 var numberKey = 42.24;
12 var booleanKey = true;
13 var undefinedKey = undefined;
14 var nullKey = null;
15 var nanKey = NaN;
16 var zeroKey = 0;
17 var minusZeroKey = -0;
18
19 assertEquals(map.size, 0);
20
21 map.set(objectKey, 'aaa');
22 map.set(stringKey, 'bbb');
23 map.set(numberKey, 'ccc');
24 map.set(booleanKey, 'ddd');
25 map.set(undefinedKey, 'eee');
26 map.set(nullKey, 'fff');
27 map.set(nanKey, 'ggg');
28 map.set(zeroKey, 'hhh');
29
30 assertEquals(8, map.size);
31
32 assertEquals('aaa', map.get(objectKey));
33 assertEquals('bbb', map.get(stringKey));
34 assertEquals('ccc', map.get(numberKey));
35 assertEquals('ddd', map.get(booleanKey));
36 assertEquals('eee', map.get(undefinedKey));
37 assertEquals('fff', map.get(nullKey));
38 assertEquals('ggg', map.get(nanKey));
39 assertEquals('hhh', map.get(zeroKey));
40
41 assertEquals(undefined, map.get({}));
42 assertEquals('bbb', map.get('keykeykey'));
43 assertEquals('ccc', map.get(42.24));
44 assertEquals('ddd', map.get(true));
45 assertEquals('eee', map.get(undefined));
46 assertEquals('fff', map.get(null));
47 assertEquals('ggg', map.get(NaN));
48 assertEquals('hhh', map.get(0));
49 assertEquals('hhh', map.get(-0));
50 assertEquals('hhh', map.get(1 / Infinity));
51 assertEquals('hhh', map.get(-1 / Infinity));
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/es6/set-minus-zero.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698