TypeScript/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.js
LowR cd0434aa76
fix(39744): make template literals more spec compliant (#45304)
* fix(39744): make template literals more spec compliant

* Add evaluation test for template literals

* Add test for template literals with source map
2021-10-13 12:03:31 -07:00

24 lines
430 B
TypeScript

//// [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();