Don't error when 'reserved' names appear in ambient contexts.

Fixes #8293
This commit is contained in:
Ryan Cavanaugh
2016-04-26 13:10:06 -07:00
parent fed42cc6bd
commit de4f2797c6
4 changed files with 18 additions and 11 deletions

View File

@@ -1377,7 +1377,8 @@ namespace ts {
if (inStrictMode &&
node.originalKeywordKind >= SyntaxKind.FirstFutureReservedWord &&
node.originalKeywordKind <= SyntaxKind.LastFutureReservedWord &&
!isIdentifierName(node)) {
!isIdentifierName(node) &&
!isInAmbientContext(node)) {
// Report error only if there are no parse errors in file
if (!file.parseDiagnostics.length) {