Address CR feedback

This commit is contained in:
Anders Hejlsberg 2017-09-03 17:34:30 -07:00
parent 0d47c73ba6
commit 88cddc234d

View File

@ -9070,7 +9070,7 @@ namespace ts {
const propDeclaration = prop.valueDeclaration as ObjectLiteralElementLike;
Debug.assertNode(propDeclaration, isObjectLiteralElementLike);
if (getContainingStatement(errorNode) === getContainingStatement(propDeclaration)) {
if (findAncestor(errorNode, isStatement) === findAncestor(propDeclaration, isStatement)) {
errorNode = propDeclaration;
}
@ -12815,13 +12815,6 @@ namespace ts {
undefined;
}
function getContainingStatement(node: Node): Node {
while (node && !isStatement(node)) {
node = node.parent;
}
return node;
}
function getThisTypeArgument(type: Type): Type {
return getObjectFlags(type) & ObjectFlags.Reference && (<TypeReference>type).target === globalThisType ? (<TypeReference>type).typeArguments[0] : undefined;
}