Skip to content

Commit f2918fd

Browse files
committed
Merge branch '3454' of https://github.com/ShyykoSerhiy/TypeScript into ShyykoSerhiy-3454
2 parents c17934e + 1280912 commit f2918fd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/compiler/emitter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4219,6 +4219,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
42194219
scopeEmitStart(node, "constructor");
42204220
increaseIndent();
42214221
if (ctor) {
4222+
// Emit all the directive prologues (like "use strict"). These have to come before
4223+
// any other preamble code we write (like parameter initializers).
4224+
var startIndex = emitDirectivePrologues(ctor.body.statements, /*startWithNewLine*/ true);
42224225
emitDetachedComments(ctor.body.statements);
42234226
}
42244227
emitCaptureThisForNodeIfNecessary(node);
@@ -4253,7 +4256,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
42534256
if (superCall) {
42544257
statements = statements.slice(1);
42554258
}
4256-
emitLines(statements);
4259+
emitLinesStartingAt(statements, startIndex);
42574260
}
42584261
emitTempDeclarations(/*newLine*/ true);
42594262
writeLine();

tests/baselines/reference/strictModeInConstructor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ var A = (function () {
7474
var B = (function (_super) {
7575
__extends(B, _super);
7676
function B() {
77-
this.s = 9;
7877
"use strict"; // No error
78+
this.s = 9;
7979
_super.call(this);
8080
}
8181
return B;

0 commit comments

Comments
 (0)