(node)
| 89025 | return !!(node.flags & 16777216 /* NodeFlags.Ambient */) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); |
| 89026 | } |
| 89027 | function checkGrammarStatementInAmbientContext(node) { |
| 89028 | if (node.flags & 16777216 /* NodeFlags.Ambient */) { |
| 89029 | // Find containing block which is either Block, ModuleBlock, SourceFile |
| 89030 | var links = getNodeLinks(node); |
| 89031 | if (!links.hasReportedStatementInAmbientContext && (ts.isFunctionLike(node.parent) || ts.isAccessor(node.parent))) { |
| 89032 | return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); |
| 89033 | } |
| 89034 | // We are either parented by another statement, or some sort of block. |
| 89035 | // If we're in a block, we only want to really report an error once |
| 89036 | // to prevent noisiness. So use a bit on the block to indicate if |
| 89037 | // this has already been reported, and don't report if it has. |
| 89038 | // |
| 89039 | if (node.parent.kind === 235 /* SyntaxKind.Block */ || node.parent.kind === 262 /* SyntaxKind.ModuleBlock */ || node.parent.kind === 305 /* SyntaxKind.SourceFile */) { |
| 89040 | var links_2 = getNodeLinks(node.parent); |
| 89041 | // Check if the containing block ever report this error |
| 89042 | if (!links_2.hasReportedStatementInAmbientContext) { |
| 89043 | return links_2.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); |
| 89044 | } |
| 89045 | } |
| 89046 | else { |
| 89047 | // We must be parented by a statement. If so, there's no need |
| 89048 | // to report the error as our parent will have already done it. |
| 89049 | // Debug.assert(isStatement(node.parent)); |
| 89050 | } |
| 89051 | } |
| 89052 | return false; |
| 89053 | } |
| 89054 | function checkGrammarNumericLiteral(node) { |
| 89055 | // Grammar checking |
| 89056 | if (node.numericLiteralFlags & 32 /* TokenFlags.Octal */) { |
no test coverage detected