TypeScript/tests/cases/conformance/es6/computedProperties/computedPropertyNames49_ES5.ts
2015-02-19 13:11:59 -08:00

25 lines
373 B
TypeScript

var x = {
p1: 10,
get [1 + 1]() {
throw 10;
},
get [1 + 1]() {
return 10;
},
set [1 + 1]() {
// just throw
throw 10;
},
get foo() {
if (1 == 1) {
return 10;
}
},
get foo() {
if (2 == 2) {
return 20;
}
},
p2: 20
}