18 lines
373 B
JavaScript
18 lines
373 B
JavaScript
|
//// [computedPropertyNamesContextualType3_ES5.ts]
|
||
|
interface I {
|
||
|
[s: string]: (x: string) => number;
|
||
|
}
|
||
|
|
||
|
var o: I = {
|
||
|
[+"foo"](y) { return y.length; },
|
||
|
[+"bar"]: y => y.length
|
||
|
}
|
||
|
|
||
|
//// [computedPropertyNamesContextualType3_ES5.js]
|
||
|
var o = {
|
||
|
[+"foo"]: function (y) {
|
||
|
return y.length;
|
||
|
},
|
||
|
[+"bar"]: function (y) { return y.length; }
|
||
|
};
|