]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/put-by-id-direct-should-be-done-for-non-index-property.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / put-by-id-direct-should-be-done-for-non-index-property.js
CommitLineData
ed1e77d3
A
1(function () {
2 var object = {
3 2: 2
4 };
5
6 var result = object[2];
7 if (result !== 2)
8 throw new Error('bad value:' + result);
9}());
10
11
12(function () {
13 var object = {
14 get 2() {
15 return 1;
16 },
17 set 2(value) {
18 throw new Error(2);
19 },
20 };
21
22 var result = object[2];
23 if (result !== 1)
24 throw new Error('bad value:' + result);
25}());
26
27(function () {
28 var object = {
29 get 2() {
30 return 1;
31 },
32 set 2(value) {
33 throw new Error(2);
34 },
35 2: 2, // Do not throw new Error(2)
36 };
37
38 var result = object[2];
39 if (result !== 2)
40 throw new Error('bad value:' + result);
41}());