mark.lam@apple.com | 598a773 | 2016-11-14 18:27:41 +0000 | [diff] [blame] | 1 | //@ if $jitTests then runNoCJIT("--useDFGJIT=false", "--useLLInt=false") else skip end |
fpizlo@apple.com | 343b6f1 | 2015-09-24 19:23:58 +0000 | [diff] [blame] | 2 | |
| 3 | function foo(o) { |
| 4 | return o.f; |
| 5 | } |
| 6 | |
| 7 | var p1 = {}; |
| 8 | p1.f = 42; |
| 9 | |
| 10 | var crazy = {}; |
| 11 | crazy.f = 1; |
| 12 | crazy.g = 2; |
| 13 | |
| 14 | var p2 = Object.create(p1); |
| 15 | |
| 16 | var crazy = Object.create(p1); |
| 17 | crazy.f = 1; |
| 18 | crazy.g = 2; |
| 19 | |
| 20 | function make() { |
| 21 | return Object.create(p2); |
| 22 | } |
| 23 | |
| 24 | for (var i = 0; i < 100; ++i) |
| 25 | foo(make()); |
| 26 | |
| 27 | for (var i = 0; i < 10000; ++i) |
| 28 | p2["i" + i] = i; |
| 29 | p2.f = 43; |
| 30 | |
| 31 | for (var i = 0; i < 100; ++i) |
| 32 | foo({f:24}); |
| 33 | |
| 34 | var result = foo(make()); |
| 35 | if (result != 43) |
| 36 | throw "Error: bad result: " + result; |