@@ -2240,7 +2240,7 @@ namespace ts {
22402240 const namespaceMeaning = SymbolFlags.Namespace | (isInJSFile(name) ? meaning & SymbolFlags.Value : 0);
22412241 let symbol: Symbol | undefined;
22422242 if (name.kind === SyntaxKind.Identifier) {
2243- const message = meaning === namespaceMeaning ? Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(getFirstIdentifier(name).escapedText );
2243+ const message = meaning === namespaceMeaning ? Diagnostics.Cannot_find_namespace_0 : getCannotFindNameDiagnosticForName(getFirstIdentifier(name));
22442244 const symbolFromJSPrototype = isInJSFile(name) ? resolveEntityNameFromAssignmentDeclaration(name, meaning) : undefined;
22452245 symbol = resolveName(location || name, name.escapedText, meaning, ignoreErrors || symbolFromJSPrototype ? undefined : message, name, /*isUse*/ true);
22462246 if (!symbol) {
@@ -15271,8 +15271,8 @@ namespace ts {
1527115271
1527215272 // EXPRESSION TYPE CHECKING
1527315273
15274- function getCannotFindNameDiagnosticForName(name: __String ): DiagnosticMessage {
15275- switch (name ) {
15274+ function getCannotFindNameDiagnosticForName(node: Identifier ): DiagnosticMessage {
15275+ switch (node.escapedText ) {
1527615276 case "document":
1527715277 case "console":
1527815278 return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom;
@@ -15303,7 +15303,13 @@ namespace ts {
1530315303 case "Iterator":
1530415304 case "AsyncIterator":
1530515305 return Diagnostics.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later;
15306- default: return Diagnostics.Cannot_find_name_0;
15306+ default:
15307+ if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
15308+ return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
15309+ }
15310+ else {
15311+ return Diagnostics.Cannot_find_name_0;
15312+ }
1530715313 }
1530815314 }
1530915315
@@ -15315,7 +15321,7 @@ namespace ts {
1531515321 node,
1531615322 node.escapedText,
1531715323 SymbolFlags.Value | SymbolFlags.ExportValue,
15318- getCannotFindNameDiagnosticForName(node.escapedText ),
15324+ getCannotFindNameDiagnosticForName(node),
1531915325 node,
1532015326 !isWriteOnlyAccess(node),
1532115327 /*excludeGlobals*/ false,
0 commit comments