add strict mdoe directive to all nones6 module emits

This commit is contained in:
Wesley Wigham 2015-11-23 14:39:41 -08:00
parent fbaba90ac9
commit a03f06f766

View file

@ -7383,6 +7383,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
write(`], function(${exportFunctionForFile}) {`);
writeLine();
increaseIndent();
emitUseStrictPrologueDirective();
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
emitEmitHelpers(node);
emitCaptureThisForNodeIfNecessary(node);
@ -7493,6 +7494,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
writeModuleName(node, emitRelativePathAsModuleName);
emitAMDDependencies(node, /*includeNonAmdDependencies*/ true, emitRelativePathAsModuleName);
increaseIndent();
emitUseStrictPrologueDirective();
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
emitExportStarHelper();
emitCaptureThisForNodeIfNecessary(node);
@ -7505,6 +7507,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
}
function emitCommonJSModule(node: SourceFile) {
emitUseStrictPrologueDirective();
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false);
emitEmitHelpers(node);
collectExternalModuleInfo(node);
@ -7515,6 +7518,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
emitExportEquals(/*emitAsReturn*/ false);
}
function emitUseStrictPrologueDirective() {
writeLine();
write("\"use strict\";");
}
function emitUMDModule(node: SourceFile) {
emitEmitHelpers(node);
collectExternalModuleInfo(node);
@ -7534,6 +7542,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
})(`);
emitAMDFactoryHeader(dependencyNames);
increaseIndent();
emitUseStrictPrologueDirective();
const startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ true);
emitExportStarHelper();
emitCaptureThisForNodeIfNecessary(node);