diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 52717a94996..6af8a263599 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -1905,7 +1905,7 @@ namespace ts { : (name).expression; } else if (isIdentifier(name)) { - return createLiteral(name.text); + return createLiteral(unescapeIdentifier(name.text)); } else { return getSynthesizedClone(name); diff --git a/tests/baselines/reference/decoratorWithUnderscoreMethod.js b/tests/baselines/reference/decoratorWithUnderscoreMethod.js index 03037980ee7..bf79890263b 100644 --- a/tests/baselines/reference/decoratorWithUnderscoreMethod.js +++ b/tests/baselines/reference/decoratorWithUnderscoreMethod.js @@ -34,4 +34,4 @@ var A = (function () { }()); __decorate([ dec() -], A.prototype, "___foo"); +], A.prototype, "__foo");