blob: 5ee64cafeebcff7843ac57d91254eb63b5bbd631 [file] [log] [blame]
utatane.tea@gmail.comcb7ea562015-08-20 20:18:45 +00001function shouldBe(actual, expected)
2{
3 if (actual !== expected)
4 throw new Error('bad value: ' + actual);
5}
6
7function assign(object, name, value)
8{
9 object[name] = value;
10}
11noInline(assign);
12
13var string = 'hello';
14for (var i = 0; i < 10001; ++i) {
15 var object = {};
16 if (i === 10000) {
17 assign(object, 42, 42);
18 shouldBe(object[42], 42);
19 shouldBe(object.hello, undefined);
20 } else {
21 assign(object, string, 42);
22 shouldBe(object[string], 42);
23 }
24}
25