[JSC] Do not use asArrayModes() with Structures because it discards TypedArray inform...
[WebKit-https.git] / JSTests / stress / delete-by-id.js
1 function shouldBe(actual, expected)
2 {
3     if (actual !== expected)
4         throw new Error('bad value: ' + actual);
5 }
6
7 function test1(object)
8 {
9     return delete object.cocoa;
10 }
11 noInline(test1);
12
13 function test2(object)
14 {
15     return delete object.cappuccino;
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), true);
27     shouldBe(test2(object), false);
28 }