1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
//// [tests/cases/compiler/checkJsObjectLiteralIndexSignatures.ts] ////
//// [file.js]
// @ts-check
let n = Math.random();
let s = `${n}`;
const numericIndex = { [n]: 1 };
numericIndex[n].toFixed();
const stringIndex = { [s]: 1 };
stringIndex[s].toFixed();
//// [file.js]
// @ts-check
var _a, _b;
var n = Math.random();
var s = "".concat(n);
var numericIndex = (_a = {}, _a[n] = 1, _a);
numericIndex[n].toFixed();
var stringIndex = (_b = {}, _b[s] = 1, _b);
stringIndex[s].toFixed();
|