mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'whitneyit-feature/noEmitExtends'
This commit is contained in:
@@ -71,6 +71,10 @@ module ts {
|
||||
type: "boolean",
|
||||
description: Diagnostics.Do_not_emit_outputs,
|
||||
},
|
||||
{
|
||||
name: "noEmitHelpers",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
name: "noEmitOnError",
|
||||
type: "boolean",
|
||||
|
||||
+19
-15
@@ -5614,24 +5614,28 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
|
||||
// emit prologue directives prior to __extends
|
||||
var startIndex = emitDirectivePrologues(node.statements, /*startWithNewLine*/ false);
|
||||
// Only Emit __extends function when target ES5.
|
||||
// For target ES6 and above, we can emit classDeclaration as is.
|
||||
if ((languageVersion < ScriptTarget.ES6) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitExtends)) {
|
||||
writeLines(extendsHelper);
|
||||
extendsEmitted = true;
|
||||
}
|
||||
|
||||
if (!decorateEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitDecorate) {
|
||||
writeLines(decorateHelper);
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
writeLines(metadataHelper);
|
||||
// Only emit helpers if the user did not say otherwise.
|
||||
if (!compilerOptions.noEmitHelpers) {
|
||||
// Only Emit __extends function when target ES5.
|
||||
// For target ES6 and above, we can emit classDeclaration as is.
|
||||
if ((languageVersion < ScriptTarget.ES6) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitExtends)) {
|
||||
writeLines(extendsHelper);
|
||||
extendsEmitted = true;
|
||||
}
|
||||
decorateEmitted = true;
|
||||
}
|
||||
|
||||
if (!paramEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitParam) {
|
||||
writeLines(paramHelper);
|
||||
paramEmitted = true;
|
||||
if (!decorateEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitDecorate) {
|
||||
writeLines(decorateHelper);
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
writeLines(metadataHelper);
|
||||
}
|
||||
decorateEmitted = true;
|
||||
}
|
||||
|
||||
if (!paramEmitted && resolver.getNodeCheckFlags(node) & NodeCheckFlags.EmitParam) {
|
||||
writeLines(paramHelper);
|
||||
paramEmitted = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isExternalModule(node) || compilerOptions.separateCompilation) {
|
||||
|
||||
@@ -1657,6 +1657,7 @@ module ts {
|
||||
mapRoot?: string;
|
||||
module?: ModuleKind;
|
||||
noEmit?: boolean;
|
||||
noEmitHelpers?: boolean;
|
||||
noEmitOnError?: boolean;
|
||||
noErrorTruncation?: boolean;
|
||||
noImplicitAny?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user