mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
477 B
TypeScript
26 lines
477 B
TypeScript
//// [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]
|
|
"use strict";
|
|
// @ts-check
|
|
let n = Math.random();
|
|
let s = `${n}`;
|
|
const numericIndex = { [n]: 1 };
|
|
numericIndex[n].toFixed();
|
|
const stringIndex = { [s]: 1 };
|
|
stringIndex[s].toFixed();
|