Address code review

This commit is contained in:
Yui T
2015-01-30 17:48:07 -08:00
parent 6a0eaf52bf
commit 416267172d
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -4915,7 +4915,7 @@ module ts {
container = getThisContainer(container, /* includeArrowFunctions */ false);
// When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code
needToCaptureLexicalThis = !(compilerOptions.target >= ScriptTarget.ES6);
needToCaptureLexicalThis = (languageVersion < ScriptTarget.ES6);
}
switch (container.kind) {
+1 -2
View File
@@ -1487,7 +1487,6 @@ module ts {
// targetSourceFile is when users only want one file in entire project to be emitted. This is used in compilerOnSave feature
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile?: SourceFile): EmitResult {
// var program = resolver.getProgram();
var compilerOptions = host.getCompilerOptions();
var languageVersion = compilerOptions.target || ScriptTarget.ES3;
var sourceMapDataList: SourceMapData[] = compilerOptions.sourceMap ? [] : undefined;
@@ -3241,7 +3240,7 @@ module ts {
}
function shouldEmitAsArrowFunction(node: FunctionLikeDeclaration): boolean {
return node.kind === SyntaxKind.ArrowFunction && compilerOptions.target >= ScriptTarget.ES6;
return node.kind === SyntaxKind.ArrowFunction && languageVersion >= ScriptTarget.ES6;
}
function emitFunctionDeclaration(node: FunctionLikeDeclaration) {