git://git.webkit.org
/
WebKit-https.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[JSC] Generate put_by_val_direct for indexed identifiers instead of put_by_id with...
[WebKit-https.git]
/
Source
/
JavaScriptCore
/
tests
/
stress
/
put-by-id-direct-should-be-done-for-non-index-property.js
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
}());