git://git.webkit.org
/
WebKit-https.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[DFG] Define defs for MapSet/SetAdd to participate in CSE
[WebKit-https.git]
/
JSTests
/
stress
/
map-set-change-get.js
1
function shouldBe(actual, expected) {
2
if (actual !== expected)
3
throw new Error('bad value: ' + actual);
4
}
5
6
function test()
7
{
8
var map = new Map();
9
map.set(42, 20);
10
var res1 = map.get(42);
11
map.set(42, 400);
12
var res2 = map.get(42);
13
return [res1, res2];
14
}
15
noInline(test);
16
17
for (var i = 0; i < 1e6; ++i) {
18
var [res1, res2] = test();
19
shouldBe(res1, 20);
20
shouldBe(res2, 400);
21
}