From 70069aeb3149e7473ce5db7bbe9ef87ba6edaac0 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Jun 2017 14:15:24 -0700 Subject: [PATCH] hasExcessProperty only uses valueDeclaration if available Previously it would crash if valueDeclaration was not set --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 266fbe573be..7ec1a0ae2b2 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8977,7 +8977,9 @@ namespace ts { reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target)); } else { - errorNode = prop.valueDeclaration; + if (prop.valueDeclaration) { + errorNode = prop.valueDeclaration; + } reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); }