Skip to content

Commit e5b5fe1

Browse files
sheetalkamatmhegazy
authored andcommitted
When creating string literal for property access, unescape the identifier text
Fixes #12562
1 parent 86f69f1 commit e5b5fe1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/transformers/ts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@ namespace ts {
19051905
: (<ComputedPropertyName>name).expression;
19061906
}
19071907
else if (isIdentifier(name)) {
1908-
return createLiteral(name.text);
1908+
return createLiteral(unescapeIdentifier(name.text));
19091909
}
19101910
else {
19111911
return getSynthesizedClone(name);

tests/baselines/reference/decoratorWithUnderscoreMethod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ var A = (function () {
3434
}());
3535
__decorate([
3636
dec()
37-
], A.prototype, "___foo");
37+
], A.prototype, "__foo");

0 commit comments

Comments
 (0)