Merge branch 'master' into release-2.1

This commit is contained in:
Mohamed Hegazy
2016-12-14 13:58:01 -08:00
25 changed files with 179 additions and 22 deletions

View File

@@ -466,9 +466,7 @@ namespace ts {
// other kinds of value declarations take precedence over modules
target.valueDeclaration = source.valueDeclaration;
}
forEach(source.declarations, node => {
target.declarations.push(node);
});
addRange(target.declarations, source.declarations);
if (source.members) {
if (!target.members) target.members = createMap<Symbol>();
mergeSymbolTable(target.members, source.members);
@@ -1100,7 +1098,7 @@ namespace ts {
}
function getDeclarationOfAliasSymbol(symbol: Symbol): Declaration | undefined {
return forEach(symbol.declarations, d => isAliasSymbolDeclaration(d) ? d : undefined);
return find<Declaration>(symbol.declarations, isAliasSymbolDeclaration);
}
function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration): Symbol {

View File

@@ -1024,8 +1024,11 @@ namespace ts {
}
}
// Return the result if we have an immediate super() call on the last statement.
if (superCallExpression && statementOffset === ctorStatements.length - 1) {
// Return the result if we have an immediate super() call on the last statement,
// but only if the constructor itself doesn't use 'this' elsewhere.
if (superCallExpression
&& statementOffset === ctorStatements.length - 1
&& !(ctor.transformFlags & (TransformFlags.ContainsLexicalThis | TransformFlags.ContainsCapturedLexicalThis))) {
const returnStatement = createReturn(superCallExpression);
if (superCallExpression.kind !== SyntaxKind.BinaryExpression

View File

@@ -23,6 +23,7 @@ namespace ts.JsDoc {
"lends",
"link",
"memberOf",
"method",
"name",
"namespace",
"param",

View File

@@ -616,9 +616,8 @@ namespace ts {
else {
declarations.push(functionDeclaration);
}
forEachChild(node, visit);
}
forEachChild(node, visit);
break;
case SyntaxKind.ClassDeclaration: