Skip to content

Commit a03f06f

Browse files
committed
add strict mdoe directive to all nones6 module emits
1 parent fbaba90 commit a03f06f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/compiler/emitter.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7383,6 +7383,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
73837383
write(`], function(${exportFunctionForFile}) {`);
73847384
writeLine();
73857385
increaseIndent();
7386+
emitUseStrictPrologueDirective();
73867387
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
73877388
emitEmitHelpers(node);
73887389
emitCaptureThisForNodeIfNecessary(node);
@@ -7493,6 +7494,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
74937494
writeModuleName(node, emitRelativePathAsModuleName);
74947495
emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, emitRelativePathAsModuleName);
74957496
increaseIndent();
7497+
emitUseStrictPrologueDirective();
74967498
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
74977499
emitExportStarHelper();
74987500
emitCaptureThisForNodeIfNecessary(node);
@@ -7505,6 +7507,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
75057507
}
75067508

75077509
function emitCommonJSModule(node: SourceFile) {
7510+
emitUseStrictPrologueDirective();
75087511
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false);
75097512
emitEmitHelpers(node);
75107513
collectExternalModuleInfo(node);
@@ -7515,6 +7518,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
75157518
emitExportEquals(/*emitAsReturn*/ false);
75167519
}
75177520

7521+
function emitUseStrictPrologueDirective() {
7522+
writeLine();
7523+
write("\"use strict\";");
7524+
}
7525+
75187526
function emitUMDModule(node: SourceFile) {
75197527
emitEmitHelpers(node);
75207528
collectExternalModuleInfo(node);
@@ -7534,6 +7542,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
75347542
})(`);
75357543
emitAMDFactoryHeader(dependencyNames);
75367544
increaseIndent();
7545+
emitUseStrictPrologueDirective();
75377546
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
75387547
emitExportStarHelper();
75397548
emitCaptureThisForNodeIfNecessary(node);

0 commit comments

Comments
 (0)