[JSC] Do not use asArrayModes() with Structures because it discards TypedArray inform...
[WebKit-https.git] / JSTests / stress / delete-by-val-ftl.js
1 function shouldBe(actual, expected)
2 {
3     if (actual !== expected)
4         throw new Error('bad value: ' + actual);
5 }
6
7 function test1(object, key)
8 {
9     return delete object[key];
10 }
11 noInline(test1);
12
13 function test2(object, key)
14 {
15     return delete object[key];
16 }
17 noInline(test2);
18
19 for (var i = 0; i < 1e5; ++i) {
20     var object = {
21         cocoa: 42
22     };
23     Object.defineProperty(object, "cappuccino", {
24         value: 42
25     });
26     shouldBe(test1(object, "cocoa"), true);
27     shouldBe(test2(object, "cappuccino"), false);
28 }