Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9936,8 +9936,7 @@ namespace ts {
// Due to the emit for class decorators, any reference to the class from inside of the class body
// must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
// behavior of class names in ES6.
if (languageVersion === ScriptTarget.ES2015
&& declaration.kind === SyntaxKind.ClassDeclaration
if (declaration.kind === SyntaxKind.ClassDeclaration
&& nodeIsDecorated(declaration)) {
let container = getContainingClass(node);
while (container !== undefined) {
Expand Down
7 changes: 4 additions & 3 deletions tests/baselines/reference/es6modulekindWithES5Target11.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var C = (function () {
var C = C_1 = (function () {
function C() {
this.p = 1;
}
C.x = function () { return C.y; };
C.x = function () { return C_1.y; };
C.prototype.method = function () { };
return C;
}());
C.y = 1;
C = __decorate([
C = C_1 = __decorate([
foo
], C);
export default C;
var C_1;