Closed
Description
TypeScript Version: 3.5.1 (possibly earlier)
Search Terms:
use strict emit file
Code
// @target: esnext
// @module: commonjs
"use strict";
let x = "x" as const;
class A {
[x] = 1;
}
Expected behavior:
Should emit the following:
"use strict";
var _a;
let x = "x";
class A {
constructor() {
this[_a] = 1;
}
}
_a = x;
Actual behavior:
Emits the following ("use strict" is not at the top of the file):
var _a;
"use strict";
let x = "x";
class A {
constructor() {
this[_a] = 1;
}
}
_a = x;
Playground Link: http://www.typescriptlang.org/play/index.html#code/MYewdgzgLgBAHjAvDARHFBuAUMANgQwghgEEYBvLGamAbTgF0kYBGbAXyA