35 lines
526 B
TypeScript
35 lines
526 B
TypeScript
//// [computedPropertyNames4_ES6.ts]
|
|
var s: string;
|
|
var n: number;
|
|
var a: any;
|
|
var v = {
|
|
[s]: 0,
|
|
[n]: n,
|
|
[s + s]: 1,
|
|
[s + n]: 2,
|
|
[+s]: s,
|
|
[""]: 0,
|
|
[0]: 0,
|
|
[a]: 1,
|
|
[<any>true]: 0,
|
|
[`hello bye`]: 0,
|
|
[`hello ${a} bye`]: 0
|
|
}
|
|
|
|
//// [computedPropertyNames4_ES6.js]
|
|
var s;
|
|
var n;
|
|
var a;
|
|
var v = {
|
|
[s]: 0,
|
|
[n]: n,
|
|
[s + s]: 1,
|
|
[s + n]: 2,
|
|
[+s]: s,
|
|
[""]: 0,
|
|
[0]: 0,
|
|
[a]: 1,
|
|
[true]: 0,
|
|
[`hello bye`]: 0,
|
|
[`hello ${a} bye`]: 0
|
|
};
|